From 614ea31e390c14ecb87206d319b01c23cfadbc51 Mon Sep 17 00:00:00 2001 From: janw Date: Fri, 4 Nov 2005 14:40:10 +0000 Subject: [PATCH] fixed style git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1836 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_divlist.inc | 126 +++++++++--------- .../class_applicationManagement.inc | 8 +- .../class_departmentManagement.inc | 6 +- .../admin/groups/class_groupManagement.inc | 10 +- .../admin/ogroups/class_ogroupManagement.inc | 4 +- .../admin/systems/class_systemManagement.inc | 6 +- plugins/admin/users/class_userManagement.inc | 10 +- 7 files changed, 87 insertions(+), 83 deletions(-) diff --git a/include/class_divlist.inc b/include/class_divlist.inc index 65fc872f2..f6bc8f9e9 100644 --- a/include/class_divlist.inc +++ b/include/class_divlist.inc @@ -48,23 +48,26 @@ class divlist { } function DrawList(){ - $s_return = ""; - - $s_return.= ""; - + $s_return.= "
"; if($this->i_entriesPerPage==0) { - - $s_return.= "".$this->_generateHeader().""; - - // Define an alternate style for IE - $s_return.= ""; - - $s_return.= "".$this->_generatePage().""; + // TODO: Find a more convenient way to use the same functionality in both + // MSIE and non-MSIE browsers. ATM we need to manually set entriesPerPage to + // a non-zero value, because MSIE won't scroll the tbody properly. + if(strpos($_SERVER['HTTP_USER_AGENT'],'MSIE') == 0){ + $s_return.= "".$this->_generateHeader().""; + // Define an alternate style for IE (not used ATM) + // $s_return.= ""; + $s_return.= "".$this->_generatePage().""; + } else { + // Call ourself with i_entriesPerPage set to a default value + $this->SetEntriesPerPage(20); + $s_return.=$this->_generateHeader(); + $s_return.=$this->_generatePage(); + } } else { - $s_return.=$this->_generateHeader(); - - $s_return.=$this->_generatePage(); + $s_return.=$this->_generateHeader(); + $s_return.=$this->_generatePage(); } //$s_return.= nl2br(htmlentities($this->_generatePage())); @@ -102,9 +105,9 @@ class divlist { if(!isset($s_value['attach'])){ $s_value['attach'] = ""; } - + if($i_count == 0) { - $s_return .= "\n"; + $s_return .= "\n"; } else { $s_return .= "\n"; } @@ -113,7 +116,7 @@ class divlist { // Only create additional column if we're using scrollbars if($this->i_entriesPerPage==0) { - $s_return .= ""; + $s_return .= "\n"; } $s_return .= "\n"; return $s_return; @@ -214,58 +217,59 @@ class divlist { } } else { // We should display all entries on one page - foreach($this->a_entries as $s_key => $s_value){ - - if($i_alternate){ + + $i = $this->_numEntries(); + foreach($this->a_entries as $s_key => $s_value){ + $i--; + + if($i_alternate!=0){ $i_alternate=0; } else { $i_alternate=1; } - + $s_return .= "\n"; - - $cnt = 0; - - foreach($s_value as $s_key2 => $s_value2 ){ - - $this->cols = count($s_value) ; - $cnt++; - - if(!isset($s_value2['class'])){ - $class = "list".$i_alternate; - } else { - $class = $s_value2['class']; - } - - if(!isset($s_value2['attach'])){ - $style = ""; - } else { - $style = " ".$s_value2['attach']." " ; - } - - $s_return .= "\n"; - } - - if($cnt == 0 ){ - $s_return.="\n"; - } else { - //$s_return.="\n"; - } - $s_return .= "\n"; - } + + $cnt = 0; + + foreach($s_value as $s_key2 => $s_value2 ){ + + $this->cols = count($s_value) ; + $cnt++; + + if(!isset($s_value2['class'])){ + $class = "list".$i_alternate; + } else { + $class = $s_value2['class']; + } + + if(!isset($s_value2['attach'])){ + $style = ""; + } else { + $style = " ".$s_value2['attach']." " ; + } + + $s_return .= "\n"; + } + $s_return .= "\n"; + } } - - $fill= ""; - for ($i= 1; $i <= $this->cols; $i++){ - if ($i == $this->cols){ - $fill.= ""; - } else { - $fill.= ""; + + // if fewer than 22 Entries (list not full), print row to fill empty space + if($this->_numEntries()<22){ + $fill= ""; + for ($i= 1; $i <= $this->cols; $i++){ + if ($i == $this->cols){ + $fill.= ""; + } else { + $fill.= ""; + } } + $s_return.="\n$fill"; } - return $s_return."\n$fill"; + return $s_return; } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/applications/class_applicationManagement.inc b/plugins/admin/applications/class_applicationManagement.inc index b72b7e2e9..22e3947ae 100644 --- a/plugins/admin/applications/class_applicationManagement.inc +++ b/plugins/admin/applications/class_applicationManagement.inc @@ -376,9 +376,9 @@ class applicationManagement extends plugin } } - $field1 = array("string" => "department"); + $field1 = array("string" => "department","attach"=>"style='width:20px;text-align:center;'"); $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val)); - $field3 = array("string" => " ","attach"=>"style='text-align:right;border:none'"); + $field3 = array("string" => " ","attach"=>"style='width:48px;text-align:left;border:none'"); $divlist->AddEntry(array($field1,$field2,$field3)); } @@ -391,9 +391,9 @@ class applicationManagement extends plugin }else{ $desc = " - [ ".$val['description'][0]." ]"; } - $field1 = array("string" => sprintf($applimg,$val['dn']),"attach"=>"style='width:20px;align:middle;'"); + $field1 = array("string" => sprintf($applimg,$val['dn']),"attach"=>"style='width:20px;align:center;text-align:center;'"); $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)),"attach"=>$title); - $field3 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='text-align:right;border:none'"); + $field3 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='width:48px;text-align:right;border:none'"); $divlist->AddEntry(array($field1,$field2,$field3)); } diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index 38451b25a..32f1998bd 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -315,9 +315,9 @@ class departmentManagement extends plugin } $title = $this->config->departments[$key]; - $field0 = array("string" => "department","attach"=>"style='width:20px;'"); - $field1 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style='width:516px' title='".$title."'"); - $field2 = array("string" => preg_replace("/%KEY%/", base64_encode($key), $actions),"attach"=>"style='text-align:left;border:none;width:48px;'"); + $field0 = array("string" => "department","attach"=>"style='text-align:center;width:20px;'"); + $field1 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style='text-align:left;' title='".$title."'"); + $field2 = array("string" => preg_replace("/%KEY%/", base64_encode($key), $actions),"attach"=>"style='text-align:right;border:none;width:48px;'"); $divlist->AddEntry( array($field0,$field1,$field2)); diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index b70a38cde..4e21b8bdf 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -409,10 +409,10 @@ class groupManagement extends plugin } - $field1 = array("string" => "department"); + $field1 = array("string" => "department","attach"=>"style='text-align:center;width:20px;'"); $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val)); $field3 = array("string" => " "); - $field4 = array("string" => " ","attach"=>"style='text-align:right;border:none'"); + $field4 = array("string" => " ","attach"=>"style='text-align:right;border:none;width:48px;'"); $divlist->AddEntry(array($field1,$field2,$field3,$field4)); } @@ -437,10 +437,10 @@ class groupManagement extends plugin }else{ $desc = " - [ ".$val['description'][0]." ]"; } - $field1 = array("string" => sprintf($userimg,$val['dn']),"attach"=>"style='width:20px;align:middle;'"); + $field1 = array("string" => sprintf($userimg,$val['dn']),"attach"=>"style='width:20px;text-align:center;'"); $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)),"attach"=>$title); - $field3 = array("string" => $posix." ".$enviro." ".$mail." ".$samba." ".$appl." ".$phone); - $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='text-align:right;border:none;width:32px;'"); + $field3 = array("string" => $posix." ".$enviro." ".$mail." ".$samba." ".$appl." ".$phone,"attach"=>"style='text-align:left;width:136px;'"); + $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='text-align:right;border:none;width:48px;'"); $divlist->AddEntry(array($field1,$field2,$field3,$field4)); } diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index e5f310811..c1f4b3f18 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -416,7 +416,7 @@ name='dep_root' alt='"._("Root")."'> ". $field1 = array("string" => ""._("Department")."","attach"=>"style='text-align:center;width:20px;'"); $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val)); - $field3 = array("string" => " ","attach"=>"style='width:48;'"); + $field3 = array("string" => " ","attach"=>"style='width:136px;'"); $field4 = array("string" => " ","attach"=>"style='width:48px;text-align:left;border:none'"); $divlist->AddEntry(array($field1,$field2,$field3,$field4)); @@ -438,7 +438,7 @@ name='dep_root' alt='"._("Root")."'> ". }else{ $desc = " - [ ".$val['description'][0]." ]"; } - $field1 = array("string" => ""._("Object group").""); + $field1 = array("string" => ""._("Object group")."","attach"=>"style='text-align:center;width:20px;'"); $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)),"attach"=>$title); $field3 = array("string" => $this->convert_list($val)." ".$mail); $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='text-align:right;border:none'"); diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index badbc17d1..968df5ed3 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -610,9 +610,9 @@ class systems extends plugin } } - $field1 = array("string" => "department"); + $field1 = array("string" => "department","attach"=>"style='width:20px;text-align:center;'"); $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val)); - $field3 = array("string" => " ", "attach" => "style='border:none'"); + $field3 = array("string" => " ", "attach" => "style='border:none;width:48px;text-align:right;'"); $divlist->AddEntry(array($field1,$field2,$field3)); } @@ -669,7 +669,7 @@ class systems extends plugin $img=$this->convert_list($val); - $field1 = array("string" => sprintf($img['img'],$val['dn']),"attach"=>"style='width:20px;align:middle;'"); + $field1 = array("string" => sprintf($img['img'],$val['dn']),"attach"=>"style='width:20px;text-align:center;'"); $field2 = array("string" => sprintf($editlink,$key,$display),"attach"=>"title='".$val['dn']."'"); $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action),"attach" => "style='border:none; text-align:right;width:48px'"); $divlist->AddEntry( array($field1,$field2,$field3)); diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index a47597dc1..3035d8514 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -712,10 +712,10 @@ class userManagement extends plugin } } - $field1 = array("string" => "department"); + $field1 = array("string" => "department","attach"=>"style='width:20px;text-align:center;'"); $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val)); $field3 = array("string" => " "); - $field4 = array("string" => " ", "attach" => "style='border:none'"); + $field4 = array("string" => " ", "attach" => "style='width:48px;border:none'"); $divlist->AddEntry(array($field1,$field2,$field3,$field4)); @@ -861,10 +861,10 @@ class userManagement extends plugin } /* Create each field */ - $field1 = array("string" => sprintf($tpl,$val['dn']),"attach"=>"style='width:20px;align:middle;'"); + $field1 = array("string" => sprintf($tpl,$val['dn']),"attach"=>"style='width:20px;text-align:center;'"); $field2 = array("string" => sprintf($editlink,$key,$display).$ip_port,"attach"=>"title='".$val['dn']."'"); - $field3 = array("string" => $usrimg2." ".$posix." ".$enviro." ".$maila." ".$fonac." ".$faxac." ".$samba." ".$s_img_create_from_template, "attach" => "style='width:155px;'"); - $field4 = array("string" => preg_replace("/%KEY%/", "$key", $action),"attach" => "style='border:none; text-align:right;width:48px'"); + $field3 = array("string" => $usrimg2." ".$posix." ".$enviro." ".$maila." ".$fonac." ".$faxac." ".$samba." ".$s_img_create_from_template, "attach" => "style='width:136px;'"); + $field4 = array("string" => preg_replace("/%KEY%/", "$key", $action),"attach" => "style='border:none;text-align:right;width:48px'"); $add = array($field1,$field2,$field3,$field4); -- 2.30.2
".$s_value['string']."".$s_value['string']."".$s_value['string']."  
"; - $s_return .= $s_value2['string']; - $s_return .= "  
"; + $s_return .= $s_value2['string']; + $s_return .= "