From 509f21400547e0cc302e4f2c61397e49c91feb40 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 25 Oct 2010 09:25:27 +0000 Subject: [PATCH] Added list actions -Made edit and remove actions available. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20137 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../newConfigManagement/DeviceConfig-list.xml | 2 +- .../class_ConfigManagementListing.inc | 35 ++++++++++++++++++- .../class_newConfigManagement.inc | 17 +++++++-- 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/gosa-core/plugins/admin/newConfigManagement/DeviceConfig-list.xml b/gosa-core/plugins/admin/newConfigManagement/DeviceConfig-list.xml index 99bc644f8..dce3d5281 100644 --- a/gosa-core/plugins/admin/newConfigManagement/DeviceConfig-list.xml +++ b/gosa-core/plugins/admin/newConfigManagement/DeviceConfig-list.xml @@ -69,7 +69,7 @@ - editEntry + edit entry images/lists/edit.png diff --git a/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc b/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc index 97504a2e0..b49587807 100644 --- a/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc +++ b/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc @@ -10,7 +10,7 @@ class ConfigManagementListing extends management private $objectTypeStr = ""; - function __construct($config, $ui) + function __construct($config, $ui, $parent) { // Set storage points - We do not have any - We just create a fake list which lists all items $this->storagePoints = array(""); @@ -18,6 +18,8 @@ class ConfigManagementListing extends management $this->containerSelector = new ItemSelector(array(),'/root','/root'); $this->itemSelector = new ItemSelector(array(),'',''); + + $this->parent = &$parent; } function save_object() @@ -94,6 +96,12 @@ class ConfigManagementListing extends management function rebuildListing() { + + // Handle actions (POSTs and GETs) + $str = $this->handleActions($this->detectPostActions()); + if($str) return($this->getHeader().$str); + + // Build filter if (session::global_is_set(get_class($this)."_filter")){ $filter= session::global_get(get_class($this)."_filter"); @@ -113,6 +121,31 @@ class ConfigManagementListing extends management $headpage->setFilter($filter); parent::__construct($this->config, $this->ui, "services", $headpage); + + // Register default actions + $this->registerAction("new", "newEntry"); + $this->registerAction("edit", "editEntry"); + $this->registerAction("apply", "applyChanges"); + $this->registerAction("save", "saveChanges"); + $this->registerAction("cancel", "cancelEdit"); + $this->registerAction("cancelDelete", "cancelEdit"); + $this->registerAction("remove", "removeEntryRequested"); + $this->registerAction("removeConfirmed", "removeEntryConfirmed"); + + $this->registerAction("config-filter","editFilter"); + $this->registerAction("saveFilter","saveFilter"); + $this->registerAction("cancelFilter","cancelFilter"); + + } + + function removeEntryRequested($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") + { + $this->parent->removeEntry($target); + } + + function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") + { + $this->parent->editEntry($target); } } diff --git a/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc index 23b877d27..f038f01b3 100644 --- a/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc @@ -18,7 +18,7 @@ class newConfigManagement extends plugin function __construct($config, $dn) { $this->config = &$config; - $this->listing = new ConfigManagementListing($this->config, get_userinfo()); + $this->listing = new ConfigManagementListing($this->config, get_userinfo(), $this); // Request an update of the data model $this->updateDataModel(); @@ -242,13 +242,26 @@ class newConfigManagement extends plugin $types['Component']['objectClass'] = 'Component'; $types['Component']['label'] = _('Component'); - $types['Component']['image'] = 'images/lists/edit.png'; + $types['Component']['image'] = 'plugins/users/images/select_user.png'; $types['Component']['category'] = 'Device'; $types['Component']['class'] = 'Device'; return($types); } + + function editEntry($id) + { + print_a($id); + } + + + function removeEntry($id) + { + print_a($id); + } + + public static function plInfo() { return (array( -- 2.30.2