X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=a85a04c97f4c46e013e7f92f3bd7238a83d9ad92;hb=6dfed41229968f525c2c2b1a1582bdb8554c28fe;hp=7994b33153117f2a4a817d319c21bf57dac5458c;hpb=88c38b26e8ac27d3e7de78a0a7bc904994f0bed4;p=mirrors%2FSokoMan.git
diff --git a/index.php b/index.php
index 7994b33..a85a04c 100755
--- a/index.php
+++ b/index.php
@@ -1,7 +1,7 @@
";
- $html.="
";
+ $html.="
";
$td = $type == 'thead' ? 'th' : 'td';
- foreach($row as $var) {
+ foreach($row as $id => $var) {
+ $tdclass = " class='cell_$id'";
if(trim($var) == '') $var = ' ';
- $html.="<$td>$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') {
+ 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_classes_field]) ? $row[$row_classes_field] : '';
+ unset($row[$row_classes_field]);
if($header) {
- $html.=$this->row(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);
+ $html.=$this->row($row,false,$class.$params,'',$colspan,$rowspan,$break_after);
$even = !$even;
}
$html.='
';
@@ -72,16 +87,29 @@ class HTML {
return "".$title."";
}
- function img($src='#void', $title='img', $options='width=64') {
+ function img($src='#void', $title='img', $options='height=64') {
+ if(isset($_GET['noimgs'])) return "".basename($src).'';
$options = $options ? " $options" : '';
return "";
}
- function img_link($src, $link='#void', $title='img_link', $internal=true, $translate=true, $options='width=64') {
+ function img_link($src, $link='#void', $title='img_link', $internal=true, $translate=true, $options='height=64') {
return $this->link($this->img($src,$title,$options),$link,$internal,$translate);
}
+ function textarea($name=false, $value='', $placeholder=false, $options=false, $prefix='') {
+ $html = T($prefix)."