X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=db9921d1960afb4b9d6b7f14adb23b29ae01c7fa;hb=e9f6461f24218e72efea648c5f8c23159ca0f909;hp=ec062faa29d7c65b0884ed76a1b54c2abd90aebc;hpb=35916247a3b7ed49d0dc758ebdf76cf636763d2c;p=mirrors%2FSokoMan.git
diff --git a/index.php b/index.php
index ec062fa..db9921d 100755
--- a/index.php
+++ b/index.php
@@ -20,9 +20,10 @@
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');
/**
* Trida poskytuje vseobecne funkce pro generovani HTML kodu
@@ -33,13 +34,17 @@ require_once('Locale.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;
}
@@ -48,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);
@@ -57,13 +62,15 @@ class HTML {
return $html;
}
- function link($title='n/a', $link='#void', $internal=true) {
+ function link($title='n/a', $link='#void', $internal=true, $translate=true) {
if($internal && (!isset($link[0]) || $link[0] != '#')) $link = $this->internal_url($link);
- return "".T($title)."";
+ if($translate) $title = T($title);
+ return "".$title."";
}
- function img($src='#void', $title='img') {
- return "";
+ function img($src='#void', $title='img', $options='width=64') {
+ $options = $options ? " $options" : '';
+ return "";
}
function input($name=false, $value=false, $type='text', $placeholder=false, $options=false, $prefix='') {
@@ -125,6 +132,14 @@ class HTML {
$options = $options ? " $options" : '';
return "$html
";
}
+
+ function head($title=false,$charset='UTF-8',$more='') {
+ $title = $title ? "\n$title" : '';
+ $html= '';
+ $html.= ''.$title.$more;
+ $html.= '';
+ return $html;
+ }
}
/**
@@ -136,22 +151,28 @@ 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']),'');
$instance = INSTANCE_ID != '' ? '/'.INSTANCE_ID : '';
+ $user_id = htmlspecialchars($user['id']);
+ $user_gid = htmlspecialchars($user['gid']);
+ $user_name = htmlspecialchars($user['name']);
//$title = T($title); //TODO
- $html = <<
-
- SÅkoMan$title
-
-
+
+ $html = $this->head("SÅkoMan$title");
+ $html .= <<SÅkoMan$instance$title
+Loged in as $user_name [UID: $user_id; GID: $user_gid]