Code

Renamed opsi class.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 29 Aug 2008 07:54:16 +0000 (07:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 29 Aug 2008 07:54:16 +0000 (07:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12307 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/opsi/admin/opsi/class_opsiProperties.inc [new file with mode: 0644]
gosa-plugins/opsi/admin/opsi/class_opsi_product_config.inc [deleted file]
gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc
gosa-plugins/opsi/admin/opsi/properties.tpl

diff --git a/gosa-plugins/opsi/admin/opsi/class_opsiProperties.inc b/gosa-plugins/opsi/admin/opsi/class_opsiProperties.inc
new file mode 100644 (file)
index 0000000..5ff41aa
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+
+class opsiProductConfig extends plugin
+{
+  private $product;
+  private $cfg;
+  private $hostId;
+
+  public function __construct($config,$product,$cfg = array() ,$hostId = "")
+  {
+    $this->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 (file)
index 5ff41aa..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-
-class opsiProductConfig extends plugin
-{
-  private $product;
-  private $cfg;
-  private $hostId;
-
-  public function __construct($config,$product,$cfg = array() ,$hostId = "")
-  {
-    $this->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:
-?>
index 0e7c416088fd29d213f0a02a8fc412227a42eb56..acc0789f2bd4ad856d26d7166d891ab141aa30a6 100644 (file)
@@ -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;
         }
index 4c7a8e5bacf2a2cc65e17043dea1d7d80aab9b73..f38fe4b06f4874eb42f0dcd3ffd01cc4e14c0b9c 100644 (file)
@@ -1,4 +1,13 @@
-<h2>Opsi product properties</h2>
+<h2><img src='plugins/opsi/images/product.png' class='center' alt=''>&nbsp;{t}Opsi product properties{/t}</h2>
+
+
+{if $cfg_count == 0}
+<br>
+<b>{t}This product has no options.{/t}</b>
+<br>
+<br>
+
+{else}
 
 <table>
 {foreach from=$cfg item=item key=key}
@@ -8,6 +17,8 @@
        </tr>
 {/foreach}
 </table>
+
+{/if}
 <p class="seperator">&nbsp;</p>
 <div style='width:100%; text-align: right; padding:3px;'>
        <input type='submit' name='save_properties' value='{msgPool type='saveButton'}'>