Index: branches/5.0.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -r12666 -r12726 --- branches/5.0.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 12666) +++ branches/5.0.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 12726) @@ -1,6 +1,6 @@ Application->IsAdmin()) { + if (!$this->Application->isAdmin) { if ($event->Name == 'OnSetSortingDirect') { // allow sorting on front event without view permission return true; @@ -306,7 +306,7 @@ $object->addFilter('perm_filter2', $view_filter); } - if (!$this->Application->IsAdmin()) { + if (!$this->Application->isAdminUser) { // apply status filter only on front $object->addFilter('status_filter', $object->TableName.'.Status = 1'); } @@ -538,7 +538,7 @@ return $this->_getPassedStructureID($event); } - if ($this->Application->IsAdmin()) { + if ($this->Application->isAdmin) { return parent::getPassedID($event); } @@ -593,7 +593,7 @@ $created = $this->_prepareAutoPage($object, $template, null, SMS_MODE_AUTO, false); // create virtual (not system!) page if ($created) { - if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild') || !$this->Application->IsAdmin()) { + if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild') || !$this->Application->isAdmin) { $updater =& $this->Application->recallObject('kPermCacheUpdater'); /* @var $updater kPermCacheUpdater */ @@ -614,7 +614,7 @@ } } - if (!$page_id && !$this->Application->IsAdmin()) { + if (!$page_id && !$this->Application->isAdmin) { $page_id = $this->Application->GetVar('m_cat_id'); } @@ -1220,7 +1220,7 @@ { $this->_beforeItemChange($event); - if ($this->Application->IsAdmin() || $event->Prefix == 'st') { + if ($this->Application->isAdminUser || $event->Prefix == 'st') { // don't check category permissions when auto-creating structure pages return ; } @@ -1247,7 +1247,7 @@ $min_priority = $this->_getNextPriority($object->GetDBField('ParentId'), $object->TableName); $object->SetDBField('Priority', $min_priority); - /*if (!$this->Application->IsAdmin()) { + /*if (!$this->Application->isAdminUser) { $object->SetDBField('IsMenu', 0); // add all suggested categories as non-menu }*/ } @@ -1298,7 +1298,8 @@ { parent::OnCreate($event); - if ($this->Application->IsAdmin() || $event->status != erSUCCESS) { + if ($this->Application->isAdminUser || $event->status != erSUCCESS) { + // don't sent email or rebuild cache directly after category is created by admin return ; } @@ -1330,7 +1331,7 @@ */ function getPerPage(&$event) { - if (!$this->Application->IsAdmin()) { + if (!$this->Application->isAdmin) { $event->setEventParam('same_special', true); } @@ -1349,7 +1350,7 @@ { parent::SetPagination($event); - if (!$this->Application->IsAdmin()) { + if (!$this->Application->isAdmin) { $page_var = $event->getEventParam('page_var'); if ($page_var !== false) { $page = $this->Application->GetVar($page_var); @@ -1533,7 +1534,7 @@ $object->SetError('Template', 'no_inherit'); } - if (!$this->Application->IsAdmin() || !$this->Application->LoggedIn()) { + if (!$this->Application->isAdminUser) { // only administrator can set/change "cust_RssSource" field if ($object->GetDBField('cust_RssSource') != $object->GetOriginalField('cust_RssSource')) { @@ -1824,7 +1825,7 @@ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); - if ($this->Application->IsAdmin()) { + if ($this->Application->isAdmin) { // don't sort by Front-End sorting fields $config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping'); $remove_keys = Array ('DefaultSorting1Field', 'DefaultSorting2Field', 'DefaultSorting1Dir', 'DefaultSorting2Dir'); @@ -1860,7 +1861,8 @@ { parent::OnAfterItemLoad($event); - if (!$this->Application->IsAdmin()) { + if (!$this->Application->isAdmin) { + // calculate priorities dropdown only for admin return ; }