From 7aa09566c484b9a4957f8c504847f79268339cb9 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 27 Sep 2010 09:41:31 +0000 Subject: [PATCH] Prepared widget handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19795 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/goto/Config/class_TemplateEngine.inc | 8 +++++++- .../admin/systems/goto/Config/class_TemplateWidget.inc | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) 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 6d7f3f705..7abe3d6cd 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc @@ -33,7 +33,13 @@ class TemplateEngine if(isset($data['options']) && count($data['options'])){ foreach($data['options'] as $name => $item){ - $this->widgets[$name] = new TemplateWidget($this->config, $name, + $widgetClassName = "TemplateWidget_{$item['type']}"; + if(!class_available($widgetClassName)){ + echo "Unknown widget class {$widgetClassName}! Falling back to default widget.
"; + $widgetClassName = "TemplateWidget"; + } + + $this->widgets[$name] = new $widgetClassName($this->config, $name, $item['value'], $item['description'], $item['required'], 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 e48e06a24..8216ce774 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc @@ -13,8 +13,6 @@ class TemplateWidget function __construct(&$config, $name, $value, $description,$required,$type,$display) { $this->config = &$config; - - echo '*'; $this->name = $name; $this->value = $value; $this->description = $description; -- 2.30.2