X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=d4c3cb3c5e151873f8282a4554465f8aa8ae07c6;hb=98f4d4120541dd9e7b9026a993afcdf055d93217;hp=2b966289da7b34434c2ae00c8efae47344592967;hpb=5a7b0bb6ca024195fb33e68e91fbe2d9ce1dd043;p=mirrors%2FSokoMan.git diff --git a/index.php b/index.php index 2b96628..d4c3cb3 100755 --- a/index.php +++ b/index.php @@ -37,10 +37,10 @@ require_once('Fortune.php'); class HTML { 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>"; - $tr=""; - $html.=$tr; + $html.=""; $td = $type == 'thead' ? 'th' : 'td'; foreach($row as $id => $var) { $tdclass = " class='cell_$id'"; @@ -48,27 +48,27 @@ class HTML { $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.=''.$tr; + if(in_array($id,$break_after,true)) $html.=''.""; } $html.=''; if($type) $html.=""; return $html; } - function table(&$table,$colspan=array(),$rowspan=array(),$break_after=array(),$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) { $keys = array(); foreach($row as $key => $val) $keys[$key]=$key; - $html.=$this->row(T($keys),'thead',false,$params,$colspan,$rowspan,$break_after); + $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,$colspan,$rowspan,$break_after); + $html.=$this->row($row,false,$class.$params,'',$colspan,$rowspan,$break_after); $even = !$even; } $html.='
'; @@ -82,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"; } @@ -129,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; @@ -184,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'])); @@ -207,19 +208,24 @@ class Sklad_HTML extends HTML { //TODO: Split into few more methods