Code

Added string widget
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 27 Sep 2010 11:54:48 +0000 (11:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 27 Sep 2010 11:54:48 +0000 (11:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19798 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc
gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_string.inc [new file with mode: 0644]

index 8060ed3ece4f33bb2f51265d8b1c140eb96d6523..258a547327a98acfe4329b45e4ad6fec3edbbb9b 100644 (file)
@@ -42,7 +42,7 @@ class TemplateEngine
                 $widgetClassName = "TemplateWidget_{$item['type']}";
                 if(!class_available($widgetClassName)){
                     echo "Unknown widget class {$widgetClassName}! Falling back to default widget.<br>";
-                    $widgetClassName = "TemplateWidget";
+                    $widgetClassName = "TemplateWidget_string";
                 }
 
                 $this->widgets[$name] = new $widgetClassName($this->config, $name, 
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_string.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_string.inc
new file mode 100644 (file)
index 0000000..159f97a
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+
+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("");
+    }
+
+    function save_object()
+    {
+    }
+
+    function getValue()
+    {
+        return($this->value);
+    }
+
+    function getName()
+    {
+        return($this->name);
+    }
+
+    function setValue($value)
+    {
+        $this->value = $value;
+    }
+
+}
+
+?>