Index: branches/RC/kernel/admin_templates/catalog_tab.tpl =================================================================== diff -u -r8929 -r9043 --- branches/RC/kernel/admin_templates/catalog_tab.tpl (.../catalog_tab.tpl) (revision 8929) +++ branches/RC/kernel/admin_templates/catalog_tab.tpl (.../catalog_tab.tpl) (revision 9043) @@ -19,6 +19,11 @@ Grids['c.showall'].DblClick = function() {return false}; + + + alert(''); + + #separator# Index: branches/RC/core/kernel/db/db_event_handler.php =================================================================== diff -u -r9040 -r9043 --- branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 9040) +++ branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 9043) @@ -929,9 +929,8 @@ * @param kEvent $event */ function customProcessing(&$event, $type) - { - - + { + } /* Edit Events mostly used in Admin */ @@ -2092,8 +2091,8 @@ readfile($path); exit(); - } - + } + } Index: branches/RC/core/admin_templates/catalog_tab.tpl =================================================================== diff -u -r8929 -r9043 --- branches/RC/core/admin_templates/catalog_tab.tpl (.../catalog_tab.tpl) (revision 8929) +++ branches/RC/core/admin_templates/catalog_tab.tpl (.../catalog_tab.tpl) (revision 9043) @@ -19,6 +19,11 @@ Grids['c.showall'].DblClick = function() {return false}; + + + alert(''); + + #separator# Index: branches/RC/core/admin_templates/categories/xml/categories_list.tpl =================================================================== diff -u -r8929 -r9043 --- branches/RC/core/admin_templates/categories/xml/categories_list.tpl (.../categories_list.tpl) (revision 8929) +++ branches/RC/core/admin_templates/categories/xml/categories_list.tpl (.../categories_list.tpl) (revision 9043) @@ -41,6 +41,11 @@ Grids['c'].DblClick = function() {return false}; $Catalog.reflectPasteButton(); + + + alert(''); + + #separator# Index: branches/RC/core/units/categories/categories_event_handler.php =================================================================== diff -u -r9040 -r9043 --- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 9040) +++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 9043) @@ -464,47 +464,30 @@ parent::OnPreSaveCreated($event); } - - + + /** * Exclude root categories from deleting * * @param kEvent $event */ function customProcessing(&$event, $type) - { - if (!$this->Application->ConfigValue('m_AllowDeleteRootCats')) { - - if ($event->Name == 'OnMassDelete' && $type == 'before') { + { + if ($event->Name == 'OnMassDelete' && $type == 'before') { + $ids = $event->getEventParam('ids'); + if (!$ids || $this->Application->ConfigValue('m_AllowDeleteRootCats')) { + return ; + } - $ids = $event->getEventParam('ids'); + // get module root categories and exclude them + foreach ($this->Application->ModuleInfo as $module_info) { + $root_categories[] = $module_info['RootCat']; + } + $root_categories = array_unique($root_categories); - if ($ids) { - - // get module roots and exclude them - foreach ($this->Application->ModuleInfo as $module_name => $module_data) { - if ((int)$module_data['RootCat']) - $ids_exclude[] = (int)$module_data['RootCat']; - } - - if ($ids_exclude && array_intersect($ids, $ids_exclude)) - { - $ids = array_diff($ids, $ids_exclude); - $this->Application->StoreVar('root_delete_error', 1); - } - - /* - $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - - $sql = 'SELECT '.$id_field.' - FROM '.$table_name.' - WHERE '.$id_field.' IN ('.implode(',', $ids).').'; - $event->setEventParam('ids', $this->Conn->GetCol($sql)); - */ - - $event->setEventParam('ids', $ids); - } + if ($root_categories && array_intersect($ids, $root_categories)) { + $event->setEventParam('ids', array_diff($ids, $root_categories)); + $this->Application->StoreVar('root_delete_error', 1); } } } @@ -521,7 +504,6 @@ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { return; } - // $event->status = erSUCCESS; @@ -530,7 +512,7 @@ $event->setEventParam('ids', $ids); $this->customProcessing($event, 'before'); $ids = $event->getEventParam('ids'); - + if ($ids) { $recursive_helper =& $this->Application->recallObject('RecursiveHelper'); /* @var $recursive_helper kRecursiveHelper */ Index: branches/RC/core/admin_templates/catalog/catalog.tpl =================================================================== diff -u -r9040 -r9043 --- branches/RC/core/admin_templates/catalog/catalog.tpl (.../catalog.tpl) (revision 9040) +++ branches/RC/core/admin_templates/catalog/catalog.tpl (.../catalog.tpl) (revision 9043) @@ -15,9 +15,9 @@ "/> - - - + + + @@ -29,6 +29,7 @@ Request.progressText = ''; var $is_catalog = true; var $Catalog = new Catalog('', 'catalog_'); + var a_toolbar = new ToolBar(); a_toolbar.AddButton( new ToolBarButton('in-portal:upcat', '::', function() { Index: branches/RC/kernel/admin_templates/xml/categories_list.tpl =================================================================== diff -u -r8929 -r9043 --- branches/RC/kernel/admin_templates/xml/categories_list.tpl (.../categories_list.tpl) (revision 8929) +++ branches/RC/kernel/admin_templates/xml/categories_list.tpl (.../categories_list.tpl) (revision 9043) @@ -41,6 +41,11 @@ Grids['c'].DblClick = function() {return false}; $Catalog.reflectPasteButton(); + + + alert(''); + + #separator# Index: branches/RC/kernel/admin_templates/catalog.tpl =================================================================== diff -u -r9040 -r9043 --- branches/RC/kernel/admin_templates/catalog.tpl (.../catalog.tpl) (revision 9040) +++ branches/RC/kernel/admin_templates/catalog.tpl (.../catalog.tpl) (revision 9043) @@ -15,9 +15,9 @@ "/> - - - + + + @@ -29,6 +29,7 @@ Request.progressText = ''; var $is_catalog = true; var $Catalog = new Catalog('', 'catalog_'); + var a_toolbar = new ToolBar(); a_toolbar.AddButton( new ToolBarButton('in-portal:upcat', '::', function() {