From e183de38a1ac69f9d9e9ea0560823ccf12547f69 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 20 Apr 2011 15:57:26 +0000 Subject: [PATCH] Updated the template engine git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20762 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../TemplateEngine/class_TemplateEngine.inc | 4 +++- .../TemplateEngine/class_TemplateWidget.inc | 8 ++++++++ .../newConfigManagement/class_newConfigManagement.inc | 9 +++++---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateEngine.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateEngine.inc index e81fe3eb2..a1dcbf40b 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateEngine.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateEngine.inc @@ -161,7 +161,9 @@ class TemplateEngine function save_object() { foreach($this->widgets as $widget){ - $widget->save_object(); + if($widget->isEnabled()){ + $widget->save_object(); + } } } diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateWidget.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateWidget.inc index 190d9c7ee..bc66f8f0a 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateWidget.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateWidget.inc @@ -48,6 +48,14 @@ class TemplateWidget $this->enabled = $bool; } + + /*! \brief Returns the enable status. + */ + function isEnabled() + { + return($this->enabled); + } + /*! \brief Returns the display-name for the current widget. * @return String The display-name for the widget, this diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index 21d6bd22b..862b096f0 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -48,13 +48,15 @@ class newConfigManagement extends plugin 'type' => 'combobox', 'display' => _('Distribution type'), 'values' => array("deb" => 'deb', "rpm" => 'rpm'), 'initiallyEditableOnly' => TRUE); $dOpt3 = array('description' => _('Mirror Url'), 'default' => '', 'value' => '', 'required' => false, - 'type' => 'string', 'display' => _('Mirror Url')); + 'type' => 'string', 'display' => _('Mirror Url'), + 'initiallyEditableOnly' => TRUE); $dOpt4 = array('description' => _('Method'), 'default' => 'puppet', 'value' => 'puppet', 'required' => false, - 'type' => 'combobox', 'display' => _('Installation method'), 'values'=>array('puppet'=>_('Puppet'))); + 'type' => 'combobox', 'display' => _('Installation method'), 'values'=>array('puppet'=>_('Puppet')), + 'initiallyEditableOnly' => TRUE); $dOpt5 = array('description' => _('Architecture'), 'default' => '', 'value' => '', 'required' => false, 'type' => 'list', 'display' => _('Architecture')); $dOpt6 = array('description' => _('Component'), 'default' => '', 'value' => '', 'required' => false, - 'type' => 'list', 'display' => _('Component'), 'initiallyEditableOnly' => TRUE); + 'type' => 'list', 'display' => _('Component')); $dOpt7 = array('description' => _('Mirror sources'), 'default' => '', 'value' => '', 'required' => false, 'type' => 'checkbox', 'display' => _('Mirror sources')); @@ -166,7 +168,6 @@ class newConfigManagement extends plugin // Load distributions $rpc = $this->config->getRpcHandle(); $res = $rpc->getDistributions(); - print_a($res); if(!$rpc->success()){ $this->errorMessage = sprintf(_("Failed to load distributions: %s"), $rpc->get_error()); return(FALSE); -- 2.30.2