Code

Fixed Problem with saving new ACL for a tagged department.
[gosa.git] / gosa-core / include / class_MultiSelectWindow.inc
index 529196e43288dbac7fb185e72787644f3e5b26d9..898916456ffe9f8c27dbb76f5ee67851ce7edd1a 100644 (file)
@@ -1,4 +1,24 @@
 <?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 define ("SEPERATOR", 1002);
 
@@ -39,6 +59,7 @@ class MultiSelectWindow{
   var $module= "";
 
   var $IgnoreAccount = TRUE;
+  var $footer = "";
 
        function ClearElementsList()
        {
@@ -215,32 +236,32 @@ class MultiSelectWindow{
 
     /* Draw root button */
     if($enable_root){
-      $listhead .= " <input class='center' type='image' src='images/list_root.png' align='middle'
+      $listhead .= " <input class='center' type='image' src='images/lists/root.png' align='middle'
         title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'>&nbsp;";
     }else{
-      $listhead .= " <img src='images/list_root_gray.png' class='center' alt='"._("Root")."'>&nbsp;";
+      $listhead .= " <img src='images/lists/root_grey.png' class='center' alt='"._("Root")."'>&nbsp;";
     }
 
     /* Draw back button */
     if($enable_back){
-      $listhead .= " <input class='center' type='image' align='middle' src='images/list_back.png'
+      $listhead .= " <input class='center' type='image' align='middle' src='images/lists/back.png'
         title='"._("Go up one department")."' alt='"._("Up")."'                name='dep_back'>&nbsp;";
     }else{
-      $listhead .= " <img src='images/list_back_gray.png' class='center' alt='"._("Up")."'>&nbsp;";
+      $listhead .= " <img src='images/lists/back_grey.png' class='center' alt='"._("Up")."'>&nbsp;";
     }
 
     /* Draw home button */
     if($enable_home){
-      $listhead .= " <input class='center' type='image' align='middle' src='images/list_home.png'
+      $listhead .= " <input class='center' type='image' align='middle' src='images/lists/home.png'
         title='"._("Go to users department")."' alt='"._("Home")."'            name='dep_home'>&nbsp;";
     }else{
-      $listhead .= " <img src='images/list_home_gray.png' class='center' alt='"._("Home")."'>&nbsp;";
+      $listhead .= " <img src='images/lists/home_grey.png' class='center' alt='"._("Home")."'>&nbsp;";
     }
    
     /* And at least draw reload button, this button is enabled everytime */ 
-    $listhead .=  " <input class='center' type='image' src='images/list_reload.png' align='middle'
+    $listhead .=  " <input class='center' type='image' src='images/lists/reload.png' align='middle'
       title='"._("Reload list")."' name='submit_department' alt='"._("Submit")."'>&nbsp;".
-      " <img   class='center' src='images/list_seperator.png' align='middle' alt='-' height='16' width='1'>&nbsp;";
+      " <img   class='center' src='images/lists/seperator.png' align='middle' alt='-' height='16' width='1'>&nbsp;";
 
     return ($listhead);
   }
@@ -291,6 +312,12 @@ class MultiSelectWindow{
                return($this->is_closed);
        }
 
+  
+  function SetListFooter($str){
+    $this->footer = $str;
+  }
+
+
        /* Enable the close button */
        function EnableCloseButton($bool)
        {
@@ -422,8 +449,7 @@ class MultiSelectWindow{
 
                /* Check for exeeded sizelimit */
                $smarty->assign("hint"                          , print_sizelimit_warning());
-               $smarty->assign("DivList"                       , $divlist->DrawList());
-
+               $smarty->assign("DivList"                       , $divlist->DrawList()."\n\n\n\n\n".$this->footer."\n\n\n\n\n");
 
                if($this->is_headpage){
                        $smarty->assign("tree_image",           get_template_path('images/tree.png'));
@@ -619,20 +645,20 @@ class MultiSelectWindow{
       }
       if($ok){
         if($layer_menu){
-          $str = "..|<img class='center' src='images/restore.png' alt='"._("Restore")."'>&nbsp;"._("Restore")."|RestoreDeletedSnapShot|\n";
+          $str = "..|<img class='center' src='images/lists/restore.png' alt='"._("Restore")."'>&nbsp;"._("Restore")."|RestoreDeletedSnapShot|\n";
         }else{
-          $str = "<input class='center' type='image' align='middle' src='images/restore.png'
+          $str = "<input class='center' type='image' align='middle' src='images/lists/restore.png'
             title='"._("Restore snapshopts of already deleted objects")."' 
             alt='"._("Restore")."' name='RestoreDeletedSnapShot'>&nbsp;"; 
         }
       }else{
         if($layer_menu){
-          $str = "..|<img class='center' src='images/restore_grey.png' alt=''>&nbsp;"._("Restore")."||\n";
+          $str = "..|<img class='center' src='images/lists/restore_grey.png' alt=''>&nbsp;"._("Restore")."||\n";
         }else{
-          $str = "<img class='center' src='images/restore_grey.png' alt=''>&nbsp;";
+          $str = "<img class='center' src='images/lists/restore_grey.png' alt=''>&nbsp;";
         }
       }
-#      $str .= "<img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
+#      $str .= "<img class='center' src='images/lists/seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
     }
     return($str);
   }
@@ -644,10 +670,10 @@ class MultiSelectWindow{
     if($this->parent->snapshotEnabled()){
 
       if(count($this->parent->Available_SnapsShots($dn))){
-        $str.= "<input class='center' type='image' src='images/restore.png'
+        $str.= "<input class='center' type='image' src='images/lists/restore.png'
           alt='"._("Restore snapshot")."' name='RestoreSnapShotDialog_".base64_encode($dn)."' title='"._("Restore snapshot")."'>&nbsp;";
       } else {
-        $str = "<img class='center' src='images/restore_grey.png' alt=''>&nbsp;";
+        $str = "<img class='center' src='images/lists/restore_grey.png' alt=''>&nbsp;";
       }
 
       $str.= "<input class='center' type='image' src='images/snapshot.png'
@@ -718,7 +744,7 @@ class MultiSelectWindow{
                        $nkey= normalizePreg($key);
                        foreach($this->config->departments as $keyd=>$vald ){
                                if(preg_match('/$nkey\/.*/',$keyd)){
-                                       $non_empty="full";
+                                       $non_empty="-full";
                                }
                        }
 
@@ -731,7 +757,7 @@ class MultiSelectWindow{
         }
       }
 
-                       $row[]=$field1=array("string"=>"<img src='images/".$non_empty."folder.png' alt='department'>","attach"=>"style='text-align:center;width:20px;'");
+                       $row[]=$field1=array("string"=>"<img src='images/lists/folder".$non_empty.".png' alt='department'>","attach"=>"style='text-align:center;width:20px;'");
                        $row[]=$field2=array("string"=>sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''");
 
                        if($numtabs > 2){