| 1 |
cvsjoko |
1.1 |
<? |
| 2 |
|
|
|
| 3 |
|
|
class HtmlGui_Table { |
| 4 |
|
|
|
| 5 |
|
|
var $config; |
| 6 |
|
|
|
| 7 |
|
|
var $columns; |
| 8 |
|
|
var $columns_list; |
| 9 |
|
|
var $rows; |
| 10 |
|
|
|
| 11 |
|
|
var $bool_paging; |
| 12 |
|
|
var $bool_controlbox; |
| 13 |
|
|
|
| 14 |
|
|
var $controls; |
| 15 |
|
|
|
| 16 |
|
|
function HtmlGui_Table($args = array()) { |
| 17 |
|
|
$this->config = $args; |
| 18 |
|
|
$this->columns = array(); |
| 19 |
|
|
$this->columns_list = array(); |
| 20 |
|
|
$this->rows = array(); |
| 21 |
|
|
|
| 22 |
|
|
$this->bool_paging = 0; |
| 23 |
|
|
$this->bool_controlbox = 0; |
| 24 |
|
|
|
| 25 |
|
|
$this->controls = array('pagenumber' => '', 'pagesize' => '', 'sortcolumn' => '', 'sortorder' => ''); |
| 26 |
|
|
|
| 27 |
|
|
$this->_initControls(); |
| 28 |
|
|
|
| 29 |
|
|
} |
| 30 |
|
|
|
| 31 |
|
|
|
| 32 |
|
|
function _initControls() { |
| 33 |
|
|
global $lvpn, $lvsc, $lvso; |
| 34 |
|
|
$this->controls['pagenumber'] = $lvpn; |
| 35 |
|
|
$this->controls['pagesize'] = 12; |
| 36 |
|
|
$this->controls['sortcolumn'] = $lvsc; |
| 37 |
|
|
$this->controls['sortorder'] = $lvso; |
| 38 |
|
|
} |
| 39 |
|
|
|
| 40 |
|
|
function addColumn($name, $caption = '', $htmlattribs = array()) { |
| 41 |
|
|
$this->columns[$name] = array('name' => $name, 'caption' => $caption, 'htmlattribs' => $htmlattribs); |
| 42 |
|
|
array_push($this->columns_list, $name); |
| 43 |
|
|
} |
| 44 |
|
|
|
| 45 |
|
|
function addRow($row) { |
| 46 |
|
|
array_push($this->rows, $row); |
| 47 |
|
|
} |
| 48 |
|
|
|
| 49 |
|
|
function enableControlBox() { |
| 50 |
|
|
$this->bool_controlbox = 1; |
| 51 |
|
|
} |
| 52 |
|
|
|
| 53 |
|
|
function enablePaging() { |
| 54 |
|
|
$this->bool_paging = 1; |
| 55 |
|
|
} |
| 56 |
|
|
|
| 57 |
|
|
function getControlValue($type) { |
| 58 |
|
|
if (isset($this->controls[$type])) { |
| 59 |
|
|
return $this->controls[$type]; |
| 60 |
|
|
} |
| 61 |
|
|
} |
| 62 |
|
|
|
| 63 |
|
|
|
| 64 |
|
|
|
| 65 |
|
|
function render() { |
| 66 |
|
|
|
| 67 |
|
|
global $tracking; |
| 68 |
|
|
|
| 69 |
|
|
$pn = $this->controls['pagenumber']; |
| 70 |
|
|
|
| 71 |
|
|
$link_args = ''; |
| 72 |
|
|
|
| 73 |
|
|
// other link-args ;) |
| 74 |
|
|
global $conflictview, $sysmsg, $msgtype, $workflow; |
| 75 |
|
|
$link_args .= "conflictview=$conflictview&sysmsg=$sysmsg&msgtype=$msgtype&workflow=$workflow"; |
| 76 |
|
|
|
| 77 |
|
|
|
| 78 |
|
|
$retval = ""; |
| 79 |
|
|
|
| 80 |
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - |
| 81 |
|
|
// table-header |
| 82 |
|
|
|
| 83 |
|
|
isset($this->config['header']['bgimg']) && ($header_bgimg = $this->config['header']['bgimg']); |
| 84 |
|
|
|
| 85 |
|
|
//$retval .= '<table background="' . $header_bgimg . '" border="0" cellspacing=0 cellpadding=3 width="750" align="center" style="border:1px solid #555555;border-bottom:0px;">'; |
| 86 |
|
|
$retval .= '<table background="' . $header_bgimg . '" border="0" cellspacing="0" cellpadding="1" width="100%" >' . "\n"; |
| 87 |
|
|
$retval .= '<tr><td>'; |
| 88 |
|
|
|
| 89 |
|
|
$retval .= ' |
| 90 |
|
|
<table border="0" width="600" cellspacing="0" cellpadding="0"> |
| 91 |
|
|
<tr> |
| 92 |
|
|
'; |
| 93 |
|
|
|
| 94 |
|
|
$td_htmlattribs_header_must = array('class' => 'txt11b', 'valign' => 'top', 'height' => 28, 'bgcolor' => '', 'align' => 'left'); |
| 95 |
|
|
|
| 96 |
|
|
reset($this->columns_list); |
| 97 |
|
|
while($item = current($this->columns_list)) { |
| 98 |
|
|
$column = $this->columns[$item]; |
| 99 |
|
|
$td_htmlattribs_header = $column['htmlattribs']; |
| 100 |
|
|
$td_htmlattribs_header = array_merge($td_htmlattribs_header, $td_htmlattribs_header_must); |
| 101 |
|
|
//$retval .= getHtmlTag('td', $column['htmlattribs']) . $column['caption'] . getHtmlTag('td', Null, 1) . "\n"; |
| 102 |
|
|
|
| 103 |
|
|
$caption = $column['caption']; |
| 104 |
|
|
|
| 105 |
|
|
$td_innerHtml = ' '; |
| 106 |
|
|
if ($caption) { |
| 107 |
|
|
|
| 108 |
|
|
$so = $this->getControlValue("sortorder"); |
| 109 |
|
|
if ($item == $this->getControlValue("sortcolumn")) { |
| 110 |
|
|
$so = !$so; |
| 111 |
|
|
} |
| 112 |
|
|
|
| 113 |
|
|
$td_innerHtml = |
| 114 |
|
|
$tracking->getLink_ByArgs( array('virtualpage' => 'document.list.entries', 'order_col' => $arg_order_col, 'order_desc' => $arg_order_desc, 'innerHTML' => '<img src="../img/icons/infocsort.gif" width="16" height="12" border="0">', 'target' => 'page_listview', 'title' => $title, 'html_class' => '')) |
| 115 |
|
|
. |
| 116 |
|
|
//$tracking->getLink_ByArgs( array('virtualpage' => 'document.list.entries', 'order_col' => $arg_order_col, 'order_desc' => $arg_order_desc, 'caption' => $caption, 'target' => 'page_listview', 'title' => $title, 'html_class' => 'acontentb')) |
| 117 |
|
|
//$tracking->getLink_ByArgs( array('virtualpage' => 'document.list.entries', 'order_col' => $arg_order_col, 'order_desc' => $arg_order_desc, 'caption' => $caption, 'target' => 'page_listview', 'title' => $title, 'html_class' => 'acontentb')) |
| 118 |
|
|
"<a href=\"?$link_args&lvpn=$pn&lvsc=$item&lvso=$so\" class=\"acontentb\">$caption</a>" |
| 119 |
|
|
; |
| 120 |
|
|
} |
| 121 |
|
|
|
| 122 |
|
|
$retval .= "\n" . getHtmlTag('td', $td_htmlattribs_header) . $td_innerHtml . "\n" . getHtmlTag('td', Null, 1) . "\n"; |
| 123 |
|
|
next($this->columns_list); |
| 124 |
|
|
} |
| 125 |
|
|
$retval .= "\n" . '</tr></table>'; |
| 126 |
|
|
|
| 127 |
|
|
$retval .= "\n" . '</td></tr>'; |
| 128 |
|
|
$retval .= "\n" . '</table>' . "\n"; |
| 129 |
|
|
|
| 130 |
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - |
| 131 |
|
|
// table-rows |
| 132 |
|
|
//$retval .= '<table border="0" cellspacing=0 cellpadding=3 width="750" align="center" style="border:1px solid #555555;">'; |
| 133 |
|
|
//$retval .= '<table border="0" cellspacing=0 cellpadding=3 width="100%" style="border:1px solid #555555;">'; |
| 134 |
|
|
|
| 135 |
|
|
reset($this->rows); |
| 136 |
|
|
while($row = current($this->rows)) { |
| 137 |
|
|
$retval .= ' |
| 138 |
|
|
<!-- entry - begin --> |
| 139 |
|
|
<table border="0" width="602" cellspacing="0" cellpadding="1" style="border-width:0px; border-style:solid; borderlight-color:#474890;"> |
| 140 |
|
|
<tr><td bgcolor="#474890"> |
| 141 |
|
|
<table border="0" width="600" cellspacing="0" cellpadding="0" align="right"> |
| 142 |
|
|
<tr> |
| 143 |
|
|
'; |
| 144 |
|
|
reset($this->columns_list); |
| 145 |
|
|
while($item = current($this->columns_list)) { |
| 146 |
|
|
$column = $this->columns[$item]; |
| 147 |
|
|
$retval .= getHtmlTag('td', $column['htmlattribs']) . $row[$column['name']] . getHtmlTag('td', Null, 1) . "\n"; |
| 148 |
|
|
next($this->columns_list); |
| 149 |
|
|
} |
| 150 |
|
|
$retval .= ' |
| 151 |
|
|
</tr> |
| 152 |
|
|
</table> |
| 153 |
|
|
</td></tr> |
| 154 |
|
|
</table> |
| 155 |
|
|
|
| 156 |
|
|
<table border="0" width="602"> |
| 157 |
|
|
<tr><td height="0"></td></tr> |
| 158 |
|
|
</table> |
| 159 |
|
|
<!-- entry - end --> |
| 160 |
|
|
|
| 161 |
|
|
|
| 162 |
|
|
'; |
| 163 |
|
|
next($this->rows); |
| 164 |
|
|
} |
| 165 |
|
|
|
| 166 |
|
|
//$retval .= "</table>\n"; |
| 167 |
|
|
|
| 168 |
|
|
print $retval; |
| 169 |
|
|
|
| 170 |
|
|
?> |
| 171 |
|
|
<table border="0" width="602" cellspacing="0" cellpadding="1" style="border-width:0px; border-style:solid; borderlight-color:#474890;"> |
| 172 |
|
|
<tr><td bgcolor="#474890"> |
| 173 |
|
|
<? |
| 174 |
|
|
|
| 175 |
|
|
if ($this->bool_controlbox) { |
| 176 |
|
|
|
| 177 |
|
|
?> |
| 178 |
|
|
<table border="0" width="600" cellspacing="0" cellpadding="0" align="right"> |
| 179 |
|
|
<tr> |
| 180 |
|
|
<td height=18 Class=txt11b bgcolor=#474890 width=18> |
| 181 |
|
|
<a target="wmContent" href="?di=155&vp=document.list&bp=1"><img name="newUser" src="../img/icons/new_i.gif" width=19 height=19 Border=0 Alt="Neuer User" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('newUser','','../img/icons/new_a.gif',1)"></a></td> |
| 182 |
|
|
<td width=50%><a class="acontentwb" target="wmContent" href="javascript:document.forms[0].submit();">Neuen User anlegen</a> </td> |
| 183 |
|
|
|
| 184 |
|
|
<td height=18 Class=txt11b bgcolor=#474890 width=18> |
| 185 |
|
|
<a target="wmContent" href="?di=155&vp=document.list&bp=1"><img name="editUser" src="../img/icons/save1_i.gif" width=19 height=19 Border=0 Alt="Änderungen speichern" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('editUser','','../img/icons/save1_a.gif',1)"></a></td> |
| 186 |
|
|
<td width=50%><input type=text></td> |
| 187 |
|
|
|
| 188 |
|
|
|
| 189 |
|
|
</tr> |
| 190 |
|
|
</table> |
| 191 |
|
|
<? |
| 192 |
|
|
|
| 193 |
|
|
} |
| 194 |
|
|
|
| 195 |
|
|
|
| 196 |
|
|
?> |
| 197 |
|
|
</td></tr> |
| 198 |
|
|
|
| 199 |
|
|
<tr><td bgcolor="#474890" style="padding-top:0px;"> |
| 200 |
|
|
<? |
| 201 |
|
|
|
| 202 |
|
|
if ($this->bool_paging) { |
| 203 |
|
|
|
| 204 |
|
|
$pn_l = $pn - 1; |
| 205 |
|
|
$pn_r = $pn + 1; |
| 206 |
|
|
|
| 207 |
|
|
?> |
| 208 |
|
|
<table border="0" width="100%" cellspacing="0" celladding="0" align="center"> |
| 209 |
|
|
<tr><td bgcolor=#DADADA> |
| 210 |
|
|
<table border="0" width="100" cellspacing="0" celladding="0" align="center"> |
| 211 |
|
|
<tr> |
| 212 |
|
|
<td height="18" class="txtMain" bgcolor="#DADADA" width="20" align="center"><a class="acontentwb" title=" zurückblättern auf Seite <?= $pn_l ?> " href="?lvpn=<?= $pn_l ?>&<?= $link_args ?>"><img src="../img/icons/arrowwb.gif" width="9" height="18" border="0"></a></td> |
| 213 |
|
|
|
| 214 |
|
|
<? |
| 215 |
|
|
for($i = 1; $i <= 30; $i++) { |
| 216 |
|
|
|
| 217 |
|
|
if ($pn == $i) { |
| 218 |
|
|
?><td class="txt11r" bgcolor=#DADADA width=10><?= $i ?></td><? |
| 219 |
|
|
} else { |
| 220 |
|
|
?><td class="txtName" bgcolor=#DADADA width=10><a class="acontentb" title=" auf Seite <?= $i ?> springen " href="?lvpn=<?= $i ?>&<?= $link_args ?>"><?= $i ?></a></td><? |
| 221 |
|
|
} |
| 222 |
|
|
|
| 223 |
|
|
} |
| 224 |
|
|
?> |
| 225 |
|
|
|
| 226 |
|
|
<td height="18" Class="txtMain" bgcolor="#DADADA" width="20" align="center"><a class="acontentwb" title=" vorblättern auf Seite <?= $pn_r ?> " href="?lvpn=<?= $pn_r ?>&<?= $link_args ?>"><img src="../img/icons/arroww.gif" width="9" height="18" border="0"></a></td> |
| 227 |
|
|
</tr> |
| 228 |
|
|
</table> |
| 229 |
|
|
</td></tr> |
| 230 |
|
|
</table> |
| 231 |
|
|
<? |
| 232 |
|
|
|
| 233 |
|
|
} |
| 234 |
|
|
|
| 235 |
|
|
?> |
| 236 |
|
|
</td> |
| 237 |
|
|
|
| 238 |
|
|
</tr> |
| 239 |
|
|
</table> |
| 240 |
|
|
<? |
| 241 |
|
|
|
| 242 |
|
|
//return $retval; |
| 243 |
|
|
|
| 244 |
|
|
} |
| 245 |
|
|
|
| 246 |
|
|
} |
| 247 |
|
|
|
| 248 |
|
|
?> |