From: hickert Date: Tue, 17 May 2011 11:10:04 +0000 (+0000) Subject: Updated Device Config X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=55902e51e54e08bfc37ff5f8f0a6ae9f2aed8982;p=gosa.git Updated Device Config git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20843 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc index 006a2b91b..253532be6 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc @@ -142,9 +142,16 @@ class DeviceConfig extends plugin // Build list of assigned Elements $data = $lData = array();; foreach($this->usedElements as $name){ - $element = $this->assignableElements[$name]; - $data[$name] = $element; - $desc = (isset($element['description'])) ? $element['description'] : ''; + if(isset($this->assignableElements[$name])){ + $element = $this->assignableElements[$name]; + $data[$name] = $element; + $desc = (isset($element['description'])) ? $element['description'] : ''; + }else{ + $element = NULL; + $data[$name] = $element; + $desc = ""._("Unknown config item").""; + + } $lData[$name] = array('data' => array($name, $desc)); } $this->usedElementsList->setListData($data, $lData); @@ -152,18 +159,21 @@ class DeviceConfig extends plugin // Build up parameter list $data = $lData = array();; foreach($this->usedElements as $name){ + + if(!isset($this->assignableElements[$name]['parameter'])) continue; + $parameter = $this->assignableElements[$name]['parameter']; foreach($parameter as $param => $desc){ $data[$param] = NULL; + $value = (isset($this->parameterValues[$param])) ? $this->parameterValues[$param] : ""; + + if(!isset($this->parameterWidgets[$param])){ + $this->parameterWidgets[$param] = new TemplateWidget_string($this->config, $param, $value, + $desc, '', FALSE, 'string', $param); + } + $w = $this->parameterWidgets[$param]; + $lData[$param] = array('data' => array($w->getDisplayName(), $w->render())); } - $value = (isset($this->parameterValues[$param])) ? $this->parameterValues[$param] : ""; - - if(!isset($this->parameterWidgets[$param])){ - $this->parameterWidgets[$param] = new TemplateWidget_string($this->config, $param, $value, - $desc, '', FALSE, 'string', $param); - } - $w = $this->parameterWidgets[$param]; - $lData[$param] = array('data' => array($w->getDisplayName(), $w->render())); } $this->parameterList->setListData($data, $lData); @@ -209,7 +219,9 @@ class DeviceConfig extends plugin // Collect paramter list. $params = array(); foreach($this->usedElements as $name){ - $params = array_merge($this->assignableElements[$name]['parameter']); + if(isset($this->assignableElements[$name]['parameter'])){ + $params = array_merge($this->assignableElements[$name]['parameter']); + } } // Decide whoch parameter has to be saved and which has to be removed.