$GLOBALS, title for alt in img-tag for konqueror, file and option for a_href

This commit is contained in:
Ralf Becker 2001-10-03 18:34:47 +00:00
parent 4306c4da7b
commit cb316d7cde

View File

@ -15,6 +15,15 @@
class html
{
var $prefered_img_title;
function html()
{
global $HTTP_USER_AGENT;
// should be Ok for all HTML 4 compatible browsers
$this->prefered_img_title = stristr($HTTP_USER_AGENT,'konqueror') ? 'title' : 'alt';
}
function input_hidden($vars,$value='')
{
if (!is_array($vars))
@ -42,7 +51,6 @@ class html
*/
function link($url,$vars='')
{
global $phpgw;
if (is_array( $vars ))
{
$v = array( );
@ -59,7 +67,7 @@ class html
if ($v)
$vars .= ($vars ? '&' : '') . $v;
return $phpgw->link($url,$vars);
return $GLOBALS['phpgw']->link($url,$vars);
}
function checkbox($name,$value='')
@ -67,6 +75,11 @@ class html
return "<input type=\"checkbox\" name=\"$name\" value=\"True\"" .($value ? ' checked' : '') . ">\n";
}
function file($name)
{
return "<input type=\"file\" name=\"$name\">\n";
}
function form($content,$hidden_vars,$url,$url_vars='',$method='POST')
{
$html = "<form method=\"$method\" action=\"".$this->link($url,$url_vars)."\">\n";
@ -124,15 +137,13 @@ class html
return $html;
}
function image( $app,$name,$alt='',$opts='' )
function image( $app,$name,$title='',$opts='' )
{
global $phpgw;
$html = '<img src="'.$GLOBALS['phpgw']->common->image($app,$name).'"';
$html = '<img src="'.$phpgw->common->image($app,$name).'"';
if ($alt)
if ($title)
{
$html .= ' alt="'.$alt.'"';
$html .= " $this->prefered_img_title=\"$title\"";
}
if ($opts)
{
@ -141,9 +152,9 @@ class html
return $html . '>';
}
function a_href( $content,$url,$vars='')
function a_href( $content,$url,$vars='',$options='')
{
return '<a href="'.$this->link($url,$vars).'">'.$content.'</a>';
return '<a href="'.$this->link($url,$vars).'" '.$options.'>'.$content.'</a>';
}
function bold($content)