Code

* Moved tree icon
[gosa.git] / gosa-plugins / sudo / admin / sudo / class_divListSudo.inc
index de03718668d44ad923186b0dbfee5554e2933ef8..6ec0abeca26937010e6cfa9e345859ca18d21c56 100644 (file)
@@ -28,17 +28,16 @@ class divListSudo extends MultiSelectWindow
 {
 
   /* Current base */
-  var $selectedBase       = "";
-  var $departments        = array();
+  private $departments        = array();
 
   /* Regex */
-  var $Regex              = "*";
-  var $UserRegex          = "*";
+  public $Regex              = "*";
+  public $UserRegex          = "*";
 
   /* Subsearch checkbox */
-  var $SubSearch          = FALSE;
-  var $parent             ;
-  var $ui                 ;
+  public $SubSearch          = FALSE;
+  protected $parent             ;
+  public $ui                 ;
 
 
   /*! \brief  Initialize this class 
@@ -65,9 +64,12 @@ class divListSudo extends MultiSelectWindow
     $this->EnableSaveButton (false);
 
     /* Dynamic action col, depending on snapshot icons */
-    $action_col_size = 50;
+    $action_col_size = 54;
     if($this->parent->snapshotEnabled()){
-      $action_col_size += 38;
+      $action_col_size += 32;
+    }
+    if($this->parent->CopyPasteHandler){
+      $action_col_size += 20;
     }
 
     /* Toggle all selected / deselected */
@@ -85,7 +87,7 @@ class divListSudo extends MultiSelectWindow
     $this->AddRegex   ("Regex"    , _("Regular expression for matching role names")       , 
       "*" , true);
     $this->AddRegex   ("UserRegex", _("Regular expression for matching role member names"),
-      "*" , FALSE,"images/search_user.png");
+      "*" , FALSE,"images/lists/search-user.png");
   }
 
 
@@ -104,7 +106,7 @@ class divListSudo extends MultiSelectWindow
     
     /* Create Layers menu */
     $s  = ".|"._("Actions")."|\n";
-    $s .= "..|<img src='images/list_new.png' alt='' border='0' class='center'>".
+    $s .= "..|<img src='images/lists/new.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Create")."|\n";
 
     /* Append create options */
@@ -116,10 +118,28 @@ class divListSudo extends MultiSelectWindow
     /* Append multiple remove */
     if(preg_match("/d/",$acl)){
       $s.= "..|---|\n";
-      $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
+      $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Remove")."|"."del_role|\n";
     }
 
+    /* Add multiple copy & cut icons */
+    if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl)){
+      $s.= "..|---|\n";
+      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Copy")."|"."multiple_copy_sudo|\n";
+#      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
+#        "&nbsp;"._("Cut")."|"."multiple_cut_sudo|\n";
+
+      if($this->parent->CopyPasteHandler->entries_queued()){
+        $img = "<img border='0' class='center' src='images/lists/paste.png' alt=''>";
+        $s.="..|".$img."&nbsp;"._("Paste")."|editPaste|\n";
+      }else{
+        $img = "<img border='0' class='center' src='images/lists/paste.png' alt=''>";
+        $s.="..|".$img."&nbsp;"._("Paste")."\n";
+      }
+    }
+
+
     /* Add snapshot icons */
     if(preg_match("/(c.*w|w.*c)/",$acl)){
       $s .= "..|---|\n";
@@ -151,9 +171,12 @@ class divListSudo extends MultiSelectWindow
     $userimg  = "<img class='center' src='images/select_sudo.png' alt='Sudo' title='%s'>";
     $ui       = get_userinfo();
 
-    $action_col_size = 50;
+    $action_col_size = 54;
     if($this->parent->snapshotEnabled()){
-      $action_col_size += 38;
+      $action_col_size += 32;
+    }
+    if($this->parent->CopyPasteHandler){
+      $action_col_size += 20;
     }
 
     // Test Every Entry and generate divlist Array
@@ -164,8 +187,18 @@ class divListSudo extends MultiSelectWindow
 
       /* Add edit icon */
       $actions = "";
+
+      $actions= "";
+      if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl)){
+#        $actions.= "<input class='center' type='image'
+#          src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
+        $actions.= "<input class='center' type='image'
+          src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
+      }
+
+
       $actions.= "<input class='center' type='image'
-        src='images/edit.png' alt='".msgPool::editButton()."' name='sudo_edit_%KEY%' title='"._("Edit this entry")."'>";
+        src='images/lists/edit.png' alt='".msgPool::editButton()."' name='sudo_edit_%KEY%' title='"._("Edit this entry")."'>";
 
       if(preg_match("/(c.*w|w.*c)/",$acl)){
         $actions.= $this->GetSnapShotActions($val['dn']);
@@ -173,7 +206,7 @@ class divListSudo extends MultiSelectWindow
 
       if(preg_match("/d/",$acl)){
         $actions.= "<input class='center' type='image'
-          src='images/edittrash.png' alt='".msgPool::delButton()."' name='sudo_del_%KEY%' title='"._("Delete this entry")."'>";
+          src='images/lists/trash.png' alt='".msgPool::delButton()."' name='sudo_del_%KEY%' title='"._("Delete this entry")."'>";
       }
 
       $title = "title='".preg_replace('/ /', '&nbsp;', @LDAP::fix($val['dn']))."'";
@@ -191,6 +224,16 @@ class divListSudo extends MultiSelectWindow
         $display = "<b>$display</b>";
       }
 
+      /* Cutted objects should be displayed in light grey */
+      if($this->parent->CopyPasteHandler){
+        foreach($this->parent->CopyPasteHandler->queue as $queue_key => $queue_data){
+          if($queue_data['dn'] == $val['dn']) {
+            $display = "<font color='#999999'>".$display."</font>";
+            break;
+          }
+        }
+      }
+
       $field1 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
           "attach" => "style='width:20px;'");
       $field2 = array("string" => sprintf($userimg,$val['dn']),