From e2f16660c2ac670c3927d1d2118f139e50990849 Mon Sep 17 00:00:00 2001 From: janw Date: Fri, 28 Oct 2005 15:09:41 +0000 Subject: [PATCH] Updated layout. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1750 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/include/focus.js | 8 + include/class_divlist.inc | 214 +++++++++++------- .../admin/systems/class_systemManagement.inc | 2 +- 3 files changed, 141 insertions(+), 83 deletions(-) diff --git a/html/include/focus.js b/html/include/focus.js index 9144c7c94..0924e26b7 100644 --- a/html/include/focus.js +++ b/html/include/focus.js @@ -44,6 +44,9 @@ function keyPress(DnEvents) { } else { return true; } + // Check for konqueror + } else if(document.clientWidth) { + // do nothing ATM } else { if(window.event.srcElement.type == 'textarea') { return true; @@ -71,6 +74,9 @@ function keyPress(DnEvents) { document.getElementById(DnEvents.target.id).value+="\t"; return false; } + // Check for konqueror + } else if(document.clientWidth) { + // do nothing ATM } else { if(window.event.srcElement.type == 'textarea') { document.getElementById(window.event.srcElement.id).value+="\t"; @@ -177,3 +183,5 @@ function popup(target, name) { function js_check(form) { form.javascript.value = 'true'; } + +// vim:ts=2:syntax diff --git a/include/class_divlist.inc b/include/class_divlist.inc index 4349664aa..887e8419b 100644 --- a/include/class_divlist.inc +++ b/include/class_divlist.inc @@ -52,10 +52,10 @@ class divlist { $s_return = ""; $s_return.= ""; - - $s_return.= $this->_generateHeader(); - - $s_return.= $this->_generatePage(); + + $s_return.= "".$this->_generateHeader().""; + + $s_return.= "".$this->_generatePage().""; //$s_return.= nl2br(htmlentities($this->_generatePage())); $s_return.= "
"; @@ -86,23 +86,31 @@ class divlist { $s_key = ""; $s_return .= "\n"; + + $i_count = count($this->a_header[0])-1; foreach($this->a_header[0] as $s_key => $s_value ){ if(!isset($s_value['attach'])){ $s_value['attach'] = ""; } - $s_return .= "\n".$s_value['string'].""; + if($i_count == 0) { + $s_return .= "\n".$s_value['string'].""; + } else { + $s_return .= "\n".$s_value['string'].""; + } + $i_count--; } + $s_return .= " "; $s_return .= "\n"; return $s_return; } - function SetSummary($msg){ + function SetSummary($msg){ $this->s_summary = $msg; } - function _generatePage(){ + function _generatePage(){ $s_value = ""; $s_key = ""; @@ -113,86 +121,128 @@ class divlist { if(isset($_GET['start'])){ $_SESSION['start'.$this->pageid]=$_GET['start']; $start = $_GET['start']; - }else{ + } else { if(isset($_SESSION['start'.$this->pageid])){ $start = $_SESSION['start'.$this->pageid]; - }else{ + } else { $start=0; } } - while($start > $this->_numentries()){ - $start = $start - $this->i_entriesPerPage; - } - - $stop = $start + $this->i_entriesPerPage; - - $appendempty = ($this->_numentries() -$start); - - for($i = $start ; $i < $stop;$i++){ - - if(isset($this->a_entries[$i])){ - - $s_value = $this->a_entries[$i]; - - - if($i_alternate) $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"; - $s_return .= $s_value2['string']; - $s_return .= "\n"; - } - if($cnt == 0 ){ - $s_return.=" "; - } - $s_return .= "\n"; - } - } - - if(!(($stop)<$this->_numentries())){ - $nums = $stop - $this->_numentries();// - $stop; - for($i = 0 ; $i < $nums ; $i ++ ){ - $s_return.=""; - $cnt=0; - for($a = 0 ; $a < (count($this->a_header[0])) ; $a ++ ) { - if($a ==(count($this->a_header[0])-1)){ - $s_return.="  "; - }else{ - $s_return.="  "; - } - } - $s_return.=""; - } - } - - if($this->b_displayPageNums){ - $s_return .= "".range_selector($this->_numentries(),$start,$this->i_entriesPerPage).""; - } - - return $s_return; - } - - + if ($this->i_entriesPerPage > 0) { + while($start > $this->_numentries()){ + $start = $start - $this->i_entriesPerPage; + } + + $stop = $start + $this->i_entriesPerPage; + + $appendempty = ($this->_numentries() -$start); + + for($i = $start ; $i < $stop;$i++){ + + if(isset($this->a_entries[$i])){ + + $s_value = $this->a_entries[$i]; + + + if($i_alternate) $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"; + $s_return .= $s_value2['string']; + $s_return .= "\n"; + } + if($cnt == 0 ){ + $s_return.=" "; + } + $s_return .= "\n"; + } + } + + if(!(($stop)<$this->_numentries())){ + $nums = $stop - $this->_numentries();// - $stop; + for($i = 0 ; $i < $nums ; $i ++ ){ + $s_return.=""; + $cnt=0; + for($a = 0 ; $a < (count($this->a_header[0])) ; $a ++ ) { + if($a ==(count($this->a_header[0])-1)){ + $s_return.="  "; + } else { + $s_return.="  "; + } + } + $s_return.=""; + } + } + + if($this->b_displayPageNums){ + $s_return .= "".range_selector($this->_numentries(),$start,$this->i_entriesPerPage).""; + } + } else { + // We should display all entries on one page + foreach($this->a_entries as $s_key => $s_value){ + + if($i_alternate){ + $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"; + $s_return .= $s_value2['string']; + $s_return .= "\n"; + } + + if($cnt == 0 ){ + $s_return.=" "; + } + $s_return .= "\n"; + } + } + + return $s_return; + } } +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 2e19c9cdb..c6aa4fa05 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -588,7 +588,7 @@ class systems extends plugin $divlist->SetSummary(_("This table displays all systems, in the selected tree.")); - $divlist->SetEntriesPerPage(20); + $divlist->SetEntriesPerPage(0); // Defining Links $linkopen = "%s"; -- 2.30.2