From f4809414d16528a53a4a231b79ebbdfe179a715f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 1 Jul 2001 21:32:12 +0000 Subject: [PATCH] a lot new function which saves writing html in php-files: tables,forms,... --- infolog/inc/class.html.inc.php | 65 ++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/infolog/inc/class.html.inc.php b/infolog/inc/class.html.inc.php index d6f03309b5..f53eaad4d8 100644 --- a/infolog/inc/class.html.inc.php +++ b/infolog/inc/class.html.inc.php @@ -59,12 +59,71 @@ class html return "\n"; } - function form_1button($name,$lang,$hidden_vars,$url,$url_vars='',$method='POST') + function form($content,$hidden_vars,$url,$url_vars='',$method='POST') { $html = "
link($url,$url_vars)."\">\n"; $html .= $this->input_hidden($hidden_vars); - $html .= $this->submit_button($name,$lang); - $html .= "
\n"; + + if ($content) { + $html .= $content; + $html .= "\n"; + } return $html; } + + function form_1button($name,$lang,$hidden_vars,$url,$url_vars='',$method='POST') + { + return $this->form($this->submit_button($name,$lang), + $hidden_vars,$url,$url_vars,$method); + } + + /* + * Example: $rows = array ( '1' => array( 1 => 'cell1', '.1' => 'colspan=3', + * 2 => 'cell2', + * 3 => '3,, '.3' => 'width="10%"' ), + * '.1' => 'bgcolor="#0000FF"' ); + * table($rows,'width="100%"'); + */ + function table($rows,$params = '') + { + $html = "\n"; + + while (list($key,$row) = each($rows)) { + if (!is_array($row)) + continue; // parameter + $html .= "\t\n"; + while (list($key,$cell) = each($row)) { + if ($key[0] == '.') + continue; // parameter + $html .= "\t\t\n"; + } + $html .= "\t\n"; + } + $html .= "
$cell
\n"; + + return $html; + } + + function sbox_submit( $sbox,$no_script=0 ) + { + $html = str_replace('submit_button('send','>').''; + } + return $html; + } + + function image( $app,$name,$alt='',$opts='' ) + { + global $phpgw; + + $html = ''; + } + function a_href( $content,$url,$vars='') { + return ''.$content.''; + } }