From cb75b24aa7a5c2d0502dd0802cb4d41c7f40692a Mon Sep 17 00:00:00 2001 From: Kim Keown Date: Thu, 27 Oct 2016 09:12:38 -0600 Subject: [PATCH] Revision to edit-page.php - Admin folder rename Update 10-27. Upon further reading about global variables, it seems they are only declared when the string replacement is within a function. After testing deletion of the global intended to encompass if/else replacements occurring within a function file outside of the functions, the pages appear to work normally. The additional global on the function pages is apparently unnecessary, therefore I am removing them. 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 15- Reference Admin folder variable within function global $adminfolder; Line 33 - Replace Admin string with folder variable: Redirect::page($adminfolder, 'edit-page/'.$args['slug']); Original: Redirect::page('admin', 'edit-page/'.$args['slug']); Line 45- Reference Admin folder variable within function global $adminfolder; Line 53 - Replace Admin string with folder variable: Redirect::page($adminfolder, 'manage-pages'); Original: Redirect::page('admin', 'manage-pages'); Line 88 - Replace Admin string with folder variable: Redirect::page($adminfolder, 'manage-pages'); Original: Redirect::page('admin', 'manage-pages'); --- bl-kernel/admin/controllers/edit-page.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/bl-kernel/admin/controllers/edit-page.php b/bl-kernel/admin/controllers/edit-page.php index 3929079a..6c013951 100644 --- a/bl-kernel/admin/controllers/edit-page.php +++ b/bl-kernel/admin/controllers/edit-page.php @@ -80,8 +80,6 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) // Main after POST // ============================================================================ -global $adminfolder; - if(!$dbPages->pageExists($layout['parameters'])) { Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to get the page: '.$layout['parameters']);