From: hickert Date: Fri, 2 Nov 2007 13:57:46 +0000 (+0000) Subject: Added layer menu to apps X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=992734df1df11960de4b72c3bd790fc521a36954;p=gosa.git Added layer menu to apps git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7719 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/applications/class_applicationManagement.inc b/plugins/admin/applications/class_applicationManagement.inc index 45914bd4e..78f76d45f 100644 --- a/plugins/admin/applications/class_applicationManagement.inc +++ b/plugins/admin/applications/class_applicationManagement.inc @@ -151,6 +151,27 @@ class applicationManagement extends plugin $s_entry = preg_replace("/_.$/","",$s_entry); + /* handle C&P from layers menu */ + if(isset($_POST['menu_action']) && preg_match("/^multiple_copy_systems/",$_POST['menu_action'])){ + $s_action = "copy_multiple"; + } + if(isset($_POST['menu_action']) && preg_match("/^multiple_cut_systems/",$_POST['menu_action'])){ + $s_action = "cut_multiple"; + } + if(isset($_POST['menu_action']) && preg_match("/^editPaste/",$_POST['menu_action'])){ + $s_action = "editPaste"; + } + + /* Create options */ + if(isset($_POST['menu_action']) && $_POST['menu_action'] == "appl_new"){ + $s_action = "new"; + } + + /* handle remove from layers menu */ + if(isset($_POST['menu_action']) && preg_match("/^remvove_multiple/",$_POST['menu_action'])){ + $s_action = "del_multiple"; + } + /**************** Copy & Paste handling ****************/ @@ -161,7 +182,6 @@ class applicationManagement extends plugin return($ret); } - /**************** Create a new app ****************/ diff --git a/plugins/admin/applications/class_divListApplication.inc b/plugins/admin/applications/class_divListApplication.inc index 0e4ae0230..5eaa67b73 100755 --- a/plugins/admin/applications/class_divListApplication.inc +++ b/plugins/admin/applications/class_divListApplication.inc @@ -136,58 +136,55 @@ class divListApplication extends MultiSelectWindow $acl = $ui->get_permissions("cn=dummy,".$this->selectedBase,"application/application"); $acl_all = $ui->has_complete_category_acls($this->selectedBase,"application"); - /* If this is true we have to add a seperator after - adding the special icons, just have a look at the lines below */ - $add_sep = false; - - /* Get copy & paste icon */ - $Copy_Paste =""; - if((preg_match("/(c.*w|w.*c)/",$acl_all)) && ($this->parent->CopyPasteHandler)){ - $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon(); - $add_sep = true; - } - /* Add default header */ $listhead = MultiSelectWindow::get_default_header(); - /* Add snapshot header icons */ - if(preg_match("/(c.*w|w.*c)/",$acl_all)){ - $listhead .= $this->get_snapshot_header($this->selectedBase); - $add_sep = true; - } - - /* Add create icon */ - if(preg_match("/c/",$acl)){ - $listhead .= "  "; - $add_sep = true; - } - - /* Add copy & paste icon */ - $listhead.= $Copy_Paste; - - /* Add a seperator if required and the list will look perfectly */ - if($add_sep){ - $listhead .= "  "; - } - /* And the rest, a base selection box */ $listhead .= _("Base")." ". "  "; - /* Multiple options */ - $listhead .= "  "; + /* Create Layers menu */ + $s = ".|"._("Actions")."|\n"; + $s .= "..|". + " "._("Create")."|\n"; + + /* Append create options */ + if(preg_match("/c/",$acl)) { + $s.= "...|". + " "._("Application")."|appl_new|\n"; + } + + /* Multiple options */ + $s.= "..|---|\n"; + $s.= "..|". + " "._("Remove")."|"."remvove_multiple|\n"; /* Add multiple copy & cut icons */ - if(is_object($this->parent->CopyPasteHandler)){ - $listhead .= "  "; - $listhead .= "  "; + if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){ + $s.= "..|---|\n"; + $s.= "..|". + " "._("Copy")."|"."multiple_copy_systems|\n"; + $s.= "..|". + " "._("Cut")."|"."multiple_cut_systems|\n"; + + if($this->parent->CopyPasteHandler->entries_queued()){ + $img = ""; + $s.="..|".$img." "._("Paste")."|editPaste|\n"; + }else{ + $img = ""; + $s.="..|".$img." "._("Paste")."\n"; + } } - $listhead .=""; + + /* Add snapshot icons */ + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + $s .= "..|---|\n"; + $s .= $this->get_snapshot_header(TRUE); + } + + $this->SetDropDownHeaderMenu($s); + $this->SetListHeader($listhead); $this->SetListHeader($listhead); }