From fd487dc150e5b1c4b210ca76a887b9f1a3f603da Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 10 Nov 2005 13:22:09 +0000 Subject: [PATCH] Added Scrollable Listbox, which works in IE Konqueror Firfox git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1906 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_divSelectBox.inc | 143 +++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 include/class_divSelectBox.inc diff --git a/include/class_divSelectBox.inc b/include/class_divSelectBox.inc new file mode 100644 index 000000000..8942e96c9 --- /dev/null +++ b/include/class_divSelectBox.inc @@ -0,0 +1,143 @@ +i_currentPage = 0; + $this->i_entriesPerPage = 10; + $this->s_summary = ""; + $this->a_entries = array(); + $this->a_header = array(); + $this->b_displayPageNums= true; + $this->cols = 0; + + } + + function __destruct(){ + + } + + function setWidth($w){ + $this->width=$w; + } + + function setHeight($h){ + $this->height=$h; + } + + function AddEntry($a_entriedata) { + $this->a_entries[] = $a_entriedata; + } + + function DrawList(){ + $s_return = " +
". + "\n
height."px;width:".($this->width)."px;\">"; + $s_return.= ""; + + $s_return.=$this->_generatePage(); + $s_return.= "
"; + + return ($s_return); + } + + function _numentries(){ + $cnt = count($this->a_entries); + return $cnt; + } + + function SetSummary($msg){ + $this->s_summary = $msg; + } + + function _generatePage(){ + + $s_value = ""; + $s_key = ""; + $s_return = ""; + + $i_alternate=0; + + /* If divlist is empty, append a single white entry */ + if(count($this->a_entries)==0){ + $str = ""; + for($i = 0 ; $i < count($this->a_header[0]); $i++){ + $str.=" "; + } + $str .=""; + return($str); + } + + $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"; + $s_return .= $s_value2['string']; + $s_return .= ""; + } + + } + $s_return.=""; + for($i = 0 ; $i < ($this->cols) ; $i ++){ + if($i >= ($this->cols-1)){ + $s_return .= ""; + }else{ + $s_return .= ""; + } + + } + $s_return.=""; + return $s_return; + } +} +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> -- 2.30.2