summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 31bd098)
raw | patch | inline | side by side (parent: 31bd098)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 08:35:32 +0000 (08:35 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 08:35:32 +0000 (08:35 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11098 594d385d-05f5-0310-b6e9-bd551577e9d8
14 files changed:
index 0cabed07fa4c55900da79fd9fe53687ead199274..f038fbf56d858f51b120db60966f3be939cf08e9 100644 (file)
}
+ function get_copypaste_action($base,$category,$class,$copy = TRUE, $cut = TRUE)
+ {
+ $ui = get_userinfo();
+ $action = "";
+ if($this->CopyPasteHandler){
+ if($cut){
+ if($ui->is_cutable($base,$category,$class)){
+ $action .= "<input class='center' type='image'
+ src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
+ }else{
+ $action.="<img src='images/empty.png' alt=' ' class='center'> ";
+ }
+ }
+ if($copy){
+ if($ui->is_copyable($base,$category,$class)){
+ $action.= "<input class='center' type='image'
+ src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
+ }else{
+ $action.="<img src='images/empty.png' alt=' ' class='center'> ";
+ }
+ }
+ }
+
+ return($action);
+ }
+
+
function get_copypaste_header($base,$category,$copy = TRUE, $cut = TRUE)
{
$s = "";
}
- function get_copypaste_action($base,$category,$class)
- {
-
- }
-
-
function get_used_snapshot_bases()
{
return(array());
diff --git a/gosa-core/plugins/admin/acl/class_divListACL.inc b/gosa-core/plugins/admin/acl/class_divListACL.inc
index 9f19842eb1301c642eecba13c527fefd6ba6f7ff..f1e92b2f9e2da4693cc17f75c8f2160569246dd8 100644 (file)
$cn .= " [".$acl_entry['description'][0]."]";
}
- /* Add copy & paste handler */
- if($ui->is_cutable($acl_entry['dn'],"aclroles","aclRole") && $this->parent->CopyPasteHandler){
- $action .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
- if($ui->is_copyable($acl_entry['dn'],"aclroles","aclRole") && $this->parent->CopyPasteHandler){
- $action.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
+ /* Add copy & cut functionality */
+ $action.= $this->parent->get_copypaste_action($acl_entry['dn'],"aclroles","aclRole");
/* Add actions depending on acls */
if(preg_match("/r/", $acl)){
diff --git a/gosa-core/plugins/admin/groups/class_divListGroup.inc b/gosa-core/plugins/admin/groups/class_divListGroup.inc
index b2bf8fbdfa82e191db0491d35e0935aae15d367d..7c42291e4ce1c156a62ffbba5e21b35aee96da34 100644 (file)
$actions= "";
- if($ui->is_cutable($val['dn'],"groups","group") && $this->parent->CopyPasteHandler){
- $actions .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
- if($ui->is_copyable($val['dn'],"groups","group") && $this->parent->CopyPasteHandler){
- $actions.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
+ /* Add copy & cut functionality */
+ $actions.= $this->parent->get_copypaste_action($val['dn'],"groups","group");
/* Add edit icon */
$actions.= "<input class='center' type='image'
diff --git a/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc b/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc
index d5247015951e4a3a0922a5d5a6b1435d5288b9a2..74e7c7447ad33546e4a47e2b6b0b170943cfb673 100644 (file)
$acl = $ui->get_permissions($val['dn'],"ogroups/ogroup");
$acl_all= $ui->has_complete_category_acls($val['dn'],"ogroups");
- if($ui->is_cutable($val['dn'],"ogroups","ogroup") && $this->parent->CopyPasteHandler){
- $actions .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
- if($ui->is_copyable($val['dn'],"ogroups","ogroup") && $this->parent->CopyPasteHandler){
- $actions.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
+ /* Add copy & cut functionality */
+ $actions.= $this->parent->get_copypaste_action($val['dn'],"ogroups","ogroup");
$actions.= "<input class='center' type='image'
src='images/lists/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
diff --git a/gosa-core/plugins/admin/users/class_divListUsers.inc b/gosa-core/plugins/admin/users/class_divListUsers.inc
index ae4210b2fb0afb9f0f9d9776c653c29101184b5a..61aacad3f116284072940b636bc79d88275dd0b7 100644 (file)
$acl = $ui->get_permissions($val['dn'],"users/user");
$acl_all = $ui->has_complete_category_acls($val['dn'],"users");
- if($ui->is_cutable($val['dn'],"users","user") && $this->parent->CopyPasteHandler){
- $action .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
- if($ui->is_copyable($val['dn'],"users","user") && $this->parent->CopyPasteHandler){
- $action.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
+ /* Add copy & cut functionality */
+ $action.= $this->parent->get_copypaste_action($val['dn'],"users","user");
/* Add deactivate status */
$lock_status = "";
diff --git a/gosa-plugins/fai/admin/fai/class_divListFai.inc b/gosa-plugins/fai/admin/fai/class_divListFai.inc
index 2c37a07bf0996095d67ea7bd9e16109a96bafe49..1544c1a648565eee71b57da4547c052151c7aea8 100644 (file)
$ui = get_userinfo();
$action ="";
$acl_all = $ui->has_complete_category_acls($this->parent->fai_base,$this->module);
- if($ui->is_copyable($value['dn'],"fai",$value['class']) && $this->parent->CopyPasteHandler){
- $action .= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }
+
+ /* Add copy & cut functionality */
+ $action.= $this->parent->get_copypaste_action($value['dn'],"fai",$value['class'],TRUE,FALSE);
if(preg_match("/^freeze/", $value['FAIstate'])){
$editlink ="<a href='?plug=".$_GET['plug']."&edit_freeze_entry=%KEY%' title='%TITLE%'>%NAME%</a>";
diff --git a/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc b/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc
index c1defca282d1dedea244a0f0ea36c2544224ac56..6fea41c613cd98a98bbd43ae4a89a343428a2250 100644 (file)
}
$action ="";
- if($ui->is_cutable($val['dn'],"gofaxlist","blocklist") && $this->parent->CopyPasteHandler){
- $action .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
- if($ui->is_copyable($val['dn'],"gofaxlist","blocklist") && $this->parent->CopyPasteHandler){
- $action.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
+ /* Add copy & cut functionality */
+ $action.= $this->parent->get_copypaste_action($val['dn'],"gofaxlist","blocklist");
/* Edit link ; requires read access */
$action.= "<input class='center' type='image' src='images/lists/edit.png' alt='"._("edit")."' name='goFaxBlocklist_edit_%KEY%' title='"._("Edit user")."'>";
diff --git a/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc b/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc
index 38af27bc3b71f66a1450416bca073fa644510b2f..8936a3d72e11e229cebb971b7e22c5cc5d750f94 100644 (file)
}
$actions ="";
- if($ui->is_cutable($conference['dn'],"gofonconference","conference") && $this->parent->CopyPasteHandler){
- $actions .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
- if($ui->is_copyable($conference['dn'],"gofonconference","conference") && $this->parent->CopyPasteHandler){
- $actions.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
+ /* Add copy & cut functionality */
+ $actions.= $this->parent->get_copypaste_action($conference['dn'],"gofonconference","conference");
/* Add edit icon - This is allowed when we have at least read access. */
$actions.= "<input class='center' type='image' src='images/lists/edit.png'
diff --git a/gosa-plugins/gofon/gofon/macro/class_divListMacros.inc b/gosa-plugins/gofon/gofon/macro/class_divListMacros.inc
index 4b29021c29b177da61dc1619705dd2f24357b2d5..172e636d1dbb39e28653685bae0ab86cbc8d4e74 100644 (file)
continue;
}
- if($ui->is_cutable($val['dn'],"gofonmacro","macro") && $this->parent->CopyPasteHandler){
- $action .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
- if($ui->is_copyable($val['dn'],"gofonmacro","macro") && $this->parent->CopyPasteHandler){
- $action.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
+ /* Add copy & cut functionality */
+ $action.= $this->parent->get_copypaste_action($val['dn'],"gofonmacro","macro");
+
$action.= "<input class='center' type='image' src='images/lists/edit.png' alt='"._("edit")."'
name='goFonMacro_edit_%KEY%' title='"._("Edit macro")."'>";
diff --git a/gosa-plugins/goto/admin/applications/class_divListApplication.inc b/gosa-plugins/goto/admin/applications/class_divListApplication.inc
index 194654d40fc17eed2f47b17df56852c3cb37856e..8940e9c202aa8b9490567426c80c70fa21a2c27f 100644 (file)
/* Create action icons */
$actions= "";
- /* Add Copy & Paste icon */
- if($ui->is_cutable($val['dn'],"application","application") && $this->parent->CopyPasteHandler){
- $actions .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
- if($ui->is_copyable($val['dn'],"application","application") && $this->parent->CopyPasteHandler){
- $actions.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
+ /* Add copy & cut functionality */
+ $actions.= $this->parent->get_copypaste_action($val['dn'],"application","application");
/* Add edit icon */
$actions.= "<input class='center' type='image'
diff --git a/gosa-plugins/goto/admin/devices/class_divListDevices.inc b/gosa-plugins/goto/admin/devices/class_divListDevices.inc
index 7ff3b2b2aa7537000f198c16ecf3abcb3b6eccba..200fe2d8b61cb22490f2a95d1b32b679a7a92652 100644 (file)
$acl_all = $ui->has_complete_category_acls($val['dn'],"devices") ;
$actions = "";
- if($ui->is_cutable($val['dn'],"devices","deviceGeneric") && $this->parent->CopyPasteHandler){
- $actions .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
- if($ui->is_copyable($val['dn'],"devices","deviceGeneric") && $this->parent->CopyPasteHandler){
- $actions.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
+
+ /* Add copy & cut functionality */
+ $actions.= $this->parent->get_copypaste_action($val['dn'],"devices","deviceGeneric");
+
$actions.= "<input class='center' type='image'
src='images/lists/edit.png' alt='"._("edit")."' name='device_edit_%KEY%' title='"._("Edit this entry")."'>";
diff --git a/gosa-plugins/goto/admin/mimetypes/class_divListMimeTypes.inc b/gosa-plugins/goto/admin/mimetypes/class_divListMimeTypes.inc
index 4f669c95dc8796183ca115995ca3d000008a00cd..b8906fd912d73f5f4045de9f5dc3d562176b44cb 100644 (file)
$acl_all = $ui->has_complete_category_acls($val['dn'],"mimetypes") ;
$action = "";
- if($ui->is_cutable($val['dn'],"mimetypes","mimetype") && $this->parent->CopyPasteHandler){
- $action .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
- if($ui->is_copyable($val['dn'],"mimetypes","mimetype") && $this->parent->CopyPasteHandler){
- $action.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
+ /* Add copy & cut functionality */
+ $action.= $this->parent->get_copypaste_action($val['dn'],"mimetypes","mimetype");
$action.= "<input class='center' type='image'
src='images/lists/edit.png' alt='"._("edit")."' name='mime_edit_%KEY%' title='"._("Edit this entry")."'>";
diff --git a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc
index 701218be50f4296a0940801ec00b77c53f2aa406..1b04937b0a30a73bcf539d4faa9e193e006f3f47 100644 (file)
$acl = $ui->get_permissions($val['dn'],"sudo/sudo");
$acl_all= $this->ui->get_category_permissions($val['dn'],"sudo");
- /* Add edit icon */
- $actions= "";
- if($ui->is_copyable($val['dn'],"sudo","sudo") && $this->parent->CopyPasteHandler){
- $actions.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $actions.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
+ /* Add copy & cut functionality */
+ $actions = $this->parent->get_copypaste_action($val['dn'],"sudo","sudo",TRUE,FALSE);
$actions.= "<input class='center' type='image'
src='images/lists/edit.png' alt='".msgPool::editButton()."' name='sudo_edit_%KEY%' title='"._("Edit this entry")."'>";
diff --git a/gosa-plugins/systems/admin/systems/class_divListSystem.inc b/gosa-plugins/systems/admin/systems/class_divListSystem.inc
index f6a894d2147f4d8c35912ef4a9afd0e68c60e551..4d39098aaa52f52c716d227185b372c8f07fcb7b 100644 (file)
/* Get specific generic acls */
$acl = $ui->get_permissions($val['dn'],$tabs[$type]['ACL']);
- $action ="";
- if($ui->is_cutable($val['dn'],$category,$class) && $this->parent->CopyPasteHandler){
- $action .= "<input class='center' type='image'
- src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
- if($ui->is_copyable($val['dn'],$category,$class) && $this->parent->CopyPasteHandler){
- $action.= "<input class='center' type='image'
- src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }else{
- $action.="<img src='images/empty.png' alt=' ' class='center'> ";
- }
-
+ /* Add copy & cut functionality */
+ $action= $this->parent->get_copypaste_action($val['dn'],$category,$class);
$action.= "<input class='center' type='image' src='images/lists/edit.png'
alt='"._("edit")."' name='system_edit_%KEY%' title='"._("Edit system")."'>";