X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;ds=sidebyside;f=index.php;h=caf25a0ef3039c92e95f2ea419b87abbc7565589;hb=042a49887f093945b7ef913556e506c30ce2bbda;hp=db9921d1960afb4b9d6b7f14adb23b29ae01c7fa;hpb=e9f6461f24218e72efea648c5f8c23159ca0f909;p=mirrors%2FSokoMan.git
diff --git a/index.php b/index.php
index db9921d..caf25a0 100755
--- a/index.php
+++ b/index.php
@@ -34,10 +34,11 @@ require_once('Barcode.class.php');
* @author Tomas Mudrunka
*/
class HTML {
- function row($row,$type=false) {
+ function row($row,$type=false,$class=false) {
$html = '';
+ $class = $class ? $class=" class='$class' " : '';
if($type) $html.="<$type>";
- $html.='
';
+ $html.="
";
$td = $type == 'thead' ? 'th' : 'td';
foreach($row as $var) {
if(trim($var) == '') $var = ' ';
@@ -48,15 +49,18 @@ class HTML {
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),'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;
@@ -73,7 +77,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)."