summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4936436)
raw | patch | inline | side by side (parent: 4936436)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Sep 2010 09:41:31 +0000 (09:41 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Sep 2010 09:41:31 +0000 (09:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19795 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc | patch | blob | history | |
gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc | patch | blob | history |
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 6d7f3f705ed023489dcb6048a2a47c85ec9174e7..7abe3d6cd2f52680cb3e8045cd68bce016da8839 100644 (file)
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.<br>";
+ $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 e48e06a2441811d5f44eb1eb41d57138db8386ae..8216ce774d672a930f65ec939adba46603b43aee 100644 (file)
function __construct(&$config, $name, $value, $description,$required,$type,$display)
{
$this->config = &$config;
-
- echo '*';
$this->name = $name;
$this->value = $value;
$this->description = $description;