/** * The required files */ require_once(HTML_BASE_COMMON_PATH.'/Html.php'); require_once(HTML_BASE_UTIL_PATH.'/Link.php');
/** * Returns a complete Email Link as HTML * The link may be terminated by a <br /> or surronded by <li> tags * as specified by the $aux parameter * * <code> * <a class="$class" href="mailto:$href" title="$title">$text</a> * Usage: * $link = new Link($text,$href,$class,$title,$aux); * print $link->getHtml(); * Or * EmailLink::display($text,$href,$class,$title,$aux); * </code> * @package base */
class EmailLink extends Link { /** * Constructor * @param String $text The text for the link * @param String $href The url for the link * @param String $class The class of the link * @param String $title The tool tip of the link * @param String $aux Add 'br' or 'li' html tags, if required */ function EmailLink($text,$href,$class='',$title='',$aux='') { $mailto = 'mailto:'; $strHttp = 'http:/'.'/'; $strHttps = 'https:/'.'/'; if (strpos($href,$strHttp) !==false || strpos($href,$strHttps)!==false) { $mailto = ''; } $this->Link($text,$mailto.$href,$class,$title,$aux); }
/** * Display an email link * <code> * Usage: * EmailLink::display($text,$href,$class,$title,$aux); * </code> * @static * @param String $text The text for the link * @param String $href The url for the link * @param String $class The css class of the link * @param String $title The tool tip of the link * @param String $aux Add 'br' or 'li' html tags, if required */ function display($text,$href,$class='',$title='',$aux='') { $html = new EmailLink($text,$href,$class,$title,$aux); $html->addHtml(); } } ?>