Code

Updated widgets form item management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 27 Sep 2010 12:06:14 +0000 (12:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 27 Sep 2010 12:06:14 +0000 (12:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19799 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
gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc
gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_list.inc
gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_string.inc
gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_textarea.inc [new file with mode: 0644]
gosa-plugins/goto/admin/systems/goto/Config/puppet.tpl

index 48ef8f719a20361156d0cbdabc550f1ee76e4451..317313c3396ff70b959a4ac79842ccf60849ecef 100644 (file)
@@ -31,7 +31,7 @@ class DeviceConfig extends plugin
                             "required": true,
                             "value": "",
                             "syntax": "^[a-zA-Z0-9_+.-]+$",
-                            "type": "string",
+                            "type": "textarea",
                             "display": "Module  version"
                         },
                         "name": {
index 258a547327a98acfe4329b45e4ad6fec3edbbb9b..3ef186298a3f7a6feb85bd7abd9b2d619bb558ad 100644 (file)
@@ -76,6 +76,7 @@ class TemplateEngine
         $smarty->assign("type", $this->itemType);
         foreach($this->widgets as $widget){
             $smarty->assign($widget->getName(), $widget->render());
+            $smarty->assign($widget->getName()."Name", $widget->getDisplayName());
         }
         return($smarty->fetch(get_template_path("goto/Config/{$this->template}", TRUE)));
     }
index 15935ae9068b325dd8feebbb91b4ea54b8525149..d686439c19832711746d834c7640ec277db9fbcc 100644 (file)
@@ -22,11 +22,16 @@ class TemplateWidget
         $class = get_class();
         $this->postName = "{$class}_{$this->name}";
     }
+    
+    function getDisplayName()
+    {
+        return($this->display);
+    }
 
 
     function render()
     {
-        return("{$this->display}&nbsp;<input type='text' name=\"{$this->postName}\" value=\"".set_post($this->value)."\">");
+        return("");
     }
 
     function save_object()
index a7072ac69eee9eff93fa9085260faf024840f4e3..3f1f457efafe1f77e6c76aa08ec0e86d54279f7f 100644 (file)
@@ -18,7 +18,7 @@ class TemplateWidget_list extends TemplateWidget
 
     function render()
     {
-        $str = $this->display."&nbsp;";
+        $str = "";
         $this->listWidget->setListData($this->value);
         $this->listWidget->update();
         $str .= $this->listWidget->render();
index 159f97a3d37d6d8969db65ab39c790a532286528..1ff9520a5e47d44ca366d3db3863fae56db0dc5a 100644 (file)
@@ -2,52 +2,10 @@
 
 class TemplateWidget_string extends TemplateWidget
 {
-    protected $name = "unnamed";
-    protected $value = "";
-
-    protected $description = "";
-    protected $required = "";
-    protected $type = "";
-    protected $display = "";
-
-    function __construct(&$config, $name, $value, $description,$required,$type,$display)
-    {
-        $this->config = &$config;
-        $this->name = $name;
-        $this->value = $value;
-        $this->description = $description;
-        $this->required = $required;
-        $this->type = $type;
-        $this->display = $display;
-        $class = get_class();
-        $this->postName = "{$class}_{$this->name}";
-    }
-
-
     function render()
     {
-        return("");
+        return("<input type='text' name=\"{$this->postName}\" value=\"".set_post($this->value)."\">");
     }
-
-    function save_object()
-    {
-    }
-
-    function getValue()
-    {
-        return($this->value);
-    }
-
-    function getName()
-    {
-        return($this->name);
-    }
-
-    function setValue($value)
-    {
-        $this->value = $value;
-    }
-
 }
 
 ?>
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_textarea.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_textarea.inc
new file mode 100644 (file)
index 0000000..26c733c
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+class TemplateWidget_textarea extends TemplateWidget
+{
+    function render()
+    {
+        return("<textarea type='text' name=\"{$this->postName}\">".set_post($this->value)."</textarea>");
+    }
+
+}
+
+?>
index 92506229e71bba80c4b813b5b43fd900f5c8ca8f..78a90826ccdd59c38687b30d9c778a865c71fc0c 100644 (file)
@@ -1,6 +1,27 @@
 {if $type == 'PuppetModule'}
-   <br>{$dependency}
-   <br>{$version}
-   <br>{$name}
-   <br>{$description}
+    <table width="100%">
+        <tr>
+            <td style="width:50%; vertical-align: top;">
+                <table>
+                    <tr>
+                        <td>{$nameName}</td>
+                        <td>{$name}</td>
+                    </tr>
+                    <tr>
+                        <td>{$descriptionName}</td>
+                        <td>{$description}</td>
+                    </tr>
+                    <tr>
+                        <td>{$versionName}</td>
+                        <td>{$version}</td>
+                    </tr>
+                </table>
+            </td>
+            <td style="width:50%; vertical-align: top;">
+                {$dependencyName}
+                {$dependency}
+            </td>
+        </tr>
+    </table>
+
 {/if}