X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=67f38433d2d94180567ac6d3767feaae392471d0;hb=56ca207aa1d1e5b2b52fdf7c5db97a22b69f01e1;hp=d6eb6606dcfea5dbeb0da7a966a0aa109eac4783;hpb=32e14fd3604d676e7281c123cc44582a02e929cf;p=mirrors%2FSokoMan.git
diff --git a/index.php b/index.php
index d6eb660..67f3843 100755
--- a/index.php
+++ b/index.php
@@ -1,7 +1,7 @@
";
$html.="
";
$td = $type == 'thead' ? 'th' : 'td';
foreach($row as $id => $var) {
$tdclass = " class='cell_$id'";
if(trim($var) == '') $var = ' ';
- $html.="<$td$tdclass>$var$td>";
+ $rs = isset($rowspan[$id]) ? " rowspan='$rowspan[$id]'" : '';
+ $cs = isset($colspan[$id]) ? " colspan='$colspan[$id]'" : '';
+ $html.="<$td$rs$cs$tdclass title='$id'>$var$td>";
+ if(in_array($id,$break_after,true)) $html.='
'."";
}
$html.='
';
if($type) $html.="$type>";
return $html;
}
- function table(&$table, $parity_class=array('tr_odd','tr_even'), $params='border=1', $row_params_field='_row_parameters') {
+ function table(&$table,$colspan=array(),$rowspan=array(),$break_after=array(),$orderby=false,$parity_class=array('tr_odd','tr_even'),$params='border=1',$row_classes_field='_row_classes') {
$html="";
$header=true;
$even=false;
foreach($table as $row) {
- $params = isset($row[$row_params_field]) ? $row[$row_params_field] : '';
- unset($row[$row_params_field]);
+ $params = isset($row[$row_classes_field]) ? $row[$row_classes_field] : '';
+ unset($row[$row_classes_field]);
if($header) {
- $html.=$this->row(T(array_keys($row)),'thead');
+ $keys = array(); foreach($row as $key => $val) {
+ $order= $orderby ? ' '.
+ $this->link('↑', $orderby."[$key]=ASC").
+ $this->link('↓', $orderby."[$key]=DESC") : '';
+ $keys[$key]=T($key).$order;
+ }
+ $html.=$this->row($keys,'thead',false,'',$colspan,$rowspan,$break_after);
$header=false;
}
$class = $parity_class ? $parity_class[$even] : false;
- $html.=$this->row($row,false,$class.$params);
+ $html.=$this->row($row,false,$class.$params,'',$colspan,$rowspan,$break_after);
$even = !$even;
}
$html.='
';
@@ -77,6 +88,7 @@ class HTML {
}
function img($src='#void', $title='img', $options='height=64') {
+ if(isset($_GET['noimgs'])) return "".basename($src).'';
$options = $options ? " $options" : '';
return "";
}
@@ -96,6 +108,8 @@ class HTML {
function input($name=false, $value=false, $type='text', $placeholder=false, $options=false, $prefix='') {
if($type == 'textarea') return $this->textarea($name, $value, $placeholder, $options, $prefix);
+ if($type == 'select') return $this->select($name, $placeholder, $value, $prefix);
+ //select(vendor, $selectbox ,false, prefix:);
$html = T($prefix)."'); print_r($selectbox);
- $html = "