Code

Udpated mime acls
[gosa.git] / plugins / admin / systems / class_divListSystem.inc
index 27c6456d9b231ecb37be7b21af29faea5b96da35..fe125e2aa7090e760c6afafae5d23041836084b5 100644 (file)
@@ -29,7 +29,7 @@ class divListSystem extends MultiSelectWindow
   function divListSystem ($config,$parent)
   {
     MultiSelectWindow::MultiSelectWindow($config,"System");
-    
+
     $this->parent       = $parent;
     $this->ui           = get_userinfo();
 
@@ -42,15 +42,21 @@ class divListSystem extends MultiSelectWindow
     $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);
-  
+
     /* Disable buttonsm */
     $this->EnableCloseButton(false);
     $this->EnableSaveButton (false);
 
+    /* Dynamic action col, depending on snapshot icons */
+    $action_col_size = 50;
+    if($this->parent->snapshotEnabled()){
+      $action_col_size += 38;
+    }
+
     /* set Page header */
     $this->AddHeader(array("string"=>" ","attach"=>"style='width:20px;'"));
     $this->AddHeader(array("string"=>_("System / Department")));
-    $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:60px;border-right:0px;'"));
+    $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);
@@ -84,31 +90,32 @@ class divListSystem extends MultiSelectWindow
       }
     }
     $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
-    " <input class='center' type='image' src='images/list_root.png' align='middle'
-        title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'>&nbsp;".
-    " <input class='center' type='image' align='middle' src='images/list_back.png'
-        title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'>&nbsp;".
-    " <input class='center' type='image' align='middle' src='images/list_home.png'
-        title='"._("Go to users department")."' alt='"._("Home")."'                     name='dep_home'>&nbsp;".
-    " <input class='center' type='image' src='images/list_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;".
-    " <input class='center' type='image' align='middle' src='images/select_new_terminal.png'
-        name='newsystem_terminal'    alt='"._("New Terminal template")."' title='"._("New Terminal")."'>".
-    " <input class='center' type='image' align='middle' src='images/select_new_workstation.png'
-        name='newsystem_workstation' alt='"._("New Workstation template")."' title='"._("New Workstation")."'>".
-    " <input class='center' type='image' align='middle' src='images/select_new_server.png'     name='newsystem_server'      alt='"._("New Server")."'
-        title='"._("New Server")."'>".
-    " <input class='center' type='image' align='middle' src='images/select_new_printer.png'    name='newsystem_printer'     alt='"._("New Printer")."'
-        title='"._("New Printer")."'>".
-    " <input class='center' type='image' align='middle' src='images/select_new_phone.png'      name='newsystem_phone'       alt='"._("New Phone")."'
-        title='"._("New Phone")."'>".
-    " <input class='center' type='image' align='middle' src='images/select_new_component.png'  name='newsystem_component'   alt='"._("New Component")."'
-        title='"._("New Component")."'>".
-    " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;"._("Base")."&nbsp;".
-    " <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
-    " <input class='center' type='image' src='images/list_submit.png' align='middle'
-        title='"._("Submit department")."' name='submit_department' alt='".           _("Submit")."'>&nbsp;".
-    "</div>";
+      " <input class='center' type='image' src='images/list_root.png' align='middle'
+      title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'>&nbsp;".
+      " <input class='center' type='image' align='middle' src='images/list_back.png'
+      title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'>&nbsp;".
+      " <input class='center' type='image' align='middle' src='images/list_home.png'
+      title='"._("Go to users department")."' alt='"._("Home")."'                     name='dep_home'>&nbsp;".
+      " <input class='center' type='image' src='images/list_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;";
+    $listhead .= $this->get_snapshot_header($this->selectedBase);
+    $listhead .= " <input class='center' type='image' align='middle' src='images/select_new_terminal.png'
+      name='newsystem_terminal'    alt='"._("New Terminal template")."' title='"._("New Terminal")."'>".
+      " <input class='center' type='image' align='middle' src='images/select_new_workstation.png'
+      name='newsystem_workstation' alt='"._("New Workstation template")."' title='"._("New Workstation")."'>".
+      " <input class='center' type='image' align='middle' src='images/select_new_server.png'     name='newsystem_server'      alt='"._("New Server")."'
+      title='"._("New Server")."'>".
+      " <input class='center' type='image' align='middle' src='images/select_new_printer.png'    name='newsystem_printer'     alt='"._("New Printer")."'
+      title='"._("New Printer")."'>".
+      " <input class='center' type='image' align='middle' src='images/select_new_phone.png'      name='newsystem_phone'       alt='"._("New Phone")."'
+      title='"._("New Phone")."'>".
+      " <input class='center' type='image' align='middle' src='images/select_new_component.png'  name='newsystem_component'   alt='"._("New Component")."'
+      title='"._("New Component")."'>".
+      " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;"._("Base")."&nbsp;".
+      " <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
+      " <input class='center' type='image' src='images/list_submit.png' align='middle'
+      title='"._("Submit department")."' name='submit_department' alt='".           _("Submit")."'>&nbsp;".
+      "</div>";
     $this->SetListHeader($listhead);
   }
 
@@ -118,6 +125,7 @@ class divListSystem extends MultiSelectWindow
     $this->GenHeader();
   }
 
+
   function setEntries($terminals)
   {
     $img1  = "<img class='center' src='images/printer.png'            alt='C' title='"._("Cups Server")  ."'>";
@@ -132,15 +140,23 @@ class divListSystem extends MultiSelectWindow
     $img10 = "<img class='center' src='images/save.png'               alt='L' title='"._("Ldap Server") ."'>";
 
     $empty    ="&nbsp;";
-    $action= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'     name='user_edit_%KEY%' title='"._("Edit system")."'>";
-    $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete system")."'>";
+
+    /* Dynamic action col, depending on snapshot icons */
+    $action_col_size = 50;
+    if($this->parent->snapshotEnabled()){
+      $action_col_size += 38;
+    }
 
     // User and Template  Images
     $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
 
     // Test Every Entry and generate divlist Array
     foreach($terminals as $key => $val){
+
+      $action= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'     name='user_edit_%KEY%' title='"._("Edit system")."'>";
+      $action.= $this->GetSnapShotActions($val['dn']);
+      $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete system")."'>";
+
       /* Generate picture list, which is currently disabled */
       if(in_array("goCupsServer"    ,$val['objectClass'])) $cups    = $img1;   else $cups  =$empty;
       if(in_array("goLogDBServer"   ,$val['objectClass'])) $logdb   = $img2;   else $logdb =$empty;
@@ -152,17 +168,21 @@ class divListSystem extends MultiSelectWindow
       if(in_array("goFonServer"     ,$val['objectClass'])) $fon     = $img8;   else $fon   =$empty;
       if(in_array("goFaxServer"     ,$val['objectClass'])) $fax     = $img9;   else $fax   =$empty;
       if(in_array("goLdapServer"    ,$val['objectClass'])) $ldap     = $img10;   else $ldap   =$empty;
-      
+
       $pics = $cups.$logdb.$syslog.$imap.$samba.$nfs.$krb.$fon.$fax.$ldap;
       $pics = ""; // Pictures currently hidden
 
       $val['cn'][0]= preg_replace('/\$$/', '', $val['cn'][0]);
 
       // Generate Array to Add
+      $dsc= "";
+      if (isset($val['description'][0])){
+        $dsc= " [".$val['description'][0]."]";
+      }
       if((isset($val['is_new']))&&(!empty($val['is_new']))){
-        $display= "".$val["cn"][0]." ".$val['is_new'];
+        $display= $val["cn"][0]." ".$val['is_new'].$dsc;
       }else{
-        $display= "".$val["cn"][0]."";
+        $display= $val["cn"][0].$dsc;
       }
 
       if((in_array("gotoTerminal",$val['objectClass']))||(in_array("gotoWorkstation",$val['objectClass']))){
@@ -177,22 +197,26 @@ class divListSystem extends MultiSelectWindow
 
       $img    = $this->parent->convert_list($val);
       $field1 = array("string" => sprintf($img['img'],$val['dn']), "attach" => "style='text-align:center;width:20px;'");
-      $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".@LDAP::fix($val['dn'])."'");
-      $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action), "attach" => "style='width:60px;border-right:0px;text-align:right;'");
+      $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', '&nbsp;', @LDAP::fix($val['dn']))."'");
+      $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
       $this->AddElement( array($field1,$field2,$field3));
     }
 
   }
 
+
   function Save()
   {
     MultiSelectWindow :: Save();  
   }
 
+
   function save_object()
   {
     /* Save automatic created POSTs like regex, checkboxes */
-    MultiSelectWindow :: save_object();   
+    MultiSelectWindow :: save_object();  
+
+
   }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: