Code

Updated dialog handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Sep 2010 14:01:24 +0000 (14:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Sep 2010 14:01:24 +0000 (14:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19840 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc
gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc

index fda9825eaee2aadb99f038673a5d522df86df57b..e42e4e05f0142ae1bc39531cb3c4d73e49c284ff 100644 (file)
@@ -100,7 +100,9 @@ class DeviceConfig extends management
 
     function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
     {
-        echo "Jajajaaa";
+        $this->dialogObject = $this->TemplateEngine;
+        $this->skipFooter = TRUE;
+        $this->dialog = TRUE;
     }
 
 
@@ -134,7 +136,6 @@ class DeviceConfig extends management
         $this->itemContainerSelector->update(true);
         $this->itemContainerSelector->setBase($this->base);
 
-        $tpl = $this->TemplateEngine->render();
         session::set('DEVICE_ITEMS', $this->currentItemValues);
         $this->rebuildListing();
         $filter = $this->getFilter();
@@ -144,7 +145,7 @@ class DeviceConfig extends management
         $smarty = get_smarty();
         $smarty->assign("RELEASE", $this->itemContainerSelector->render());
         $display = $headpage->render();
-        return($tpl.$this->getHeader().$display);
+        return($this->getHeader().$display);
     }
 
 
@@ -189,15 +190,19 @@ class DeviceConfig extends management
         $this->registerAction("new",        "newEntry");
         $this->registerAction("edit",       "openEntry"); // !! We forward 'edit' to 'open' to have a department like navigation.
         $this->registerAction("editEntry",  "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("saveItemChanges", "saveItemChanges");
+        $this->registerAction("cancelItemEdit", "cancelItemEdit");
     }
 
 
+    function cancelItemEdit()
+    {
+        $this->closeDialogs();
+        $this->dialog = FALSE;
+    }
+    
+
     /*! \brief      Add a new child-item to the currently selected one. 
      *               
      *  @param  String  type    The 'type' of the new object, eg. 'KickstartTemplate'
@@ -355,7 +360,18 @@ class DeviceConfig extends management
             }
         }
     }
-    
+
+
+      // Inject user actions
+    function detectPostActions()
+    {
+        $action = management::detectPostActions();
+        if(isset($_POST['saveItemEdit'])) $action['action'] = "saveItemChanges";
+        if(isset($_POST['cancelItemEdit'])) $action['action'] = "cancelItemEdit";
+        return($action);
+    }
+   
     function check()
     {
         return(array());
index 8ae4650a2d49999de66d77f50ee0b903d66cd611..0723bc4fd0437fdb8905868bd215c7a081b49551 100644 (file)
@@ -117,7 +117,10 @@ class TemplateEngine
             $smarty->assign($widget->getName(), $widget->render());
             $smarty->assign($widget->getName()."Name", $widget->getDisplayName());
         }
-        return($smarty->fetch(get_template_path("goto/Config/{$this->template}", TRUE)));
+        $template = $smarty->fetch(get_template_path("goto/Config/{$this->template}", TRUE));
+
+        $smarty->assign('template', $template);
+        return($smarty->fetch(get_template_path("goto/Config/TemplateEngine.tpl", TRUE)));
     }