X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=ad309f03ad493cd2387485e16bb62dc3d015a851;hb=ecdaa8cd1cac91037dcb953b6826a86f1bc585a8;hp=9ed67813974e1e65a410f59f77f92598666e51ec;hpb=ba30732d25e053969770906594528d46eb4bb9b0;p=mirrors%2FSokoMan.git diff --git a/index.php b/index.php index 9ed6781..ad309f0 100755 --- a/index.php +++ b/index.php @@ -1,7 +1,7 @@ "; - $tr=""; - $html.=$tr; + $html.=""; $td = $type == 'thead' ? 'th' : 'td'; foreach($row as $id => $var) { $tdclass = " class='cell_$id'"; if(trim($var) == '') $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.=''.$tr; + $html.="<$td$rs$cs$tdclass title='$id'>$var"; + 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_classes_field='_row_classes') { + 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; @@ -63,8 +64,13 @@ class HTML { $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,'',$colspan,$rowspan,$break_after); + $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; @@ -82,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 "$title"; } @@ -101,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 = ""; 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 +193,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 +216,24 @@ class Sklad_HTML extends HTML { //TODO: Split into few more methods