From ebb6ba2542ae33af774b184a620317177dc1be10 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 4 Dec 2006 04:50:22 +0000 Subject: [PATCH] Updated divlist fai git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5292 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_divListFai.inc | 42 ++++++++++++++++---------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index 7707658b3..d0493cdab 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -108,12 +108,9 @@ class divListFai extends MultiSelectWindow /* Load possible departments */ $ui= get_userinfo(); $tdeps= $ui->get_module_departments("fai"); - $ids = $this->config->idepartments; - foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ - $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -123,36 +120,45 @@ class divListFai extends MultiSelectWindow } } + /* Add seperator */ + $add_sep = false; + + /* Get complete fai acls, to be able to check if we must show or hide the snapshot abilities */ + $acl_all = $ui->has_complete_category_acls($this->selectedBase,$this->module); + /* Create listhead, it will be shown on top of the divlist. * It provides general navigation and object creation */ $listhead = "
 ". - " ". - " ". - " ". - "  ". - "\"\" "; $acl = $ui->get_permissions($this->selectedBase,"fai/faiProfile"); if(preg_match("/c/",$acl)){ $listhead .="  "; + $listhead .="  "; } - $listhead .= "\"\" "; - $listhead .= $this->get_snapshot_header($this->selectedBase); + /* 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); + } + /* 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(); + } + /* 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"), @@ -162,18 +168,22 @@ _("Submit")."'> ". array("images/fai_new_packages.png" , _("New 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 .="  "; } } - $listhead .="  ". - - _("Base")." ". - "  ". - "
"; + /* Add additional seperator */ + if($add_sep){ + $listhead .="  "; + } + + $listhead .= _("Base")." ". + "  ". + ""; $this->SetListHeader($listhead); } -- 2.30.2