From 43c8b53c7c660583ba65eb82d8541268e6ac9452 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 2 Nov 2007 10:36:12 +0000 Subject: [PATCH] Replayed menu git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7711 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_divListFai.inc | 86 +++++++++++++---------- plugins/admin/fai/class_faiManagement.inc | 24 +++++++ 2 files changed, 73 insertions(+), 37 deletions(-) diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index 306a2aebe..23c324149 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -174,65 +174,77 @@ class divListFai extends MultiSelectWindow /* Add default header */ $listhead = MultiSelectWindow::get_default_header(); - $acl = $ui->get_permissions($this->selectedBase,"fai/faiProfile"); - if(preg_match("/c/",$acl)){ - $listhead .="  "; + /* Add additional seperator */ + if($add_sep){ $listhead .="  "; } - /* Add snapshot icons, if we are allowed to write and create the complete fai module ($ui->has_complete_category_acls) */ - if(preg_match("/(c.*w|w.*c)/",$acl_all)){ - $listhead .= $this->get_snapshot_header($this->selectedBase); - } + $listhead .= _("Base")." ". + "  "; - /* Add copy & paste icons, currently disabled, this ability is not implemeneted yet */ - if(preg_match("/(c.*w|w.*c)/",$acl_all) && isset($this->parent->CopyPasteHandler) && $this->parent->CopyPasteHandler){ - $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon(); + + $s = ".|"._("Actions")."|\n"; + $s .= "..|". + " "._("Create")."|\n"; + + $acl = $ui->get_permissions($this->selectedBase,"fai/faiProfile"); + if(preg_match("/c/",$acl)){ + $s.= "...|". + " "._("Profile")."|Create_profile|\n"; } /* Append create icons for each fai component */ $arr = array( - array("images/fai_new_partitionTable.png" , _("New partition table") ,"Create_partition" , _("PT") , "faiPartitionTable"), - array("images/fai_new_script.png" , _("New scripts") ,"Create_script" , _("S") , "faiScript"), - array("images/fai_new_hook.png" , _("New hooks") ,"Create_hook" , _("H") , "faiHook"), - array("images/fai_new_variable.png" , _("New variables") ,"Create_variable" , _("V") , "faiVariable"), - array("images/fai_new_template.png" , _("New templates ") ,"Create_template" , _("I") , "faiTemplate"), - array("images/fai_new_packages.png" , _("New package list") ,"Create_package" , _("PK") , "faiPackage")); + array("images/fai_new_partitionTable.png" , _("Partition table") ,"Create_partition" , _("PT") , "faiPartitionTable"), + array("images/fai_new_script.png" , _("Scripts") ,"Create_script" , _("S") , "faiScript"), + array("images/fai_new_hook.png" , _("Hooks") ,"Create_hook" , _("H") , "faiHook"), + array("images/fai_new_variable.png" , _("Variables") ,"Create_variable" , _("V") , "faiVariable"), + array("images/fai_new_template.png" , _("Templates ") ,"Create_template" , _("I") , "faiTemplate"), + array("images/fai_new_packages.png" , _("Package list") ,"Create_package" , _("PK") , "faiPackage")); foreach($arr as $ar){ $acl = $ui->get_permissions($this->selectedBase,"fai/".$ar[4]); if(preg_match("/c/",$acl)){ - $add_sep = true; - $listhead .="  "; + $s.= "...|". + " ".$ar[1]."|".$ar[2]."|\n"; } } - /* Add additional seperator */ - if($add_sep){ - $listhead .="  "; - } - - $listhead .= _("Base")." ". - "  "; - /* Multiple options */ - $listhead .= "  "; + $s.= "..|". + " "._("Remove")."|"."remvove_multiple|\n"; /* Add multiple copy & cut icons */ if(is_object($this->parent->CopyPasteHandler)){ - $listhead .= "  "; - $listhead .= "  "; - $listhead .= ""; + $s.= "..|---|\n"; + $s.= "..|". + " "._("Copy")."|"."multiple_copy_systems|\n"; + $s.= "..|". + " "._("Cut")."|"."multiple_cut_systems|\n"; } - $listhead .="";; + /* Add copy & paste icons, currently disabled, this ability is not implemeneted yet */ + if(preg_match("/(c.*w|w.*c)/",$acl_all) && isset($this->parent->CopyPasteHandler) && $this->parent->CopyPasteHandler){ + $s .= "..|---|\n"; + if($this->parent->CopyPasteHandler->entries_queued()){ + $img = ""; + $s.="..|".$img." "._("Paste")."|editPaste|\n"; + }else{ + $img = ""; + $s.="..|".$img." "._("Paste")."\n"; + } + } + /* Add snapshot icons, if we are allowed to write and create the complete fai module ($ui->has_complete_category_acls) */ + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + if($this->parent->snapshotEnabled()){ + $s .= "..|---|\n"; + $s .= $this->get_snapshot_header(TRUE); + } + } + $this->SetDropDownHeaderMenu($s); $this->SetListHeader($listhead); } @@ -309,7 +321,7 @@ class divListFai extends MultiSelectWindow $action= ""; - if(preg_match("/(c&w)/",$value['acl'])){ + if(preg_match("/(c)/",$value['acl']) && preg_match("/(w)/",$value['acl'])){ $action.= $this->GetSnapShotActions($value['dn']);; } diff --git a/plugins/admin/fai/class_faiManagement.inc b/plugins/admin/fai/class_faiManagement.inc index 578a961d5..017fa5dbb 100644 --- a/plugins/admin/fai/class_faiManagement.inc +++ b/plugins/admin/fai/class_faiManagement.inc @@ -134,6 +134,30 @@ class faiManagement extends plugin "FAIprofile" => "faiProfile", "FAItemplate" => "faiTemplate"); + + /* 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']) && preg_match("/^Create_/",$_POST['menu_action'])){ + $s_action = "new_".preg_replace("/^Create_/","",$_POST['menu_action']);; + $s_entry = preg_replace("/^Create_/","",$_POST['menu_action']); + } + + /* handle remove from layers menu */ + if(isset($_POST['menu_action']) && preg_match("/^remvove_multiple/",$_POST['menu_action'])){ + $s_action = "del_multiple"; + } + + /**************** Delete confirme dialog ****************/ -- 2.30.2