X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_divlist.inc;h=a3ecfb8d5ed2f5f7ef04e1afe34b04e43a008166;hb=6a92bb7d9fd721ce354110985dd9008536e1a118;hp=5448a87828cd776193939caa7f2cc7c84668f800;hpb=78f23bb8423d0a8fc8dcbd8a06fea5c34806c146;p=gosa.git diff --git a/include/class_divlist.inc b/include/class_divlist.inc index 5448a8782..a3ecfb8d5 100644 --- a/include/class_divlist.inc +++ b/include/class_divlist.inc @@ -5,20 +5,25 @@ class divlist { var $a_entries; var $a_header; var $b_displayPageNums; - var $summary; + var $s_summary; var $cols; var $pageid; + //FIXME: Ignoring the fact, that they were missing - height and width are numeric... + var $s_height; + var $s_width; // Members for page managment var $i_currentPage; var $i_entriesPerPage; + var $force_height = false; + // Added php 4 constructor function divlist($pageid){ $this->i_currentPage = 0; $this->i_entriesPerPage = 10; - $this->s_height = "500"; + $this->s_height = "450"; $this->s_width = "600"; $this->s_summary = ""; $this->a_entries = array(); @@ -46,6 +51,7 @@ class divlist { function SetHeight($s_height) { $this->s_height= $s_height; + $this->force_height = true; } function SetWidth($s_width) { @@ -58,7 +64,15 @@ class divlist { function DrawList(){ $s_return = ""; - $s_return.= ""; + if(!$this->force_height){ + $s_return.= "
"; + } else { + $s_return.= "
"; + } $s_return.= $this->_generateHeader(); $s_return.=$this->_generatePage(); @@ -71,30 +85,33 @@ class divlist { function _numpages(){ $cnt = count($this->a_entries); - $tmp = $cnt % $this->i_entriesPerPage; $pages = (int) ($cnt / $this->i_entriesPerPage); - if($tmp) $pages ++; + if($cnt % $this->i_entriesPerPage){ + $pages++; + } return $pages; } function _numentries(){ - $cnt = count($this->a_entries); - return $cnt; + return count($this->a_entries); } function _generateHeader(){ - $s_return = ""; $s_value = ""; $s_key = ""; // Using scrolltable? if($this->i_entriesPerPage == 0) { - $s_return .= "\n
"; + if(!$this->force_height) { + $s_return.= "\n"; } - $s_return .= "\n"; + $s_return.= "\n"; return $s_return; } @@ -131,8 +148,13 @@ class divlist { if($this->i_entriesPerPage == 0) { // We need to construct a "body"-table that is width-of-scrollbar thinner than the "head"-table. - $s_return .= "\n
"; + } else { + $s_return.= "\n"; + $s_return.= "\n"; + $s_return.= "\n
"; + } } - $s_return .= "\n"; + $s_return.= "\n"; foreach($this->a_header[0] as $s_key => $s_value ){ if(!isset($s_value['attach'])){ @@ -111,11 +128,11 @@ class divlist { // Attach a 13px-wide column (used as scrollbar space in body-table), // but do this only if we are really using scrolltables. if($this->i_entriesPerPage == 0) { - $s_return .= "\n"; - $s_return .= "\n
 
 
"; - $s_return .= ""; + if(!$this->force_height) { + $s_return .= "\n
"; + $s_return .= ""; + } else { + $s_return .= "\n"; } @@ -290,5 +314,6 @@ class divlist { } } } + // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>
"; + $s_return .= ""; + } } $i_alternate=0; @@ -158,6 +180,7 @@ class divlist { return($str); } else { + //FIXME: Ahrg. I'd like to read this code without wasting my time. if ($this->i_entriesPerPage > 0) { while($start > $this->_numentries()){ $start = $start - $this->i_entriesPerPage; @@ -271,7 +294,8 @@ class divlist { } // if fewer than 22 Entries (list not full), print row to fill empty space - if($this->_numEntries()<=22){ + //FIXME: Why 22? Isn't the size dynamic +# if($this->_numEntries()<=22){ $fill= ""; for ($i= 1; $i <= $this->cols; $i++){ if ($i == $this->cols){ @@ -279,9 +303,9 @@ class divlist { } else { $fill.= ""; } - } + } $s_return.="\n$fill"; - } +# } if($this->i_entriesPerPage == 0) { $s_return .= "\n