mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 08:39:07 +01:00
Added html_link_email and fixed html_link for absolute URLs
This commit is contained in:
parent
9e5b2795fd
commit
15206d9d78
@ -275,11 +275,17 @@ function html_link ($href = NULL, $text = NULL, $return = 0, $encode = 1)
|
||||
###
|
||||
$href = preg_replace ("/%2F/", "/", $href);
|
||||
$text = trim ($text);
|
||||
/*
|
||||
$rstring = "<a href=$href>$text</a>";
|
||||
*/
|
||||
$href = $sep . $href;
|
||||
$address = $phpgw->link ($href);
|
||||
|
||||
/* Auto-detect and don't disturb absolute links */
|
||||
if (!preg_match ("|^http(.{0,1})://|", $href))
|
||||
{
|
||||
$href = $sep . $href;
|
||||
$address = $phpgw->link ($href);
|
||||
}
|
||||
else
|
||||
{
|
||||
$address = $href;
|
||||
}
|
||||
$rstring = "<a href=$address>$text</a>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
@ -313,6 +319,15 @@ function html_table_begin ($width = NULL, $border = NULL, $cellspacing = NULL, $
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_link_email ($address = NULL, $text = NULL, $return = 0, $encode = 1)
|
||||
{
|
||||
if ($encode)
|
||||
$href = string_encode ($href, 1);
|
||||
|
||||
$rstring = "<a href=mailto:$address>$text</a>";
|
||||
return (eor ($rstring, $return));
|
||||
}
|
||||
|
||||
function html_table_end ($return = 0)
|
||||
{
|
||||
$rstring = "</table>";
|
||||
|
Loading…
Reference in New Issue
Block a user