Code

Updated template engine
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Apr 2011 09:34:33 +0000 (09:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Apr 2011 09:34:33 +0000 (09:34 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20742 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/TemplateEngine.tpl
gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateEngine.inc
gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc

index 8767de994912c1fcf7b552bbcbe6955d602b2b0c..9372b25ebfef879bee9e939764289d7041565e0d 100644 (file)
@@ -1,4 +1,6 @@
-<h3>Module name</h3>
+<h3>{$typeData.description}</h3>
+
+<hr>
 
 {$template}
 
index f5eb611b4c08c308deee07a8d30aea16b8889fe6..fd9617c609bcec2b2b29c84e6f72caaaaf84c4be 100644 (file)
@@ -121,6 +121,7 @@ class TemplateEngine
     {
         $smarty = get_smarty();
         $smarty->assign("type", $this->itemType);
+        $smarty->assign("typeData", $this->data[$this->itemType]);
 
         // Tell smarty the HTML-content for each widget and the name that should be
         //  displayed.
index 2c0383e334c5535d1be6f46b3ea44ac70a401383..5cf92797aa2d205f411d439699886eb8139e6c97 100644 (file)
@@ -616,9 +616,40 @@ class newConfigManagement extends plugin
         $item = $this->currentObject;
         $type = $this->TemplateEngine->getItemType();
         if($this->cfgItemMap[$type] == 'root'){
-            echo "{$type} Cannot be saved yet";
-            $this->listing->clearDialogObject();
-            return;
+
+            // We've to create a new distribution
+            if($type == 'Distribution'){
+                $name = $values['name'];
+                $itype = $values['installation_type'];
+                $imethod = $values['installation_method'];
+                $mirror = $values['mirror'];
+
+                $rpc = $this->config->getRpcHandle();
+                $res = $rpc->createDistribution($name, $itype, array('mirror'=>$mirror, 'install_method' => $imethod));
+
+                print_a(array($name, $itype, array('mirror'=>$mirror, 'install_method' => $imethod)));
+    
+                if(!$rpc->success()){
+                    msg_dialog::display(_("Error"), sprintf(_("Failed to save distributions: %s"), $rpc->get_error()),ERROR_DIALOG);
+                    return(NULL);
+                }else{
+
+                    // We've successfully added the item, now add it to the tree.
+                    $this->dataModel->addItem($type, $this->selectedContainer, $values['name'],array(), '-' );
+
+                    // Finally - close the dialog. 
+                    $this->listing->clearDialogObject();
+                }
+                
+
+                $this->listing->clearDialogObject();
+
+            }else{
+
+                echo "{$type} Cannot be saved yet";
+                $this->listing->clearDialogObject();
+                return;
+            }
         }
 
         // Save a CONFIG-ITEM object.