X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;ds=sidebyside;f=index.php;h=479e75cf9ff0a43010091226ff8cc217e4510d97;hb=7f332543a7931f488b1a123ffc055c99ddeaf7e6;hp=db9e514f7d129b11f98af87188bbe0286dbd8ae1;hpb=81ab8aef27da2a93a06296fd3b80cdba3376d956;p=mirrors%2FSokoMan.git
diff --git a/index.php b/index.php
index db9e514..479e75c 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,13 +34,17 @@ require_once('Barcode.class.php');
* @author Tomas Mudrunka
*/
class HTML {
- function row($row) {
- $html='
';
+ function row($row,$type=false) {
+ $html = '';
+ if($type) $html.="<$type>";
+ $html.='
';
+ $td = $type == 'thead' ? 'th' : 'td';
foreach($row as $var) {
if(trim($var) == '') $var = ' ';
- $html.="$var | ";
+ $html.="<$td>$var$td>";
}
$html.='
';
+ if($type) $html.="$type>";
return $html;
}
@@ -49,7 +53,7 @@ class HTML {
$header=true;
foreach($table as $row) {
if($header) {
- $html.=$this->row(array_keys($row));
+ $html.=$this->row(array_keys($row),'thead');
$header=false;
}
$html.=$this->row($row);
@@ -69,6 +73,10 @@ class HTML {
return "";
}
+ 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)."$html";
}
+
+ function head($title=false,$charset='UTF-8',$more='') {
+ $title = $title ? "\n$title" : '';
+ $html= '';
+ $html.= ''.$title.$more;
+ $html.= '';
+ return $html;
+ }
}
/**
@@ -139,22 +155,32 @@ class HTML {
* @author Tomas Mudrunka
*/
class Sklad_HTML extends HTML { //TODO: Split into few more methods
- function header($title='') {
+ function header($title='', $user=array()) {
$home = URL_HOME;
$script = $_SERVER['SCRIPT_NAME'];
$search = htmlspecialchars(@trim($_GET['q']));
- $message = strip_tags(@trim($_GET['message']),'');
+ $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 = <<
-
- SÅkoMan$title
-
-
+
+ $html = $this->head("SÅkoMan$title");
+ $html .= <<SÅkoMan$instance$title
+
+ Logged in as $user_name [UID: $user_id; GID: $user_gid]
+ Page loaded at $time
+