Index: branches/5.0.x/core/kernel/db/cat_event_handler.php =================================================================== diff -u -r12666 -r12726 --- branches/5.0.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 12666) +++ branches/5.0.x/core/kernel/db/cat_event_handler.php (.../cat_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; @@ -673,7 +673,7 @@ } } - /*if ( !$this->Application->IsAdmin() ) { + /*if (!$this->Application->isAdminUser) { $object->addFilter('expire_filter', '%1$s.Expire IS NULL OR %1$s.Expire > UNIX_TIMESTAMP()'); }*/ @@ -722,7 +722,7 @@ // Link1 (before modifications) [Status = 1, OrgId = NULL], Link2 (after modifications) [Status = -2, OrgId = Link1_ID] $pending_editing = $this->Application->getUnitOption($object->Prefix, 'UsePendingEditing'); - if ( !$this->Application->IsAdmin() ) { + if (!$this->Application->isAdminUser) { $types = explode(',', $types); if (in_array('my_items', $types)) { $allow_statuses = Array (STATUS_ACTIVE, STATUS_PENDING, STATUS_PENDING_EDITING); @@ -872,7 +872,7 @@ $object =& $event->getObject(); /* @var $object kCatDBItem */ - if( $this->Application->IsAdmin() && ($this->Application->GetVar($click_field.'_original') !== false) && + if( $this->Application->isAdminUser && ($this->Application->GetVar($click_field.'_original') !== false) && floor($this->Application->GetVar($click_field.'_original')) != $object->GetDBField($click_field) ) { $sql = 'SELECT MAX('.$click_field.') FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' @@ -953,7 +953,7 @@ $this->setCustomExportColumns($event); } - if (!$this->Application->IsAdmin()) { + if (!$this->Application->isAdminUser) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -987,7 +987,7 @@ $this->setCustomExportColumns($event); } - if (!$this->Application->IsAdmin()) { + if (!$this->Application->isAdminUser) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -2183,7 +2183,8 @@ */ function OnBeforeItemCreate(&$event) { - if ($this->Application->IsAdmin()) { + if ($this->Application->isAdminUser) { + // don't set permission-based status, when creating categories in admin return true; } @@ -2278,7 +2279,7 @@ function OnUpdate(&$event) { $use_pending = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing'); - if ($this->Application->IsAdmin() || !$use_pending) { + if ($this->Application->isAdminUser || !$use_pending) { parent::OnUpdate($event); $this->SetFrontRedirectTemplate($event, 'modify'); return ; @@ -2370,7 +2371,7 @@ */ function SetFrontRedirectTemplate(&$event, $template_key) { - if ($this->Application->IsAdmin() || $event->status != erSUCCESS) { + if ($this->Application->isAdminUser || $event->status != erSUCCESS) { return ; } @@ -2454,7 +2455,7 @@ { parent::OnDelete($event); - if ($event->status == erSUCCESS && !$this->Application->IsAdmin()) { + if ($event->status == erSUCCESS && !$this->Application->isAdmin) { $event->SetRedirectParam('pass', 'm'); $event->SetRedirectParam('m_cat_id', 0); } @@ -2496,7 +2497,7 @@ */ function SetSorting(&$event) { - if (!$this->Application->IsAdmin()) { + if (!$this->Application->isAdmin) { $event->setEventParam('same_special', true); } @@ -2511,7 +2512,7 @@ */ function getPerPage(&$event) { - if (!$this->Application->IsAdmin()) { + if (!$this->Application->isAdmin) { $event->setEventParam('same_special', true); }