Code

Updated copy & paste acls, centralized checks
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 May 2008 08:19:12 +0000 (08:19 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 May 2008 08:19:12 +0000 (08:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11097 594d385d-05f5-0310-b6e9-bd551577e9d8

15 files changed:
gosa-core/include/class_plugin.inc
gosa-core/include/class_userinfo.inc
gosa-core/plugins/admin/acl/class_divListACL.inc
gosa-core/plugins/admin/groups/class_divListGroup.inc
gosa-core/plugins/admin/ogroups/class_divListOGroup.inc
gosa-core/plugins/admin/users/class_divListUsers.inc
gosa-plugins/fai/admin/fai/class_divListFai.inc
gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc
gosa-plugins/gofon/gofon/conference/class_divListConferences.inc
gosa-plugins/gofon/gofon/macro/class_divListMacros.inc
gosa-plugins/goto/admin/applications/class_divListApplication.inc
gosa-plugins/goto/admin/devices/class_divListDevices.inc
gosa-plugins/goto/admin/mimetypes/class_divListMimeTypes.inc
gosa-plugins/sudo/admin/sudo/class_divListSudo.inc
gosa-plugins/systems/admin/systems/class_divListSystem.inc

index 6f6a6e52b52ae9fb3c370093d609479d63a9b370..0cabed07fa4c55900da79fd9fe53687ead199274 100644 (file)
@@ -1966,13 +1966,65 @@ class plugin
       }
 
       $str.= "<input class='center' type='image' src='images/snapshot.png'
-        alt='"._("Create snapshot")."' name='CreateSnapShotDialog_".base64_encode($base)."' title='"._("Create a new snapshot from this object")."'>&nbsp;";
+        alt='"._("Create snapshot")."' name='CreateSnapShotDialog_".base64_encode($base)."' 
+        title='"._("Create a new snapshot from this object")."'>&nbsp;";
     }
 
     return($str);
   }
 
 
+  function get_copypaste_header($base,$category,$copy = TRUE, $cut = TRUE)
+  {
+    $s = "";
+    $ui =get_userinfo();
+
+    if(!is_array($category)){
+      $category = array($category);
+    }
+
+    /* Check permissions for each category, if there is at least one category which 
+        support read or paste permissions for the given base, then display the specific actions.
+     */
+    $readable = $pasteable = TRUE;
+    foreach($category as $cat){
+      $readable |= $ui->get_category_permissions($base,$cat);
+      $pasteable|= $ui->is_pasteable($base,$cat);
+    }
+  
+    if(($cut || $copy) && isset($this->CopyPasteHandler) && is_object($this->CopyPasteHandler)){
+      if($readable){
+        $s.= "..|---|\n";
+        if($copy){
+          $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
+            "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
+        }
+        if($cut){
+          $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
+            "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
+        }
+      }
+
+      if($pasteable){
+        if($this->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-grey.png' alt=''>";
+          $s.="..|".$img."&nbsp;"._("Paste")."\n";
+        }
+      }
+    }
+    return($s);
+  }
+
+
+  function get_copypaste_action($base,$category,$class)
+  {
+
+  }
+
+
   function get_used_snapshot_bases()
   {
      return(array());
index 86f1bbadafee11f2ebb5befbd1f289709da92f40..3c9d363cbdebae28f17b431951621357453ec415 100644 (file)
@@ -230,7 +230,7 @@ class userinfo
       @param  String The acl  class (e.g. user) 
       @return Boolean   TRUE if we are allowed to paste an object.
   */
-  function is_pasteable($dn, $object, $class)
+  function is_pasteable($dn, $object)
   {
     return(preg_match("/w/",$this->has_complete_category_acls($dn, $object)));
   }
index b1c3734e882f895436f3ccd42bdd89e496d502fc..9f19842eb1301c642eecba13c527fefd6ba6f7ff 100644 (file)
@@ -168,22 +168,9 @@ class divListACL extends MultiSelectWindow
     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
 
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
 
index c3e1fb78ce788ea01e08e35d2cf2b25c52eec423..b2bf8fbdfa82e191db0491d35e0935aae15d367d 100644 (file)
@@ -207,22 +207,9 @@ class divListGroup extends MultiSelectWindow
     /* Add multiple copy & cut icons */
     $acl_all= $ui->has_complete_category_acls($this->selectedBase,"groups");
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
-
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
+    
     /* Add snapshot functionality */
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
 
index 4894f9b13491a82501a174a3ef69730251709d55..d5247015951e4a3a0922a5d5a6b1435d5288b9a2 100644 (file)
@@ -219,22 +219,8 @@ class divListOGroup extends MultiSelectWindow
       }
     }
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     /* Add snapshot icons */
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);    
index 9e2d725e44ee90060fa42a8e2756ca2b7ae20e5a..ae4210b2fb0afb9f0f9d9776c653c29101184b5a 100644 (file)
@@ -199,23 +199,7 @@ class divListUsers extends MultiSelectWindow
       }
     }
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
-
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
 
     $this->SetDropDownHeaderMenu($s);
index 8820af5f85d12bacde28507ba93cad5584590d99..2c37a07bf0996095d67ea7bd9e16109a96bafe49 100644 (file)
@@ -157,24 +157,8 @@ class divListFai extends MultiSelectWindow
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-    }
-
-    /* Add copy & paste icons, currently disabled, this ability is not implemeneted yet */
-    if(!($this->parent->lock_type == "freeze" && !$this->parent->allow_freeze_object_attach) && 
-      preg_match("/(c.*w|w.*c)/",$acl_all) &&  isset($this->parent->CopyPasteHandler) && $this->parent->CopyPasteHandler){
-      $s .= "..|---|\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 Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module,TRUE,FALSE);
 
 #   /* Add snapshot icons, if we are allowed to write and create the complete fai module ($ui->has_complete_category_acls) */ 
 #   $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
index 234625466a775b81a774759f88c314e9bf41dd47..c1defca282d1dedea244a0f0ea36c2544224ac56 100644 (file)
@@ -151,22 +151,8 @@ class divListBlocklist extends MultiSelectWindow
     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     /* Add snapshot icons */
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
index b116eacdff0287a211a6b3e62a8b287d8472015f..38af27bc3b71f66a1450416bca073fa644510b2f 100644 (file)
@@ -148,22 +148,8 @@ class divListConference extends MultiSelectWindow
     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
 
index 8420ead27c6e31ac87e1e2904f99c84d7a0d4fef..4b29021c29b177da61dc1619705dd2f24357b2d5 100644 (file)
@@ -146,22 +146,8 @@ class divListMacro extends MultiSelectWindow
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     /* Add snapshot icons */
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
index de0e1263bec6d0975e88810914e30d31bb596761..194654d40fc17eed2f47b17df56852c3cb37856e 100644 (file)
@@ -162,22 +162,8 @@ class divListApplication extends MultiSelectWindow
     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     /* Add snapshot icons */
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
index 7c4b39e2f0767932b7937070b05114d6e5e43a78..7ff3b2b2aa7537000f198c16ecf3abcb3b6eccba 100644 (file)
@@ -147,22 +147,8 @@ class divListDevices extends MultiSelectWindow
     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     /* Add snapshot icons */
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
index 53b9a1bd72c948c54a93af8654f6640c2075c7a3..4f669c95dc8796183ca115995ca3d000008a00cd 100644 (file)
@@ -171,22 +171,8 @@ class divListMimeTypes extends MultiSelectWindow
     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     /* Add snapshot icons */
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
index 98259d9fd454a4afd0c2aa2715000ea823f2b4a9..701218be50f4296a0940801ec00b77c53f2aa406 100644 (file)
@@ -123,20 +123,8 @@ class divListSudo extends MultiSelectWindow
         "&nbsp;"._("Remove")."|"."del_role|\n";
     }
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     /* Add snapshot icons */
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);   
index 8f549172f8307a0d87a9d91e66053ab634b117f3..f6a894d2147f4d8c35912ef4a9afd0e68c60e551 100644 (file)
@@ -260,22 +260,8 @@ class divListSystem extends MultiSelectWindow
     $s.= "..|<img src='images/lists/unlocked.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Activate systems")."|activate_multiple|\n";
 
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$all_module_acls)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
-
-    /* Copy & paste icons */
-    if(is_object($this->parent->CopyPasteHandler) && $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-grey.png' alt=''>";
-      $s.="..|".$img."&nbsp;"._("Paste")."\n";
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     /* Add snapshot icons */
     $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);