bludit/bl-kernel/admin/controllers/configure-plugin.php
Kim Keown c29ee5b685 Revise configure-plugin.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 variable as necessary and replace relevant 'admin' strings with $adminfolder.
Applies to most of the files in bl-kernel/admin/controllers.

Line 9 - Replace Admin string with folder variable:
	        Redirect::page($adminfolder, 'dashboard');
Original: 	Redirect::page('admin', 'dashboard');

Line 31 - Replace Admin string with folder variable:
	        Redirect::page($adminfolder, 'plugins');
Original: 	Redirect::page('admin', 'plugins');

Line 36- Replace Admin string with folder variable:
	        Redirect::page($adminfolder, 'plugins');
Original: 	Redirect::page('admin', 'plugins');
2016-10-25 05:08:43 -06:00

55 lines
1.6 KiB
PHP

<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
if($Login->role()!=='admin') {
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
Redirect::page($adminfolder, 'dashboard');
}
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
$_Plugin = false;
$pluginClassName = $layout['parameters'];
foreach($plugins['all'] as $P)
{
if($P->className()==$pluginClassName) {
$_Plugin = $P;
}
}
// Check if the plugin exists.
if($_Plugin===false) {
Redirect::page($adminfolder, 'plugins');
}
// Check if the plugin has the method form()
if(!method_exists($_Plugin, 'form')) {
Redirect::page($adminfolder, 'plugins');
}
// ============================================================================
// POST Method
// ============================================================================
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
$_Plugin->setDb($_POST);
Theme::plugins('afterFormSave');
Alert::set($Language->g('the-changes-have-been-saved'));
}
// ============================================================================
// Main after POST
// ============================================================================