Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/categories/categories_event_handler.php
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Line(s) | |||||
'ParentId' => $item_category, | 'ParentId' => $item_category, | ||||
); | ); | ||||
} | } | ||||
return $items; | return $items; | ||||
} | } | ||||
/** | /** | ||||
* Creates "EDITING_MODE" constant. | |||||
* | |||||
* @param kEvent $event Event. | |||||
* | |||||
* @return void | |||||
*/ | |||||
protected function OnAfterStartupHook(kEvent $event) | |||||
{ | |||||
if ( !$this->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 | * Set's mark, that root category is edited | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
* @return void | * @return void | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function OnEdit(kEvent $event) | protected function OnEdit(kEvent $event) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 2925 Lines • Show Last 20 Lines |