Index: branches/5.2.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -r16560 -r16563 --- branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 16560) +++ branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 16563) @@ -1,6 +1,6 @@ Application->GetVar('admin') ) { + // User can't edit anything. + kUtil::safeDefine('EDITING_MODE', ''); + + return; + } + + /** @var Session $admin_session */ + $admin_session = $this->Application->recallObject('Session.admin'); + + // Store Admin Console User's ID to Front-End's session for cross-session permission checks. + $this->Application->StoreVar('admin_user_id', (int)$admin_session->RecallVar('user_id')); + + $base_category = $this->Application->getBaseCategory(); + + if ( $this->Application->CheckAdminPermission('CATEGORY.MODIFY', 0, $base_category) ) { + // User can edit cms blocks (when viewing front-end through admin's frame). + $editing_mode = $this->Application->GetVar('editing_mode'); + define('EDITING_MODE', $editing_mode ? $editing_mode : EDITING_MODE_BROWSE); + } + + // User can't edit anything. + kUtil::safeDefine('EDITING_MODE', ''); + } + + /** * Set's mark, that root category is edited * * @param kEvent $event Index: branches/5.2.x/core/kernel/processors/main_processor.php =================================================================== diff -u -r16513 -r16563 --- branches/5.2.x/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 16513) +++ branches/5.2.x/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 16563) @@ -1,6 +1,6 @@ Application->ConfigValue('Require_AdminSSL'); } Index: branches/5.2.x/core/kernel/application.php =================================================================== diff -u -r16561 -r16563 --- branches/5.2.x/core/kernel/application.php (.../application.php) (revision 16561) +++ branches/5.2.x/core/kernel/application.php (.../application.php) (revision 16563) @@ -1,6 +1,6 @@ GetVar('admin') ) { - /** @var Session $admin_session */ - $admin_session = $this->recallObject('Session.admin'); - // store Admin Console User's ID to Front-End's session for cross-session permission checks - $this->StoreVar('admin_user_id', (int)$admin_session->RecallVar('user_id')); - - if ( $this->CheckAdminPermission('CATEGORY.MODIFY', 0, $this->getBaseCategory()) ) { - // user can edit cms blocks (when viewing front-end through admin's frame) - $editing_mode = $this->GetVar('editing_mode'); - define('EDITING_MODE', $editing_mode ? $editing_mode : EDITING_MODE_BROWSE); - } - } - - kUtil::safeDefine('EDITING_MODE', ''); // user can't edit anything $this->Phrases->setPhraseEditing(); $this->EventManager->ProcessRequest(); Index: branches/5.2.x/core/units/categories/categories_config.php =================================================================== diff -u -r16388 -r16563 --- branches/5.2.x/core/units/categories/categories_config.php (.../categories_config.php) (revision 16388) +++ branches/5.2.x/core/units/categories/categories_config.php (.../categories_config.php) (revision 16563) @@ -1,6 +1,6 @@ '*', 'DoEvent' => 'OnCloneSubItem', ), + + array( + 'Mode' => hAFTER, + 'Conditional' => false, + 'HookToPrefix' => 'adm', + 'HookToSpecial' => '', + 'HookToEvent' => array('OnStartup'), + 'DoPrefix' => '', + 'DoSpecial' => '', + 'DoEvent' => 'OnAfterStartupHook', + ), ), 'AutoLoad' => true,