summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 52f1c74)
raw | patch | inline | side by side (parent: 52f1c74)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 08:19:12 +0000 (08:19 +0000) | ||
committer | hickert <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:
index 6f6a6e52b52ae9fb3c370093d609479d63a9b370..0cabed07fa4c55900da79fd9fe53687ead199274 100644 (file)
}
$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")."'> ";
+ alt='"._("Create snapshot")."' name='CreateSnapShotDialog_".base64_encode($base)."'
+ title='"._("Create a new snapshot from this object")."'> ";
}
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'>".
+ " "._("Copy")."|"."multiple_copy_systems|\n";
+ }
+ if($cut){
+ $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
+ " "._("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." "._("Paste")."|editPaste|\n";
+ }else{
+ $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
+ $s.="..|".$img." "._("Paste")."\n";
+ }
+ }
+ }
+ return($s);
+ }
+
+
+ function get_copypaste_action($base,$category,$class)
+ {
+
+ }
+
+
function get_used_snapshot_bases()
{
return(array());
index 86f1bbadafee11f2ebb5befbd1f289709da92f40..3c9d363cbdebae28f17b431951621357453ec415 100644 (file)
@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)));
}
diff --git a/gosa-core/plugins/admin/acl/class_divListACL.inc b/gosa-core/plugins/admin/acl/class_divListACL.inc
index b1c3734e882f895436f3ccd42bdd89e496d502fc..9f19842eb1301c642eecba13c527fefd6ba6f7ff 100644 (file)
$s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
" "._("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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-core/plugins/admin/groups/class_divListGroup.inc b/gosa-core/plugins/admin/groups/class_divListGroup.inc
index c3e1fb78ce788ea01e08e35d2cf2b25c52eec423..b2bf8fbdfa82e191db0491d35e0935aae15d367d 100644 (file)
/* 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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc b/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc
index 4894f9b13491a82501a174a3ef69730251709d55..d5247015951e4a3a0922a5d5a6b1435d5288b9a2 100644 (file)
}
}
- 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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-core/plugins/admin/users/class_divListUsers.inc b/gosa-core/plugins/admin/users/class_divListUsers.inc
index 9e2d725e44ee90060fa42a8e2756ca2b7ae20e5a..ae4210b2fb0afb9f0f9d9776c653c29101184b5a 100644 (file)
}
}
- 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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-plugins/fai/admin/fai/class_divListFai.inc b/gosa-plugins/fai/admin/fai/class_divListFai.inc
index 8820af5f85d12bacde28507ba93cad5584590d99..2c37a07bf0996095d67ea7bd9e16109a96bafe49 100644 (file)
" "._("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'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc b/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc
index 234625466a775b81a774759f88c314e9bf41dd47..c1defca282d1dedea244a0f0ea36c2544224ac56 100644 (file)
$s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
" "._("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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc b/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc
index b116eacdff0287a211a6b3e62a8b287d8472015f..38af27bc3b71f66a1450416bca073fa644510b2f 100644 (file)
$s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
" "._("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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-plugins/gofon/gofon/macro/class_divListMacros.inc b/gosa-plugins/gofon/gofon/macro/class_divListMacros.inc
index 8420ead27c6e31ac87e1e2904f99c84d7a0d4fef..4b29021c29b177da61dc1619705dd2f24357b2d5 100644 (file)
" "._("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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-plugins/goto/admin/applications/class_divListApplication.inc b/gosa-plugins/goto/admin/applications/class_divListApplication.inc
index de0e1263bec6d0975e88810914e30d31bb596761..194654d40fc17eed2f47b17df56852c3cb37856e 100644 (file)
$s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
" "._("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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-plugins/goto/admin/devices/class_divListDevices.inc b/gosa-plugins/goto/admin/devices/class_divListDevices.inc
index 7c4b39e2f0767932b7937070b05114d6e5e43a78..7ff3b2b2aa7537000f198c16ecf3abcb3b6eccba 100644 (file)
$s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
" "._("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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-plugins/goto/admin/mimetypes/class_divListMimeTypes.inc b/gosa-plugins/goto/admin/mimetypes/class_divListMimeTypes.inc
index 53b9a1bd72c948c54a93af8654f6640c2075c7a3..4f669c95dc8796183ca115995ca3d000008a00cd 100644 (file)
$s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
" "._("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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc
index 98259d9fd454a4afd0c2aa2715000ea823f2b4a9..701218be50f4296a0940801ec00b77c53f2aa406 100644 (file)
" "._("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'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);
diff --git a/gosa-plugins/systems/admin/systems/class_divListSystem.inc b/gosa-plugins/systems/admin/systems/class_divListSystem.inc
index 8f549172f8307a0d87a9d91e66053ab634b117f3..f6a894d2147f4d8c35912ef4a9afd0e68c60e551 100644 (file)
$s.= "..|<img src='images/lists/unlocked.png' alt='' border='0' class='center'>".
" "._("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'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
- " "._("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." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
- $s.="..|".$img." "._("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);