X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=95d4a59f9f414280d7162aaf4bbf28b6b7dc47be;hb=5704f2946df7ebb0a038c1c359d2c64c3ea63f0e;hp=ec062faa29d7c65b0884ed76a1b54c2abd90aebc;hpb=35916247a3b7ed49d0dc758ebdf76cf636763d2c;p=mirrors%2FSokoMan.git
diff --git a/index.php b/index.php
index ec062fa..95d4a59 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,40 +34,64 @@ require_once('Locale.class.php');
* @author Tomas Mudrunka
*/
class HTML {
- function row($row) {
- $html='
';
+ function row($row,$type=false,$class=false) {
+ $html = '';
+ $class = $class ? $class=" class='$class' " : '';
+ 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;
}
- 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));
+ $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;
}
- 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 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 textarea($name=false, $value='', $placeholder=false, $options=false, $prefix='') {
+ $html = T($prefix)."