X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=c7e12e8368c8627bb447642514fc94a15a8ec7e9;hb=80457ef3c29400e0d14524884e3114caf8f926c0;hp=a2423df11502a2f1d3fc6fbe53456338784269e1;hpb=089455c423877b487c5a3cab087136bb4a505984;p=mirrors%2FSokoMan.git
diff --git a/index.php b/index.php
index a2423df..c7e12e8 100755
--- a/index.php
+++ b/index.php
@@ -20,10 +20,11 @@
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');
+require_once('Fortune.php');
/**
* Trida poskytuje vseobecne funkce pro generovani HTML kodu
@@ -34,25 +35,35 @@ require_once('Barcode.class.php');
* @author Tomas Mudrunka
*/
class HTML {
- function row($row) {
- $html='
';
+ function row($row,$type=false,$class=false,$parameters='') {
+ $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', $row_params_field='_row_parameters') {
$html="";
$header=true;
+ $even=false;
foreach($table as $row) {
+ $params = isset($row[$row_params_field]) ? $row[$row_params_field] : '';
+ unset($row[$row_params_field]);
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.$params);
+ $even = !$even;
}
$html.='
';
return $html;
@@ -69,7 +80,21 @@ 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 textarea($name=false, $value='', $placeholder=false, $options=false, $prefix='') {
+ $html = T($prefix)."