Code

Updated list widget
[gosa.git] / gosa-plugins / goto / admin / systems / goto / Config / class_TemplateWidget.inc
1 <?php
3 class TemplateWidget
4 {
5     protected $name = "unnamed";
6     protected $value = "";
8     protected $description = "";
9     protected $required = "";
10     protected $type = "";
11     protected $display = "";
13     function __construct(&$config, $name, $value, $description,$required,$type,$display)
14     {
15         $this->config = &$config;
16         $this->name = $name;
17         $this->value = $value;
18         $this->description = $description;
19         $this->required = $required;
20         $this->type = $type;
21         $this->display = $display;
22         $class = get_class();
23         $this->postName = "{$class}_{$this->name}";
24     }
27     function render()
28     {
29         return("{$this->display}&nbsp;<input type='text' name=\"{$this->postName}\" value=\"".set_post($this->value)."\">");
30     }
32     function save_object()
33     {
34         if(isset($_POST[$this->postName])){
35             $this->value = get_post($this->postName);
36         }
37     }
39     function getValue()
40     {
41         return($this->value);
42     }
44     function getName()
45     {
46         return($this->name);
47     }
49     function setValue($value)
50     {
51         $this->value = $value;
52     }
54 }
56 ?>