Index: branches/RC/core/units/sections/sections_config.php =================================================================== diff -u -N -r10841 -r10846 --- branches/RC/core/units/sections/sections_config.php (.../sections_config.php) (revision 10841) +++ branches/RC/core/units/sections/sections_config.php (.../sections_config.php) (revision 10846) @@ -247,16 +247,6 @@ 'type' => stTREE, ), - 'in-portal:configure_themes' => Array ( - 'parent' => 'in-portal:system', - 'icon' => 'in-portal:conf_themes', - 'label' => 'la_tab_Themes', - 'url' => Array ('index_file' => 'config/config_theme.php', 'pass' => 'm'), - 'permissions' => Array ('view', 'add', 'edit', 'delete'), - 'priority' => 3, - 'type' => stTREE, - ), - // "Tools" section 'in-portal:tools' => Array ( 'parent' => 'in-portal:root', Index: branches/RC/core/units/themes/themes_config.php =================================================================== diff -u -N -r10747 -r10846 --- branches/RC/core/units/themes/themes_config.php (.../themes_config.php) (revision 10747) +++ branches/RC/core/units/themes/themes_config.php (.../themes_config.php) (revision 10846) @@ -20,16 +20,28 @@ 'PermSection' => Array('main' => 'in-portal:configure_themes'), + 'Sections' => Array ( + 'in-portal:configure_themes' => Array ( + 'parent' => 'in-portal:system', + 'icon' => 'conf_themes', + 'label' => 'la_tab_Themes', + 'url' => Array('t' => 'themes/themes_list', 'pass' => 'm'), + 'permissions' => Array ('view', 'add', 'edit', 'delete'), + 'priority' => 3, + 'type' => stTREE, + ), + ), + 'TitleField' => 'Name', 'TitlePresets' => Array ( 'default' => Array ( 'new_status_labels' => Array('theme' => '!la_title_Adding_Theme!'), 'edit_status_labels' => Array('theme' => '!la_title_Editing_Theme!'), - 'new_titlefield' => Array('theme' => ''), + 'new_titlefield' => Array('theme' => '!la_title_NewTheme!'), ), - 'themes_list' => Array('prefixes' => Array('theme_List'), 'format' => "!la_title_Configuration! - !la_title_Themes! (#theme_recordcount#)"), + 'themes_list' => Array('prefixes' => Array('theme_List'), 'format' => "!la_title_Configuration! - !la_tab_Themes! (#theme_recordcount#)"), 'themes_edit_general' => Array('prefixes' => Array('theme'), 'format' => "#theme_status# '#theme_titlefield#' - !la_title_General!"), 'themes_edit_files' => Array('prefixes' => Array('theme', 'theme-file_List'), 'format' => "#theme_status# '#theme_titlefield#' - !la_title_ThemeFiles! (#theme-file_recordcount#)"), ), Index: branches/RC/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r10797 -r10846 --- branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 10797) +++ branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 10846) @@ -104,6 +104,7 @@ 'OnUpdate' => Array('self' => 'edit', 'subitem' => 'add|edit'), 'OnSetPrimary' => Array('self' => 'add|edit', 'subitem' => 'add|edit'), 'OnDelete' => Array('self' => 'delete', 'subitem' => 'add|edit'), + 'OnDeleteAll' => Array('self' => 'delete', 'subitem' => 'add|edit'), 'OnMassDelete' => Array('self' => 'delete', 'subitem' => 'add|edit'), 'OnMassClone' => Array('self' => 'add', 'subitem' => 'add|edit'), @@ -1150,6 +1151,25 @@ } /** + * Deletes all records from table + * + * @param kEvent $event + */ + function OnDeleteAll(&$event) + { + $sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . ' + FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName'); + $ids = $this->Conn->GetCol($sql); + + if ($ids) { + $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler'); + /* @var $temp_handler kTempTablesHandler */ + + $temp_handler->DeleteItems($event->Prefix, $event->Special, $ids); + } + } + + /** * Prepares new kDBItem object * * @param kEvent $event Index: branches/RC/kernel/units/sections/sections_config.php =================================================================== diff -u -N -r10841 -r10846 --- branches/RC/kernel/units/sections/sections_config.php (.../sections_config.php) (revision 10841) +++ branches/RC/kernel/units/sections/sections_config.php (.../sections_config.php) (revision 10846) @@ -247,16 +247,6 @@ 'type' => stTREE, ), - 'in-portal:configure_themes' => Array ( - 'parent' => 'in-portal:system', - 'icon' => 'in-portal:conf_themes', - 'label' => 'la_tab_Themes', - 'url' => Array ('index_file' => 'config/config_theme.php', 'pass' => 'm'), - 'permissions' => Array ('view', 'add', 'edit', 'delete'), - 'priority' => 3, - 'type' => stTREE, - ), - // "Tools" section 'in-portal:tools' => Array ( 'parent' => 'in-portal:root', Index: branches/RC/core/units/modules/modules_event_handler.php =================================================================== diff -u -N -r10832 -r10846 --- branches/RC/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 10832) +++ branches/RC/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 10846) @@ -45,21 +45,47 @@ function moduleAction(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - return; + return ; } $object =& $event->getObject( Array('skip_autoload' => true) ); $ids = $this->StoreSelectedIDs($event); - if (!$ids) return true; + if (!$ids) { + return true; + } $status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') ); - foreach($ids as $id) - { + if ($event->Name == 'OnMassDecline') { + $interface_modules = Array ('In-Portal', 'Proj-Base'); + + foreach ($interface_modules as $module_index => $interface_module) { + if (!$this->Application->findModule('Name', $interface_module)) { + // remove already disabled interface modules + unset($interface_modules[$module_index]); + } + } + } + + foreach ($ids as $id) { + if ($event->Name == 'OnMassDecline') { + if (in_array($id, $interface_modules) && count($interface_modules) == 1) { + // don't allow to disable both interface modules + continue; + } + + unset($interface_modules[ array_search($id, $interface_modules) ]); + } + + if ($id == 'Core') { + // don't allow any kind of manupulations with kernel + continue; + } + $object->Load($id); - if ($object->GetID() == 'In-Portal') continue; + $object->SetDBField($status_field, $event->Name == 'OnMassApprove' ? 1 : 0); if ($object->Update()) { Index: branches/RC/core/admin_templates/themes/themes_edit.tpl =================================================================== diff -u -N -r10745 -r10846 --- branches/RC/core/admin_templates/themes/themes_edit.tpl (.../themes_edit.tpl) (revision 10745) +++ branches/RC/core/admin_templates/themes/themes_edit.tpl (.../themes_edit.tpl) (revision 10846) @@ -59,8 +59,11 @@ + - + + +