X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=d4c3cb3c5e151873f8282a4554465f8aa8ae07c6;hb=98f4d4120541dd9e7b9026a993afcdf055d93217;hp=b10f8f1963157600ccfd9f32fe96a4d1c3deae18;hpb=9c310625219086c9dc5896d7bc1f40a0f86586df;p=mirrors%2FSokoMan.git
diff --git a/index.php b/index.php
index b10f8f1..d4c3cb3 100755
--- a/index.php
+++ b/index.php
@@ -24,6 +24,7 @@ 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,32 +35,40 @@ require_once('Barcode.class.php');
* @author Tomas Mudrunka
*/
class HTML {
- function row($row,$type=false,$class=false) {
+ function row($row,$type=false,$class=false,$parameters='',$colspan=array(),$rowspan=array(),$break_after=array()) {
$html = '';
- $class = $class ? $class=" class='$class' " : '';
+ $class_br = $class ? " class='$class' " : '';
+ $class = $class ? " class='$class tr_nobr' " : '';
if($type) $html.="<$type>";
- $html.="
";
+ $html.="
";
$td = $type == 'thead' ? 'th' : 'td';
- foreach($row as $var) {
+ foreach($row as $id => $var) {
+ $tdclass = " class='cell_$id'";
if(trim($var) == '') $var = ' ';
- $html.="<$td>$var$td>";
+ $rs = isset($rowspan[$id]) ? " rowspan='$rowspan[$id]'" : '';
+ $cs = isset($colspan[$id]) ? " colspan='$colspan[$id]'" : '';
+ $html.="<$td$rs$cs$tdclass>$var$td>";
+ if(in_array($id,$break_after,true)) $html.='
'."";
}
$html.='
';
if($type) $html.="$type>";
return $html;
}
- function table(&$table, $parity_class=array('tr_odd','tr_even'), $params='border=1') {
+ function table(&$table,$colspan=array(),$rowspan=array(),$break_after=array(),$parity_class=array('tr_odd','tr_even'),$params='border=1',$row_classes_field='_row_classes') {
$html="";
$header=true;
$even=false;
foreach($table as $row) {
+ $params = isset($row[$row_classes_field]) ? $row[$row_classes_field] : '';
+ unset($row[$row_classes_field]);
if($header) {
- $html.=$this->row(array_keys($row),'thead');
+ $keys = array(); foreach($row as $key => $val) $keys[$key]=$key;
+ $html.=$this->row(T($keys),'thead',false,'',$colspan,$rowspan,$break_after);
$header=false;
}
$class = $parity_class ? $parity_class[$even] : false;
- $html.=$this->row($row,false,$class);
+ $html.=$this->row($row,false,$class.$params,'',$colspan,$rowspan,$break_after);
$even = !$even;
}
$html.='
';
@@ -72,12 +81,13 @@ class HTML {
return "".$title."";
}
- function img($src='#void', $title='img', $options='width=64') {
+ function img($src='#void', $title='img', $options='height=64') {
+ if(isset($_GET['noimgs'])) return "".basename($src).'';
$options = $options ? " $options" : '';
return "";
}
- function img_link($src, $link='#void', $title='img_link', $internal=true, $translate=true, $options='width=64') {
+ function img_link($src, $link='#void', $title='img_link', $internal=true, $translate=true, $options='height=64') {
return $this->link($this->img($src,$title,$options),$link,$internal,$translate);
}
@@ -118,13 +128,13 @@ class HTML {
//echo(''); print_r($selectbox);
$html = "";
return $html;
@@ -175,12 +185,12 @@ class HTML {
* @author Tomas Mudrunka
*/
class Sklad_HTML extends HTML { //TODO: Split into few more methods
- function header($title='', $user=array()) {
+ function header($title='', $user=array(), $headerhtml) {
$home = URL_HOME;
$script = $_SERVER['SCRIPT_NAME'];
$search = htmlspecialchars(@trim($_GET['q']));
$message = strip_tags(@trim($_GET['message']),'
');
- $fortune = 'test';
+ $fortune = fortune();
$instance = INSTANCE_ID != '' ? '/'.INSTANCE_ID : '';
$user_id = htmlspecialchars($user['id']);
$user_gid = htmlspecialchars($user['gid']);
@@ -198,11 +208,23 @@ class Sklad_HTML extends HTML { //TODO: Split into few more methods