Kim Keown 9ee2292b7b Revise new-post.php - Admin folder rename
Add variable in bl-kernel/boot/init.php that allows User to rename bl-kernel/admin folder. 
User can then define variable in bl-kernel/boot/init.php and change the foldername itself to effect the rename. 

Add global $adminfolder as necessary and replace relevant 'admin' strings with $adminfolder.
Applies to most of the files in bl-kernel/admin/controllers.

Line 14 - Reference Admin folder variable within function
	       global $adminfolder;

Line 29 - Replace Admin string with folder variable:
		Redirect::page($adminfolder, 'manage-posts');
Original:   Redirect::page('admin', 'manage-posts');
2016-10-25 06:26:39 -06:00

55 lines
1.6 KiB
PHP

<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
function addPost($args)
{
global $dbPosts;
global $Language;
global $adminfolder;
// Add the page, if the $key is FALSE the creation of the post failure.
$key = $dbPosts->add($args);
if($key)
{
// Reindex tags, this function is in 70.posts.php
reIndexTagsPosts();
// Call the plugins after post created.
Theme::plugins('afterPostCreate');
// Alert for the user
Alert::set($Language->g('Post added successfully'));
Redirect::page($adminfolder, 'manage-posts');
}
else
{
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to create the post.');
}
return false;
}
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
addPost($_POST);
}
// ============================================================================
// Main after POST
// ============================================================================