33 protected $headers = FALSE;
40 protected $height =
'200px';
47 $this->s_summary =
'';
48 $this->a_entries = [];
61 $this->height = $h.
'px';
74 $this->a_entries[] = $a_entriedata;
84 $this->headers = $headers;
93 $s_return .=
'<div style="border:1px solid rgb(170,170,170);padding-right:1px;height:'.$this->height.
';width:100%">'.
"\n";
94 $s_return .=
'<div style="overflow:auto; width:100%; height:100%;">'.
"\n";
95 $s_return .=
'<table '.
96 'class="listingTable" '.
97 'id="'.$this->id.
'" '.
98 'style="overflow:scroll; '.
105 $s_return .=
'</table></div></div>';
106 if ($this->headers !== FALSE) {
109 var sorter'.$this->id.
' = tsorter.create(\''.$this->
id.
'\');
120 function setSummary ($msg) 122 $this->s_summary = $msg; 128 protected function generatePage () 131 if ($this->headers !== FALSE) { 132 $display .= '<thead><tr>
'; 133 foreach ($this->headers as $header) { 134 if ($header === '') { 137 $display .= '<th>
'.$header.'</th>
'; 139 $display .= '</tr></thead>
'."\n"; 141 return $display.'<tbody>
'.$this->generateBody().'</tbody>
'; 147 protected function generateBody () 149 /* If divselectbox is empty, append a single white entry */ 150 if (count($this->a_entries) == 0) { 152 if ($this->headers !== FALSE) { 153 $this->cols = count($this->headers); 155 for ($i = 0; $i < ($this->cols); $i++) { 156 if ($i >= ($this->cols - 1)) { 157 $str .= '<td style=
"height:100%;border:0px;"> </td>
'; 159 $str .= '<td style=
"height:100%;"> </td>
'; 164 $str .= '<tr><td style=
"height:100%; border-right:0px;"> </td></tr>
'; 170 $i = count($this->a_entries); 171 foreach ($this->a_entries as $s_value) { 174 $s_return .= "\n<tr>"; 178 $this->cols = count($s_value); 179 foreach ($s_value as $s_value2) { 182 if (!isset($s_value2['class'])) { 185 $class = "class='".$s_value2['class']."'"; 188 if (!isset($s_value2['attach
'])) { 191 $style = " ".$s_value2['attach
']." "; 194 $s_return .= "\n<td".$style.$class.">"; 195 if (isset($s_value2['string'])) { 196 if ($s_value2['string'] === '') { 197 $s_return .= '
'; 199 $s_return .= htmlescape($s_value2['string']); 202 $s_return .= $s_value2['html
']; 204 $s_return .= '</td>
'; 206 $s_return .= "\n</tr>"; 208 $s_return .= "\n<tr>"; 209 for ($i = 0; $i < ($this->cols); $i++) { 210 if ($i >= ($this->cols - 1)) { 211 $s_return .= '<td style=
"height:100%;border:0px;"><div style=
"font-size:1px;"> </div></td>
'; 213 $s_return .= '<td style=
"height:100%;"><div style=
"font-size:1px;"> </div></td>
'; 216 $s_return .= '</tr>
'; generatePage()
Generate the page.
setHeight($h)
Set new height value.
__construct($id)
Default divSelectBox constructor.
setHeaders($headers)
Set column headers.
addEntry($a_entriedata)
Add an entry.
This class contains all the functions to manage select box.