Index: branches/RC/core/install/upgrades.sql =================================================================== diff -u -r8964 -r9040 --- branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 8964) +++ branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 9040) @@ -120,4 +120,6 @@ UPDATE ConfigurationAdmin SET `element_type` = 'textarea' WHERE `VariableName` = 'Category_MetaDesc'; INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseToolbarLabels', '1', 'In-Portal', 'in-portal:configure_general'); -INSERT INTO ConfigurationAdmin VALUES ('UseToolbarLabels', 'la_Text_Website', 'la_UseToolbarLabels', 'checkbox', NULL , NULL , 10.20, 0, 0); \ No newline at end of file +INSERT INTO ConfigurationAdmin VALUES ('UseToolbarLabels', 'la_Text_Website', 'la_UseToolbarLabels', 'checkbox', NULL , NULL , 10.20, 0, 0); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AllowDeleteRootCats', '0', 'In-Portal', 'in-portal:configure_categories'); +INSERT INTO ConfigurationAdmin VALUES ('AllowDeleteRootCats', 'la_Text_General', 'la_AllowDeleteRootCats', 'checkbox', NULL , NULL , 10.08, 0, 0); \ No newline at end of file Index: branches/RC/core/kernel/db/db_event_handler.php =================================================================== diff -u -r8929 -r9040 --- branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 8929) +++ branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 9040) @@ -929,8 +929,9 @@ * @param kEvent $event */ function customProcessing(&$event, $type) - { - + { + + } /* Edit Events mostly used in Admin */ @@ -2091,8 +2092,8 @@ readfile($path); exit(); - } - + } + } Index: branches/RC/core/units/categories/categories_event_handler.php =================================================================== diff -u -r8929 -r9040 --- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 8929) +++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 9040) @@ -464,7 +464,51 @@ 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') { + $ids = $event->getEventParam('ids'); + + 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); + } + } + } + } + /** * Deletes all selected items. * Automatically recurse into sub-items using temp handler, and deletes sub-items @@ -477,10 +521,16 @@ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { return; } + // $event->status = erSUCCESS; $ids = $this->StoreSelectedIDs($event); + + $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 -r8966 -r9040 --- branches/RC/core/admin_templates/catalog/catalog.tpl (.../catalog.tpl) (revision 8966) +++ branches/RC/core/admin_templates/catalog/catalog.tpl (.../catalog.tpl) (revision 9040) @@ -9,6 +9,7 @@ + Index: branches/RC/core/install/install_data.sql =================================================================== diff -u -r8964 -r9040 --- branches/RC/core/install/install_data.sql (.../install_data.sql) (revision 8964) +++ branches/RC/core/install/install_data.sql (.../install_data.sql) (revision 9040) @@ -66,6 +66,7 @@ INSERT INTO ConfigurationAdmin VALUES ('MailFunctionHeaderSeparator', 'la_Text_smtp_server', 'la_config_MailFunctionHeaderSeparator', 'radio', NULL, '1=la_Linux,2=la_Windows', 30.08, 0, 0); INSERT INTO ConfigurationAdmin VALUES ('UseToolbarLabels', 'la_Text_Website', 'la_UseToolbarLabels', 'checkbox', NULL , NULL , 10.20, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('AllowDeleteRootCats', 'la_Text_General', 'la_AllowDeleteRootCats', 'checkbox', NULL , NULL , 10.08, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Columns_Category', '2', 'In-Portal', 'Categories'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'DomainSelect','1','In-Portal','in-portal:configure_general'); @@ -205,6 +206,7 @@ INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CategoriesRebuildSerial', '0', 'In-Portal', ''); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseToolbarLabels', '1', 'In-Portal', 'in-portal:configure_general'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AllowDeleteRootCats', '0', 'In-Portal', 'in-portal:configure_categories'); INSERT INTO Events VALUES (DEFAULT, 'USER.ADD', NULL, 1, 0, 'In-Portal:Users', 'la_event_user.add', 0); INSERT INTO Events VALUES (DEFAULT, 'USER.ADD', NULL, 2, 0, 'In-Portal:Users', 'la_event_user.add', 1); Index: branches/RC/kernel/admin_templates/catalog.tpl =================================================================== diff -u -r8966 -r9040 --- branches/RC/kernel/admin_templates/catalog.tpl (.../catalog.tpl) (revision 8966) +++ branches/RC/kernel/admin_templates/catalog.tpl (.../catalog.tpl) (revision 9040) @@ -9,6 +9,7 @@ +
Index: branches/RC/themes/default2007/platform/elements/side_boxes/login.tpl =================================================================== diff -u -r9037 -r9040 --- branches/RC/themes/default2007/platform/elements/side_boxes/login.tpl (.../login.tpl) (revision 9037) +++ branches/RC/themes/default2007/platform/elements/side_boxes/login.tpl (.../login.tpl) (revision 9040) @@ -34,11 +34,7 @@
- + @@ -65,10 +61,16 @@ + + + +
- - - img/s.gif" alt="" width="5" height="5" border="0" />
-
+ img/s.gif" alt="" width="1" height="7" border="0" />
+
- +