From: hickert Date: Mon, 27 Sep 2010 09:56:29 +0000 (+0000) Subject: Added first extra template X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1e2796a8401c9c1a4b5ac8298519633e4c7256cb;p=gosa.git Added first extra template git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19796 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc index 53f917db2..48ef8f719 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc @@ -87,7 +87,7 @@ class DeviceConfig extends plugin $this->setCurrentItem('root'); $this->addItem('PuppetModule','test1', array( - 'dependency' => 'mozilla-2', + 'dependency' => array('mozilla-2','toaster-2.0'), 'version' => '2.4-f', 'name' => 'Thundebird', 'description' => 'Mozilla mail client') diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc index 7abe3d6cd..8060ed3ec 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc @@ -7,6 +7,7 @@ class TemplateEngine private $template = ""; private $itemType = ''; + private $widgets = array(); function __construct($config) { @@ -16,6 +17,11 @@ class TemplateEngine function setValues($values) { foreach($values as $name => $value){ + if(!isset($this->widgets[$name])){ + $class = get_class(); + echo "Unknown option '{$name}' for {$class}!)}
"; + continue; + } $this->widgets[$name]->setValue($value); } } @@ -26,7 +32,7 @@ class TemplateEngine $this->widgets = array(); if(!isset($this->data[$this->itemType])){ - trigger_error("Undefined item type '{$name}'!"); + echo "Undefined item type '{$name}'!
"; return; } $data = $this->data[$this->itemType]; diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc index 8216ce774..0f92ffb18 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc @@ -2,13 +2,13 @@ class TemplateWidget { - private $name = "unnamed"; - private $value = ""; + protected $name = "unnamed"; + protected $value = ""; - private $description = ""; - private $required = ""; - private $type = ""; - private $display = ""; + protected $description = ""; + protected $required = ""; + protected $type = ""; + protected $display = ""; function __construct(&$config, $name, $value, $description,$required,$type,$display) { diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_list.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_list.inc new file mode 100644 index 000000000..549b39cff --- /dev/null +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_list.inc @@ -0,0 +1,17 @@ +value as $id => $val){ + $str.= "{$val}, "; + } + return($str); + } + +} + + +?>