X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=02aa5252b21644ec018d8950ece2b365574d7289;hb=049a7400bfbbf97a3f5a430bed36668c069db589;hp=5c54331a1e53f5144f62b6da2eb544a8047c613b;hpb=933b760a1a2f81a454fd894950a80868b1ebd5de;p=mirrors%2FSokoMan.git diff --git a/index.php b/index.php index 5c54331..02aa525 100755 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ require_once('sklad.conf.php'); set_include_path(DIR_LIB.PATH_SEPARATOR.get_include_path()); -require_once('Sklad_LMS-fake.class.php'); +require_once('Sklad_Auth.class/common.php'); require_once('HTTP_Auth.class.php'); require_once('Locale.class.php'); require_once('Barcode.class.php'); @@ -34,10 +34,11 @@ require_once('Barcode.class.php'); * @author Tomas Mudrunka */ class HTML { - function row($row,$type=false) { + function row($row,$type=false,$class=false) { $html = ''; + $class = $class ? $class=" class='$class' " : ''; if($type) $html.="<$type>"; - $html.=''; + $html.=""; $td = $type == 'thead' ? 'th' : 'td'; foreach($row as $var) { if(trim($var) == '') $var = ' '; @@ -48,15 +49,18 @@ class HTML { return $html; } - function table(&$table, $params='border=1') { + function table(&$table, $parity_class=array('tr_odd','tr_even'), $params='border=1') { $html=""; $header=true; + $even=false; foreach($table as $row) { if($header) { $html.=$this->row(array_keys($row),'thead'); $header=false; } - $html.=$this->row($row); + $class = $parity_class ? $parity_class[$even] : false; + $html.=$this->row($row,false,$class); + $even = !$even; } $html.='
'; return $html; @@ -73,6 +77,10 @@ class HTML { return "$title"; } + function img_link($src, $link='#void', $title='img_link', $internal=true, $translate=true, $options='width=64') { + return $this->link($this->img($src,$title,$options),$link,$internal,$translate); + } + function input($name=false, $value=false, $type='text', $placeholder=false, $options=false, $prefix='') { $html = T($prefix)."'); + $message = strip_tags(@trim($_GET['message']),'
'); $instance = INSTANCE_ID != '' ? '/'.INSTANCE_ID : ''; + $user_id = htmlspecialchars($user['id']); + $user_gid = htmlspecialchars($user['gid']); + $user_name = htmlspecialchars($user['name']); + $time = date('r'); //$title = T($title); //TODO $html = $this->head("SōkoMan$title"); $html .= <<
SōkoMan$instance$title +

SōkoMan$instance$title

+
+ Logged in as $user_name [UID: $user_id; GID: $user_gid]
+ Page loaded at $time +