Code

Added config mangemetn tab wich allows to assign config items to a device later.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 May 2011 11:34:05 +0000 (11:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 May 2011 11:34:05 +0000 (11:34 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20835 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Device/DeviceConfig.tpl [new file with mode: 0644]
gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc [new file with mode: 0644]
gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc

diff --git a/gosa-plugins/goto/admin/systems/goto/Device/DeviceConfig.tpl b/gosa-plugins/goto/admin/systems/goto/Device/DeviceConfig.tpl
new file mode 100644 (file)
index 0000000..9daeafb
--- /dev/null
@@ -0,0 +1 @@
+test
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc
new file mode 100644 (file)
index 0000000..f11df17
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+
+class DeviceConfig extends plugin
+{
+
+    /* Some plugin management related attributes 
+     * See class plugin for details.
+     */
+    public $view_logged = FALSE;
+    public $ignore_account = FALSE;
+    public $parent = NULL;
+
+    /*! \brief  Initialize the plugin and its widgets. 
+     *          Finally call init() to load values from the backend.
+     */ 
+    function __construct(&$config, $dn, $parent)
+    {
+        plugin::plugin($config, $dn);
+
+        $this->is_account = $this->initially_was_account = FALSE;
+
+        $this->_device = &$parent;
+        $this->deviceUUID = $parent->deviceUUID;
+    }
+
+    function check()
+    {
+    }
+    
+    
+    function execute()
+    {
+        // Log account access
+        if($this->is_account && !$this->view_logged){
+            $this->view_logged = TRUE;
+            new log("view","Device/".get_class($this),$this->dn);
+        }
+
+        /***************
+          Handle account state
+         ***************/
+
+        // Allow to add or remove the distribution list extension
+        if(isset($_POST['modify_state'])){
+            if($this->is_account && $this->acl_is_removeable()){
+                $this->is_account= FALSE;
+            }elseif(!$this->is_account && $this->acl_is_createable()){
+                $this->is_account= TRUE;
+            }
+        }
+
+        // Show account status-changer
+        $display = "";
+        if ($this->parent !== NULL){
+            if ($this->is_account){
+                $display= $this->show_disable_header(_("Remove config mangement"),
+                        msgPool::featuresEnabled(_("Config management")));
+            } else {
+                $display= $this->show_enable_header(_("Add Config management"),
+                        msgPool::featuresDisabled(_("Config management")));
+                return ($display);
+            }
+        }
+
+        $smarty = get_smarty();
+        return($display.$smarty->fetch(get_template_path('goto/Device/DeviceConfig.tpl', TRUE)));
+    }
+
+
+    function save_object()
+    {
+    }
+
+
+    function save()
+    {
+    }
+
+    
+    function remove_from_parent()
+    {
+    }
+    
+    static function plInfo()
+    {
+        return (array(
+                    "plShortName"   => _("Device"),
+                    "plDescription" => _("Registered device"),
+                    "plSelfModify"  => FALSE,
+                    "plDepends"     => array(),
+                    "plPriority"    => 1,
+                    "plSection"     => array("administration"),
+                    "plCategory"    => array("Device"),
+                    "plProvidedAcls" => array(
+                        )));
+    }
+}
+?>
index 9baaa35027b463867e06892e20d11ef0f0d20d08..7f8b7d67c5598f3d293ab50c85c32b061224c9f1 100644 (file)
@@ -309,11 +309,11 @@ class InstallRecipe extends plugin
         $display = "";
         if ($this->parent !== NULL){
             if ($this->is_account){
-                $display= $this->show_disable_header(_("Remove install profile"),
-                        msgPool::featuresEnabled(_("Install profile")));
+                $display= $this->show_disable_header(_("Remove base installation"),
+                        msgPool::featuresEnabled(_("Base installation")));
             } else {
-                $display= $this->show_enable_header(_("Add install profile"),
-                        msgPool::featuresDisabled(_("Install profile")));
+                $display= $this->show_enable_header(_("Add base installation"),
+                        msgPool::featuresDisabled(_("Base installation")));
                 return ($display);
             }
         }