Index: branches/RC/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r10459 -r10538 --- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 10459) +++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 10538) @@ -264,8 +264,8 @@ $category_path = explode('|', substr($object->GetDBField('ParentPath'), 1, -1)); $module_info = $category_helper->getCategoryModule($params, $category_path); - // WORK AROUND -- TODO - if ($module_info['Var'] != 'cms') { + // In-Edit & Proj-CMS module prefixes doesn't have custom field with item template + if ($module_info['Var'] != 'cms' && $module_info['Var'] != 'st') { // 2. get item template by current category & module prefix $mod_rewrite_helper = $this->Application->recallObject('ModRewriteHelper'); 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