Code

Updated image
[gosa.git] / gosa-plugins / fai / admin / fai / class_divListFai.inc
index 78009204429adc3ef0c8a940e663d593aa71385a..e516ee78d5cd76848e0f34dafae8fe24fc7bcdf7 100644 (file)
@@ -39,10 +39,10 @@ class divListFai extends MultiSelectWindow
     $this->EnableSaveButton (false);
 
     /* Dynamic action col, depending on snapshot icons */
-    $action_col_size = 120;
+    $action_col_size = 130;
 
     /* Toggle all selected / deselected */
-    $chk = "<input type='checkbox' id='select_all' name='select_all'
+    $chk = "<input type='checkbox' id='select_all' name='select_all' title='"._("Select all")."'
                onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
 
     /* set Page header */
@@ -81,11 +81,12 @@ class divListFai extends MultiSelectWindow
 
       $smarty = get_smarty();
       $releases = $this->parent->getBranches();
+      
       $smarty->assign("allow_create", $c);
       $smarty->assign("allow_remove", $r);
       $smarty->assign("fai_release" , $releases[$this->parent->fai_release]);
       $smarty->assign("fai_base"    , $releases[$this->parent->fai_base]);
-      $smarty->assign("branchimage","images/branch.png");
+      $smarty->assign("branchimage","plugins/fai/images/branch.png");
       $smarty->assign("fai_releases", $releases);
       $plug_id = 0;       
       if(isset($_GET['plug'])){
@@ -112,37 +113,42 @@ class divListFai extends MultiSelectWindow
     $acl_all = $ui->has_complete_category_acls($this->parent->fai_base,$this->module);
 
     /* Add default header */
-    $listhead = MultiSelectWindow::get_default_header();
+    $listhead = MultiSelectWindow::get_default_header(false);
 
     /* Add additional seperator */
     if($add_sep){
-      $listhead .=" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
+      $listhead .=" <img class='center' src='images/lists/seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
     }
 
     $s  = ".|"._("Actions")."|\n";
-    $s .= "..|<img src='images/list_new.png' alt='' border='0' class='center'>".
+    $s .= "..|<img src='images/lists/new.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Create")."|\n";
 
     $acl = $ui->get_permissions($this->parent->fai_base,"fai/faiProfile");
-    if(preg_match("/c/",$acl)){
-      $s.= "...|<input class='center' type='image' src='images/fai_new_profile.png' alt=''>".
-        "&nbsp;"._("Profile")."|Create_profile|\n";
-    }
-
-    /* Append create icons for each fai component */
-    $arr = array(
-        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->parent->fai_base,"fai/".$ar[4]);
+    if($this->parent->lock_type == "freeze" && !$this->parent->allow_freeze_object_attach){
+      $s.= "...|<input class='center' type='image' src='plugins/fai/images/freeze.png' alt=''>".
+        "&nbsp;"._("Freezed")."|\n";
+    }else{
       if(preg_match("/c/",$acl)){
-        $s.= "...|<input class='center' type='image' src='".$ar[0]."' alt=''>".
-          "&nbsp;".$ar[1]."|".$ar[2]."|\n";
+        $s.= "...|<input class='center' type='image' src='images/fai_new_profile.png' alt=''>".
+          "&nbsp;"._("Profile")."|Create_profile|\n";
+      }
+
+      /* Append create icons for each fai component */
+      $arr = array(
+          array("plugins/fai/images/fai_new_partitionTable.png" , _("Partition table")  ,"Create_partition" , _("PT") , "faiPartitionTable"),
+          array("plugins/fai/images/fai_new_script.png"         , _("Scripts")          ,"Create_script"    , _("S")  , "faiScript"),
+          array("plugins/fai/images/fai_new_hook.png"           , _("Hooks")            ,"Create_hook"      , _("H")  , "faiHook"),
+          array("plugins/fai/images/fai_new_variable.png"       , _("Variables")        ,"Create_variable"  , _("V")  , "faiVariable"),
+          array("plugins/fai/images/fai_new_template.png"       , _("Templates ")       ,"Create_template"  , _("I")  , "faiTemplate"),
+          array("plugins/fai/images/fai_new_packages.png"       , _("Package list")     ,"Create_package"   , _("PK") , "faiPackage"));
+
+      foreach($arr as $ar){
+        $acl = $ui->get_permissions($this->parent->fai_base,"fai/".$ar[4]);
+        if(preg_match("/c/",$acl)){
+          $s.= "...|<input class='center' type='image' src='".$ar[0]."' alt=''>".
+            "&nbsp;".$ar[1]."|".$ar[2]."|\n";
+        }
       }
     }
 
@@ -150,35 +156,12 @@ class divListFai extends MultiSelectWindow
     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
-    /* Add multiple copy & cut icons */
-    if(is_object($this->parent->CopyPasteHandler)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_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."&nbsp;"._("Paste")."|editPaste|\n";
-      }else{
-        $img = "<img border='0' class='center' src='images/lists/paste.png' alt=''>";
-        $s.="..|".$img."&nbsp;"._("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) */ 
-#   if(preg_match("/(c.*w|w.*c)/",$acl_all)){ 
-#     if($this->parent->snapshotEnabled()){
-#       $s .= "..|---|\n";
-#       $s .= $this->get_snapshot_header(TRUE);
-#     }
-#   }
+#   $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
 
     $this->SetDropDownHeaderMenu($s);
     $this->SetListHeader($listhead);
@@ -199,17 +182,17 @@ class divListFai extends MultiSelectWindow
      ********************/
 
      $objects = array(
-           "FAIpartitionTable"  => array("IMG"=> "images/fai_partitionTable.png", "NAME"=>_("Partition table"),"KZL"=> "PT", "VAR"=>"ShowPartitions"),
-           "FAIpackageList"     => array("IMG"=> "images/fai_packages.png",       "NAME"=>_("Package list") ,  "KZL"=> "PL", "VAR"=>"ShowPackages"),
+           "FAIpartitionTable"  => array("IMG"=> "plugins/fai/images/fai_partitionTable.png", "NAME"=>_("Partition table"),"KZL"=> "PT", "VAR"=>"ShowPartitions"),
+           "FAIpackageList"     => array("IMG"=> "plugins/fai/images/fai_packages.png",       "NAME"=>_("Package list") ,  "KZL"=> "PL", "VAR"=>"ShowPackages"),
            "FAIscript"          => array("IMG"=> "images/fai_script.png",         "NAME"=>_("Scripts") ,       "KZL"=> "S",  "VAR"=>"ShowScripts"),
            "FAIvariable"        => array("IMG"=> "images/fai_variable.png",       "NAME"=>_("Variables") ,     "KZL"=> "V",  "VAR"=>"ShowVariables"),
-           "FAIhook"            => array("IMG"=> "images/fai_hook.png",           "NAME"=>_("Hooks"),          "KZL"=> "H",  "VAR"=>"ShowHooks"),
-           "FAIprofile"         => array("IMG"=> "images/fai_profile.png",        "NAME"=>_("Profile") ,       "KZL"=> "P",  "VAR"=>"ShowProfiles"),
+           "FAIhook"            => array("IMG"=> "plugins/fai/images/fai_hook.png",           "NAME"=>_("Hooks"),          "KZL"=> "H",  "VAR"=>"ShowHooks"),
+           "FAIprofile"         => array("IMG"=> "plugins/fai/images/fai_profile.png",        "NAME"=>_("Profile") ,       "KZL"=> "P",  "VAR"=>"ShowProfiles"),
            "FAItemplate"        => array("IMG"=> "images/fai_template.png",       "NAME"=>_("Templates") ,     "KZL"=> "T",  "VAR"=>"ShowTemplates"));
 
 
     /* Dynamic action col, depending on snapshot icons */
-    $action_col_size = 120;
+    $action_col_size = 130;
 #   if($this->parent->snapshotEnabled()){
 #     $action_col_size += 32;
 #   }
@@ -251,21 +234,18 @@ class divListFai extends MultiSelectWindow
        $ui = get_userinfo();
        $action ="";
        $acl_all = $ui->has_complete_category_acls($this->parent->fai_base,$this->module);
-       if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){
-         $action .= "<input class='center' type='image'
-           src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
-         $action.= "<input class='center' type='image'
-           src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
-       }
+
+       /* 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']."&amp;edit_freeze_entry=%KEY%' title='%TITLE%'>%NAME%</a>";
-         $action.=  "<input class='center' type='image' src='images/edit.png'  alt='"._("edit")."'
+         $action.=  "<input class='center' type='image' src='images/lists/edit.png'  alt='"._("edit")."'
            name='entry_freeze_edit_%KEY%' title='"._("Edit class")."'>";
          $action.=  "<img src='images/lists/locked.png' alt='F' class='center'>";
        }else{
          $editlink ="<a href='?plug=".$_GET['plug']."&amp;edit_entry=%KEY%' title='%TITLE%'>%NAME%</a>";
-         $action.= "<input class='center' type='image' src='images/edit.png'  alt='"._("edit")."'
+         $action.= "<input class='center' type='image' src='images/lists/edit.png'  alt='"._("edit")."'
            name='entry_edit_%KEY%' title='"._("Edit class")."'>";
          if(preg_match("/d/",$value['acl'])){
            $action.= "<input class='center' type='image' src='images/lists/trash.png' alt='"._("delete")."'
@@ -273,6 +253,8 @@ class divListFai extends MultiSelectWindow
          }
        }
 
+#      $action.= $this->parent->get_snapshot_action($val['dn'],$this->module);
+
        /* Cutted objects should be displayed in light grey */
        $display = $value['cn'].$desc;
        if($this->parent->CopyPasteHandler){