X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=f1744a4a17fe63cb429b2efaa180ee23df26bc74;hb=f3fca77c92e403dfe746a72ab3d24ad326f96de9;hp=d6eb6606dcfea5dbeb0da7a966a0aa109eac4783;hpb=32e14fd3604d676e7281c123cc44582a02e929cf;p=mirrors%2FSokoMan.git diff --git a/index.php b/index.php index d6eb660..f1744a4 100755 --- a/index.php +++ b/index.php @@ -35,35 +35,40 @@ require_once('Fortune.php'); * @author Tomas Mudrunka */ class HTML { - function row($row,$type=false,$class=false,$parameters='') { + function row($row,$type=false,$class=false,$parameters='',$colspan=array(),$rowspan=array(),$break_after=array()) { $html = ''; - $class = $class ? $class=" class='$class' " : ''; + $class_br = $class ? " class='$class' " : ''; + $class = $class ? " class='$class tr_nobr' " : ''; if($type) $html.="<$type>"; $html.=""; $td = $type == 'thead' ? 'th' : 'td'; foreach($row as $id => $var) { $tdclass = " class='cell_$id'"; if(trim($var) == '') $var = ' '; - $html.="<$td$tdclass>$var"; + $rs = isset($rowspan[$id]) ? " rowspan='$rowspan[$id]'" : ''; + $cs = isset($colspan[$id]) ? " colspan='$colspan[$id]'" : ''; + $html.="<$td$rs$cs$tdclass>$var"; + if(in_array($id,$break_after,true)) $html.=''.""; } $html.=''; if($type) $html.=""; 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(),$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) $keys[$key]=$key; + $html.=$this->row(T($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 +82,7 @@ class HTML { } function img($src='#void', $title='img', $options='height=64') { + if(isset($_GET['noimgs'])) return "".basename($src).''; $options = $options ? " $options" : ''; return "$title"; } @@ -124,11 +130,11 @@ class HTML { if(!is_bool($default)) { $value=$default; $title=$selectbox[$value]; - $html .= ""; + $html .= ""; unset($selectbox[$value]); } foreach($selectbox as $value => $title) { - $html .= ""; + $html .= ""; } $html .= ""; return $html; @@ -179,7 +185,7 @@ class HTML { * @author Tomas Mudrunka */ class Sklad_HTML extends HTML { //TODO: Split into few more methods - function header($title='', $user=array()) { + function header($title='', $user=array(), $headerhtml) { $home = URL_HOME; $script = $_SERVER['SCRIPT_NAME']; $search = htmlspecialchars(@trim($_GET['q'])); @@ -202,18 +208,23 @@ class Sklad_HTML extends HTML { //TODO: Split into few more methods