From: hickert Date: Fri, 29 Aug 2008 07:54:16 +0000 (+0000) Subject: Renamed opsi class. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=586857b173a14f209835b8d74f216ce8f57c42c1;p=gosa.git Renamed opsi class. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12307 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/opsi/admin/opsi/class_opsiProperties.inc b/gosa-plugins/opsi/admin/opsi/class_opsiProperties.inc new file mode 100644 index 000000000..5ff41aa5a --- /dev/null +++ b/gosa-plugins/opsi/admin/opsi/class_opsiProperties.inc @@ -0,0 +1,54 @@ +config = $config; + $this->product = $product; + $this->cfg = $cfg; + $this->hostId = $hostId; + } + + public function execute() + { + $smarty = get_smarty(); + $smarty->assign("cfg",$this->cfg); + return($smarty->fetch(get_template_path("properties.tpl",TRUE,dirname(__FILE__)))); + } + + public function save_object() + { + foreach($this->cfg as $name => $value){ + if(isset($_POST['value_'.$name])){ + $this->cfg[$name] = validate(get_post('value_'.$name)); + } + } + } + + public function get_cfg() + { + return($this->cfg); + } + + public function get_product() + { + return($this->product); + } + + public function get_hostId() + { + return($this->hostId); + } +} + + + + + +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> diff --git a/gosa-plugins/opsi/admin/opsi/class_opsi_product_config.inc b/gosa-plugins/opsi/admin/opsi/class_opsi_product_config.inc deleted file mode 100644 index 5ff41aa5a..000000000 --- a/gosa-plugins/opsi/admin/opsi/class_opsi_product_config.inc +++ /dev/null @@ -1,54 +0,0 @@ -config = $config; - $this->product = $product; - $this->cfg = $cfg; - $this->hostId = $hostId; - } - - public function execute() - { - $smarty = get_smarty(); - $smarty->assign("cfg",$this->cfg); - return($smarty->fetch(get_template_path("properties.tpl",TRUE,dirname(__FILE__)))); - } - - public function save_object() - { - foreach($this->cfg as $name => $value){ - if(isset($_POST['value_'.$name])){ - $this->cfg[$name] = validate(get_post('value_'.$name)); - } - } - } - - public function get_cfg() - { - return($this->cfg); - } - - public function get_product() - { - return($this->product); - } - - public function get_hostId() - { - return($this->hostId); - } -} - - - - - -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -?> diff --git a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc index 0e7c41608..acc0789f2 100644 --- a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc +++ b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc @@ -330,7 +330,7 @@ class opsiGeneric extends plugin if(isset($_POST['cancel_properties']) && is_object($this->dialog)){ $this->dialog = NULL; } - if(isset($_POST['save_properties']) && ($this->dialog instanceof opsiProductConfig)){ + if(isset($_POST['save_properties']) && ($this->dialog instanceof opsiProperties)){ $this->dialog->save_object(); $pro = $this->dialog->get_product(); $CFG = $this->dialog->get_cfg(); @@ -386,7 +386,7 @@ class opsiGeneric extends plugin } if(preg_match("/^edit_lp_/",$name)){ $product = preg_replace("/^edit_lp_(.*)_.$/","\\1",$name); - $this->dialog = new opsiProductConfig($this->config, + $this->dialog = new opsiProperties($this->config, $product,$this->a_selectedLocalProducts[$product]['CFG'],$this->hostId); break; } diff --git a/gosa-plugins/opsi/admin/opsi/properties.tpl b/gosa-plugins/opsi/admin/opsi/properties.tpl index 4c7a8e5ba..f38fe4b06 100644 --- a/gosa-plugins/opsi/admin/opsi/properties.tpl +++ b/gosa-plugins/opsi/admin/opsi/properties.tpl @@ -1,4 +1,13 @@ -

Opsi product properties

+

 {t}Opsi product properties{/t}

+ + +{if $cfg_count == 0} +
+{t}This product has no options.{/t} +
+
+ +{else} {foreach from=$cfg item=item key=key} @@ -8,6 +17,8 @@ {/foreach}
+ +{/if}