Code

#Added provided values list
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 1 Oct 2010 15:21:17 +0000 (15:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 1 Oct 2010 15:21:17 +0000 (15:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19889 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 3c3bc88d90b13f87247dcc31d81dc4f840d65040..577079f2900e74385b019d679d3c995a55639889 100644 (file)
@@ -86,6 +86,7 @@ class TemplateEngine
                 // Prepare the value for the widget 
                 $value = $values[$name];
                 $syntax = (isset($item['syntax']))? $item['syntax']: "";
+                $providedValues = (isset($item['values']))? $item['values']: array();
    
                 // Create the new widget.
                 $this->widgets[$name] = new $widgetClassName($this->config, $name, 
@@ -94,7 +95,8 @@ class TemplateEngine
                         $syntax,
                         $item['required'],
                         $item['type'],
-                        $item['display']);
+                        $item['display'],
+                        $providedValues);
             }
         }
     }
index 0bbfd171ad581b2e24231b30b3695ac6878768e5..45f4fae0317ee86d6984c9513e5a5f084bc069a9 100644 (file)
@@ -13,6 +13,7 @@ class TemplateWidget
     protected $type = "";
     protected $display = "";
     protected $syntax = "";
+    protected $values = "";
 
     /*! \brief  Constructs the template widget and sets the default values.
      *  @param  Config  The GOsa configuration object.
@@ -23,7 +24,7 @@ class TemplateWidget
      *  @param  String  The widget type. 
      *  @param  String  A display name for the widget.
      */
-    function __construct(&$config, $name, $value, $description,$syntax,$required,$type,$display)
+    function __construct(&$config, $name, $value, $description,$syntax,$required,$type,$display, $values=array())
     {
         $this->config = &$config;
         $this->name = $name;
@@ -32,6 +33,7 @@ class TemplateWidget
         $this->required = $required;
         $this->type = $type;
         $this->syntax = $syntax;
+        $this->values = $values;
         $this->display = $display;
         $class = get_class();
         $this->postName = "{$class}_{$this->name}";
index 358fed7aae2734299ecd947f2d593eb13becdbf8..d95da2c57885b78653ccc7a0634e877aa4eb131f 100644 (file)
@@ -2,9 +2,9 @@
 
 class TemplateWidget_list extends TemplateWidget
 {
-    function __construct(&$config, $name, $value, $description,$syntax,$required,$type,$display)
+    function __construct(&$config, $name, $value, $description,$syntax,$required,$type,$display,$values)
     {
-        parent:: __construct($config, $name, $value, $description,$syntax,$required,$type,$display);
+        parent:: __construct($config, $name, $value, $description,$syntax,$required,$type,$display,$values);
 
         $this->listWidget= new sortableListing($this->value);
         $this->listWidget->setEditable(false);