Code

Updated list summary, using images instead of object names
[gosa.git] / plugins / admin / fai / class_faiProfile.inc
index 69af93981b56e3d03f3d5101091b513a8e828102..e9b59675fe583568bf80df95c71d288fcec7b878 100644 (file)
@@ -2,11 +2,6 @@
 
 class faiProfile extends plugin
 {
-  /* CLI vars */
-  var $cli_summary      = "Manage server basic objects";
-  var $cli_description  = "Some longer text\nfor help";
-  var $cli_parameters   = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
   /* attribute list for save action */
   var $ignore_account   = TRUE;
 
@@ -34,8 +29,9 @@ class faiProfile extends plugin
   var $base           = "";
   var $release        = "";
   var $copy_paste_mode= false;
+  var $cut_paste_mode = false;
 
-  var $CopyPasteVars  = array("FAIclass","FAIclasses","FAIAllclasses","FAIstate");
+  var $CopyPasteVars  = array("FAIclass","FAIclasses","FAIAllclasses");
 
   function faiProfile($config, $dn= NULL)
   {
@@ -388,7 +384,7 @@ class faiProfile extends plugin
     if($this->copy_paste_mode){
 
       /* If this is a new script, check if a script with this name already exists */
-      if(!empty($this->release) && $this->copy_paste_mode){
+      if(!empty($this->release) && ($this->copy_paste_mode || $this->cut_paste_mode) ){
 
         /* Check if current name is already used for fai scripts in selected release */
         $dn = 'cn='.$this->cn.",ou=profiles,".$this->release;
@@ -466,6 +462,29 @@ class faiProfile extends plugin
     $this->handle_object_tagging();
     show_ldap_error($ldap->get_error());
   }
+
+  
+  /* return copy & paste dialog
+   */
+  function getCopyDialog()
+  {
+    /* Ask for cn */
+    $smarty = get_smarty();
+    $smarty->assign("cn" ,$this->cn);
+    $str = $smarty->fetch(get_template_path("paste_fai_object.tpl",TRUE));
+    $ret = array();
+    $ret['string'] = $str;
+    $ret['status'] = "";
+    return($ret);
+  }
+
+  /* Get posted cn */
+  function saveCopyDialog()
+  {
+    if(isset($_POST['cn'])){
+      $this->cn = $_POST['cn'];
+    }
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: