Index: trunk/kernel/units/modules/modules_event_handler.php
===================================================================
diff -u -r4207 -r4577
--- trunk/kernel/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 4207)
+++ trunk/kernel/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 4577)
@@ -14,11 +14,61 @@
parent::OnItemBuild($event);
}
+ /**
+ * List with one record if special passed
+ *
+ * @param kEvent $event
+ */
function SetCustomQuery(&$event)
{
- $object =& $event->getObject();
- $object->addFilter('current_module', 'Name = '.$event->Special);
+ if ($event->Special) {
+ $object =& $event->getObject();
+ $object->addFilter('current_module', 'Name = '.$event->Special);
+ }
}
+
+ function mapEvents()
+ {
+ parent::mapEvents();
+ unset($this->eventMethods['OnMassDecline']);
+ }
+
+ /**
+ * Disabled modules, but not In-Portal
+ *
+ * @param kEvent $event
+ */
+ function OnMassDecline(&$event)
+ {
+ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) {
+ return;
+ }
+
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ $ids = $this->StoreSelectedIDs($event);
+
+
+ if (!$ids) return true;
+
+ $status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') );
+
+ foreach($ids as $id)
+ {
+ $object->Load($id);
+ if ($object->GetID() == 'In-Portal') continue;
+ $object->SetDBField($status_field, 0);
+
+ if ($object->Update()) {
+ $event->status = erSUCCESS;
+ $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay!
+ }
+ else {
+ $event->status = erFAIL;
+ $event->redirect = false;
+ break;
+ }
+ }
+ }
}
Index: trunk/kernel/admin_templates/modules/modules_list.tpl
===================================================================
diff -u
--- trunk/kernel/admin_templates/modules/modules_list.tpl (revision 0)
+++ trunk/kernel/admin_templates/modules/modules_list.tpl (revision 4577)
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/core/units/modules/modules_event_handler.php
===================================================================
diff -u -r4207 -r4577
--- trunk/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 4207)
+++ trunk/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 4577)
@@ -14,11 +14,61 @@
parent::OnItemBuild($event);
}
+ /**
+ * List with one record if special passed
+ *
+ * @param kEvent $event
+ */
function SetCustomQuery(&$event)
{
- $object =& $event->getObject();
- $object->addFilter('current_module', 'Name = '.$event->Special);
+ if ($event->Special) {
+ $object =& $event->getObject();
+ $object->addFilter('current_module', 'Name = '.$event->Special);
+ }
}
+
+ function mapEvents()
+ {
+ parent::mapEvents();
+ unset($this->eventMethods['OnMassDecline']);
+ }
+
+ /**
+ * Disabled modules, but not In-Portal
+ *
+ * @param kEvent $event
+ */
+ function OnMassDecline(&$event)
+ {
+ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) {
+ return;
+ }
+
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ $ids = $this->StoreSelectedIDs($event);
+
+
+ if (!$ids) return true;
+
+ $status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') );
+
+ foreach($ids as $id)
+ {
+ $object->Load($id);
+ if ($object->GetID() == 'In-Portal') continue;
+ $object->SetDBField($status_field, 0);
+
+ if ($object->Update()) {
+ $event->status = erSUCCESS;
+ $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay!
+ }
+ else {
+ $event->status = erFAIL;
+ $event->redirect = false;
+ break;
+ }
+ }
+ }
}
Index: trunk/core/units/admin/admin_config.php
===================================================================
diff -u -r4471 -r4577
--- trunk/core/units/admin/admin_config.php (.../admin_config.php) (revision 4471)
+++ trunk/core/units/admin/admin_config.php (.../admin_config.php) (revision 4577)
@@ -14,6 +14,8 @@
'tree_system' => Array('format' => '!la_section_overview!'),
'tree_tools' => Array('format' => '!la_section_overview!'),
+
+ 'tree_modules' => Array('format' => '!la_section_overview!'),
),
'Sections' => Array(
@@ -109,6 +111,47 @@
'type' => stTREE,
),
+ // "Configuration" -> "Modules and Settings"
+ 'in-portal:modules' => Array(
+ 'parent' => 'in-portal:system',
+ 'icon' => 'modules',
+ 'label' => 'la_tab_ModulesManagement',
+ 'url' => Array('t' => 'sections_list', 'index_file' => 'index4.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1.1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:mod_status' => Array(
+ 'parent' => 'in-portal:modules',
+ 'icon' => 'modules',
+ 'label' => 'la_title_Module_Status',
+ 'url' => Array('t' => 'modules/modules_list', 'index_file' => 'index4.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:addmodule' => Array(
+ 'parent' => 'in-portal:modules',
+ 'icon' => 'modules',
+ 'label' => 'la_title_Add_Module',
+ 'url' => Array('index_file' => 'modules/addmodule.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:tag_library' => Array(
+ 'parent' => 'in-portal:modules',
+ 'icon' => 'modules',
+ 'label' => 'la_tab_TagLibrary',
+ 'url' => Array('index_file' => 'tag_listing.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
// "Tools" section
'in-portal:tools' => Array(
'parent' => 'in-portal:root',
Index: trunk/core/units/modules/modules_config.php
===================================================================
diff -u -r2060 -r4577
--- trunk/core/units/modules/modules_config.php (.../modules_config.php) (revision 2060)
+++ trunk/core/units/modules/modules_config.php (.../modules_config.php) (revision 4577)
@@ -12,30 +12,56 @@
1 => 'id',
2 => 'page',
3 => 'event',
+ 4 => 'mode',
),
+
'IDField' => 'Name',
'TitleField' => 'Name', // field, used in bluebar when editing existing item
+ 'StatusField' => Array('Loaded'),
+
+ 'TitlePresets' => Array(
+
+ 'modules_list' => Array( 'prefixes' => Array('mod_List'), 'format' => "!la_title_Configuration! - !la_title_Module_Status! (#mod_recordcount#)"),
+
+ ),
+
'TableName' => TABLE_PREFIX.'Modules',
'ListSQLs' => Array( ''=>'SELECT * FROM %s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
),
- 'ListSortings' => Array(),
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('LoadOrder' => 'asc'),
+ )
+ ),
+
'Fields' => Array(
- 'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Path' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Var' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Version' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Loaded' => Array('type' => 'int','not_null' => '1','default' => '1'),
- 'LoadOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
- 'TemplatePath' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'RootCat' => Array('type' => 'int','not_null' => '1','default' => '0'),
- 'BuildDate' => Array('type' => 'double','not_null' => '1','default' => '0'),
+ 'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Path' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Var' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Version' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Loaded' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => '1','default' => '1'),
+ 'LoadOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'TemplatePath' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'RootCat' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'BuildDate' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => '1','default' => ''),
),
+
'VirtualFields' => Array(),
- 'Grids' => Array(),
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default' => 'icon16_custom.gif'),
+ 'Fields' => Array(
+ 'Name' => Array('title' => 'la_col_Name', 'data_block' => 'grid_checkbox_td_no_icon'),
+ 'Loaded' => Array('title' => 'la_col_Status'),
+ 'Version' => Array('title' => 'la_col_Version'),
+ ),
+
+ ),
+ ),
);
?>
\ No newline at end of file
Index: trunk/kernel/units/admin/admin_config.php
===================================================================
diff -u -r4471 -r4577
--- trunk/kernel/units/admin/admin_config.php (.../admin_config.php) (revision 4471)
+++ trunk/kernel/units/admin/admin_config.php (.../admin_config.php) (revision 4577)
@@ -14,6 +14,8 @@
'tree_system' => Array('format' => '!la_section_overview!'),
'tree_tools' => Array('format' => '!la_section_overview!'),
+
+ 'tree_modules' => Array('format' => '!la_section_overview!'),
),
'Sections' => Array(
@@ -109,6 +111,47 @@
'type' => stTREE,
),
+ // "Configuration" -> "Modules and Settings"
+ 'in-portal:modules' => Array(
+ 'parent' => 'in-portal:system',
+ 'icon' => 'modules',
+ 'label' => 'la_tab_ModulesManagement',
+ 'url' => Array('t' => 'sections_list', 'index_file' => 'index4.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1.1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:mod_status' => Array(
+ 'parent' => 'in-portal:modules',
+ 'icon' => 'modules',
+ 'label' => 'la_title_Module_Status',
+ 'url' => Array('t' => 'modules/modules_list', 'index_file' => 'index4.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:addmodule' => Array(
+ 'parent' => 'in-portal:modules',
+ 'icon' => 'modules',
+ 'label' => 'la_title_Add_Module',
+ 'url' => Array('index_file' => 'modules/addmodule.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:tag_library' => Array(
+ 'parent' => 'in-portal:modules',
+ 'icon' => 'modules',
+ 'label' => 'la_tab_TagLibrary',
+ 'url' => Array('index_file' => 'tag_listing.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
// "Tools" section
'in-portal:tools' => Array(
'parent' => 'in-portal:root',
Index: trunk/kernel/units/modules/modules_config.php
===================================================================
diff -u -r2060 -r4577
--- trunk/kernel/units/modules/modules_config.php (.../modules_config.php) (revision 2060)
+++ trunk/kernel/units/modules/modules_config.php (.../modules_config.php) (revision 4577)
@@ -12,30 +12,56 @@
1 => 'id',
2 => 'page',
3 => 'event',
+ 4 => 'mode',
),
+
'IDField' => 'Name',
'TitleField' => 'Name', // field, used in bluebar when editing existing item
+ 'StatusField' => Array('Loaded'),
+
+ 'TitlePresets' => Array(
+
+ 'modules_list' => Array( 'prefixes' => Array('mod_List'), 'format' => "!la_title_Configuration! - !la_title_Module_Status! (#mod_recordcount#)"),
+
+ ),
+
'TableName' => TABLE_PREFIX.'Modules',
'ListSQLs' => Array( ''=>'SELECT * FROM %s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
),
- 'ListSortings' => Array(),
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('LoadOrder' => 'asc'),
+ )
+ ),
+
'Fields' => Array(
- 'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Path' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Var' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Version' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Loaded' => Array('type' => 'int','not_null' => '1','default' => '1'),
- 'LoadOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
- 'TemplatePath' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'RootCat' => Array('type' => 'int','not_null' => '1','default' => '0'),
- 'BuildDate' => Array('type' => 'double','not_null' => '1','default' => '0'),
+ 'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Path' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Var' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Version' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Loaded' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => '1','default' => '1'),
+ 'LoadOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'TemplatePath' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'RootCat' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'BuildDate' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => '1','default' => ''),
),
+
'VirtualFields' => Array(),
- 'Grids' => Array(),
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default' => 'icon16_custom.gif'),
+ 'Fields' => Array(
+ 'Name' => Array('title' => 'la_col_Name', 'data_block' => 'grid_checkbox_td_no_icon'),
+ 'Loaded' => Array('title' => 'la_col_Status'),
+ 'Version' => Array('title' => 'la_col_Version'),
+ ),
+
+ ),
+ ),
);
?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/incs/grid_blocks.tpl
===================================================================
diff -u -r4288 -r4577
--- trunk/kernel/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 4288)
+++ trunk/kernel/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 4577)
@@ -303,7 +303,7 @@