Code

Moved folder images
[gosa.git] / gosa-plugins / systems / admin / systems / class_divListSystem.inc
index 5c5a9703f1d3645423ba58cc61dee0e0bdaadf64..e812730197a419a7454b3e51b43f5b771d7c0500 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
+ */
 
 class divListSystem extends MultiSelectWindow
 {
@@ -44,7 +64,6 @@ class divListSystem extends MultiSelectWindow
 
     /* Result page will look like a headpage */
     $this->SetHeadpageMode();
-    $this->SetInformation(_("This menu allows you to add, remove and change the properties of specific systems. You can only add systems which have already been started once."));
 
     $this->EnableAplhabet   (true);
 
@@ -65,21 +84,35 @@ class divListSystem extends MultiSelectWindow
     /* set Page header */
     $this->AddHeader(array("string"=> $chk,          "attach"=>"style='width:20px;'"));
     $this->AddHeader(array("string"=>"&nbsp;","attach"=>"style='width:20px;'"));
-    $this->AddHeader(array("string"=>_("System / Department")));
+    $this->AddHeader(array("string"=>_("Systems")." / "._("Department")));
     $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:".$action_col_size."px;border-right:0px;'"));
 
     /*                  Text        ,Value    ,Name         ,Is selected */
-    $this->AddCheckBox("ShowServers",         _("Select to see servers"),            _("Show servers"),          true);
-    $this->AddCheckBox("ShowTerminals",       _("Select to see Linux terminals"),    _("Show terminals") ,       true);
-    $this->AddCheckBox("ShowWorkstations",    _("Select to see Linux workstations"), _("Show workstations"),     true);
-    $this->AddCheckBox("ShowWinWorkstations", _("Select to see MicroSoft Windows based workstations"), _("Show windows based workstations"),true);
-    $this->AddCheckBox("ShowPrinters",        _("Select to see network printers"),    _("Show network printers") ,true);
-    $this->AddCheckBox("ShowPhones",          _("Select to see VOIP phones"),         _("Show phones") ,          true);
-    $this->AddCheckBox("ShowDevices",         _("Select to see network devices"),     _("Show network devices"),  true);
+    $this->AddCheckBox("ShowServers",        
+        msgPool::selectToView(  _("servers")),            
+        sprintf(_("Show %s"),   _("servers")),true);
+    $this->AddCheckBox("ShowTerminals",       
+        msgPool::selectToView(  _("Linux terminals")),    
+        sprintf(_("Show %s"),   _("terminals")),true);
+    $this->AddCheckBox("ShowWorkstations",
+        msgPool::selectToView(  _("Linux workstations")), 
+        sprintf(_("Show %s"),   _("workstations")),true);
+    $this->AddCheckBox("ShowWinWorkstations", 
+        msgPool::selectToView(  _("MicroSoft Windows based workstations")), 
+        sprintf(_("Show %s"),   _("windows based workstations")),true);
+    $this->AddCheckBox("ShowPrinters",
+        msgPool::selectToView(  _("network printers")),   
+        sprintf(_("Show %s"),   _("network printers")) ,true);
+    $this->AddCheckBox("ShowPhones",
+        msgPool::selectToView(  _("VoIP phones")),        
+        sprintf(_("Show %s"),   _("phones")) ,true);
+    $this->AddCheckBox("ShowDevices",
+        msgPool::selectToView(  _("network devices")),    
+        sprintf(_("Show %s"),   _("network devices")),  true);
 
     /* Add SubSearch checkbox */
     $this->AddCheckBox(SEPERATOR);
-    $this->AddCheckBox("SubSearch",  _("Select to search within subtrees"), _("Search in subtrees"), false);
+    $this->AddCheckBox("SubSearch",  msgPool::selectToView("","subsearch"), msgPool::selectToView("","subsearch_small"), false);
 
     /*                  Name                 ,Text                              ,Default  , Connect with alphabet  */
     $this->AddRegex   ("Regex",     _("Display systems matching"),"*" , true);
@@ -200,27 +233,28 @@ class divListSystem extends MultiSelectWindow
     }
 
     $events  = DaemonEvent::get_event_types(SYSTEM_EVENT);
+
     $s.= "..|<img src='images/rocket.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Trigger action")."|\n";
-    foreach($events['BY_CLASS'] as $name =>  $event){
+    foreach($events['TRIGGERED'] as $name => $event){
       $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|trigger_event_".$name."\n";
     }
 
     $s.= "..|<img src='images/clock.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Schedule action")."|\n";
-    foreach($events['BY_CLASS'] as $name =>  $event){
+    foreach($events['SCHEDULED'] as $name =>  $event){
       $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|schedule_event_".$name."\n";
     }
 
-    $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
+    $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/editcopy.png' alt='' border='0' class='center'>".
+      $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/editcut.png' alt='' border='0' class='center'>".
+      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
     }
 
@@ -229,10 +263,10 @@ class divListSystem extends MultiSelectWindow
     if(preg_match("/(c.*w|w.*c)/",$all_module_acls) &&  $this->parent->CopyPasteHandler){
       $s .= "..|---|\n";
       if($this->parent->CopyPasteHandler->entries_queued()){
-        $img = "<img border='0' class='center' src='images/editpaste.png' alt=''>";
+        $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/cant_editpaste.png' alt=''>";
+        $img = "<img border='0' class='center' src='images/lists/paste.png' alt=''>";
         $s.="..|".$img."&nbsp;"._("Paste")."\n";
       }
     }
@@ -321,9 +355,9 @@ class divListSystem extends MultiSelectWindow
       $action ="";
       if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
         $action.= "<input class='center' type='image'
-          src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
+          src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
         $action.= "<input class='center' type='image'
-          src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
+          src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
       }
       $action.= "<input class='center' type='image' src='images/edit.png' 
                     alt='"._("edit")."'     name='system_edit_%KEY%' title='"._("Edit system")."'>";
@@ -335,7 +369,7 @@ class divListSystem extends MultiSelectWindow
 
 
       if(preg_match("/d/",$acl)){
-        $action.= "<input class='center' type='image' src='images/edittrash.png' 
+        $action.= "<input class='center' type='image' src='images/lists/trash.png' 
           alt='"._("delete")."'   name='system_del_%KEY%' title='"._("Delete system")."'>";
       }else{
         $action.= $empty;    
@@ -369,22 +403,15 @@ class divListSystem extends MultiSelectWindow
         $display= $val["cn"][0].$dsc;
       }
 
-     
       /* Check if this is a terminal/workstation && if we are allowed to change the gotoRootPasswd */
-      $pwd_acl =""; 
-      if(in_array("gotoWorkstation",$val['objectClass'])){
-        $pwd_acl = $ui->get_permissions($val['dn'],"workstation/workgeneric","gotoRootPasswd");
-      }    
-      if(in_array("gotoTerminal",$val['objectClass'])){
-        $pwd_acl = $ui->get_permissions($val['dn'],"terminal/termgeneric","gotoRootPasswd");
-      }    
-      if(preg_match("/w/",$pwd_acl)){
-        $action2 = "<input class='center' type='image' src='images/certs.png' alt='"._("Password")."'   name='system_setpwd_%KEY%' title='"._("Set root password")."'>";
+      $display_key_for = array("terminal","workstation","server","component");
+      $pwd_acl = $ui->get_permissions($val['dn'],$tabs[$type]['ACL'],"userPassword");
+      if(preg_match("/w/",$pwd_acl) && in_array($type,$display_key_for)){
+        $action2 = "<input class='center' type='image' src='images/lists/key.png' alt='"._("Password")."'   name='system_setpwd_%KEY%' title='"._("Set password")."'>";
       }else{
         $action2 = $empty;
       }
 
-
       if(in_array("gotoWorkstation",$val['objectClass'])){
         $action2= "<input class='center' type='image' src='images/cdrom.png' alt='"._("Create CD")."'   
                       name='gen_cd_%KEY%' title='"._("Create FAI CD")."'>&nbsp;".$action2;
@@ -431,15 +458,15 @@ class divListSystem extends MultiSelectWindow
       $num_deps = count($this->Added_Departments);
     }
 
-    $num_ser_str = _("Number of listed servers");
-    $num_ws_str  = _("Number of listed workstations");
-    $num_ter_str = _("Number of listed terminals");
-    $num_pho_str = _("Number of listed phones");
-    $num_prt_str = _("Number of listed printers");
-    $num_com_str = _("Number of listed network components");
-    $num_new_str = _("Number of listed new devices");
-    $num_wws_str = _("Number of listed windows workstations");
-    $num_dep_str = _("Number of listed departments");
+    $num_ser_str = sprintf(_("Number of listed '%s'"),_("servers"));
+    $num_ws_str  = sprintf(_("Number of listed '%s'"),_("workstations"));
+    $num_ter_str = sprintf(_("Number of listed '%s'"),_("terminals"));
+    $num_pho_str = sprintf(_("Number of listed '%s'"),_("phones"));
+    $num_prt_str = sprintf(_("Number of listed '%s'"),_("printers"));
+    $num_com_str = sprintf(_("Number of listed '%s'"),_("network components"));
+    $num_new_str = sprintf(_("Number of listed '%s'"),_("new devices"));
+    $num_wws_str = sprintf(_("Number of listed '%s'"),_("windows workstations"));
+    $num_dep_str = sprintf(_("Number of listed '%s'"),_("departments"));
 
     $str = "<img class='center' src='images/select_server.png'
       title='".$num_ser_str."' alt='".$num_ser_str."'>&nbsp;".$cnts['server']."&nbsp;&nbsp;&nbsp;&nbsp;";
@@ -457,7 +484,7 @@ class divListSystem extends MultiSelectWindow
       title='".$num_new_str."' alt='".$num_new_str."'>&nbsp;".$cnts['NewDevice']."&nbsp;&nbsp;&nbsp;&nbsp;";
     $str.= "<img class='center' src='images/select_winstation.png'
       title='".$num_wws_str."' alt='".$num_wws_str."'>&nbsp;".$cnts['winstation']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/folder.png'
+    $str.= "<img class='center' src='images/lists/folder.png'
       title='".$num_dep_str."' alt='".$num_dep_str."'>&nbsp;".$num_deps."&nbsp;&nbsp;&nbsp;&nbsp;";
 
     $this->set_List_Bottom_Info($str);