Index: branches/RC/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r10516 -r10538 --- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 10516) +++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 10538) @@ -735,7 +735,8 @@ */ function OnBeforeItemCreate(&$event) { - if ($this->Application->IsAdmin()) { + if ($this->Application->IsAdmin() || $event->Prefix == 'st') { + // don't check category permissions when auto-creating structure pages return ; } @@ -973,6 +974,31 @@ $this->clearSelectedIDs($event); } + + /** + * Checks, that currently loaded item is allowed for viewing (non permission-based) + * + * @param kEvent $event + * @return bool + */ + function checkItemStatus(&$event) + { + $status_fields = $this->Application->getUnitOption($event->Prefix,'StatusField'); + if (!$status_fields) { + return true; + } + + $status_field = array_shift($status_fields); + if ($status_field == 'Status' || $status_field == 'Enabled') { + $object =& $event->getObject(); + if (!$object->isLoaded()) { + return true; + } + + return $object->GetDBField($status_field) == STATUS_ACTIVE || $object->GetDBField($status_field) == 4; + } + return true; + } } ?> \ No newline at end of file