Code

Added list actions
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Oct 2010 09:25:27 +0000 (09:25 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Oct 2010 09:25:27 +0000 (09:25 +0000)
-Made edit and remove actions available.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20137 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/newConfigManagement/DeviceConfig-list.xml
gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc
gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc

index 99bc644f86ee34df72a492b9465ce50e357cbc38..dce3d5281c85a9fb0d212e505183a132513ec251 100644 (file)
@@ -69,7 +69,7 @@
   <actiontriggers snapshot="false" copypaste="false">
 
     <action>
-      <name>editEntry</name>
+      <name>edit</name>
       <type>entry</type>
       <image>images/lists/edit.png</image>
       <label>Edit item</label>
index 97504a2e0045b0699c5ba0fcac414638615eb7bc..b495878077670b6fc01c6d7e571aad06426fcab4 100644 (file)
@@ -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);
     }
 } 
 
index 23b877d27c19ba446d20fee2ece7a2a817bacf19..f038f01b399189f217070530afeff19b0ce6d364 100644 (file)
@@ -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(