Html->link($name, "/addon/$addon", $attributes);
return $this->output($link);
}
function addonBrowse($tag="", $attributes="", $name="") {
if (empty($name)) {
$link = $this->Html->link($tag, "/browse/" . $tag, $attributes);
}
else {
$link = $this->Html->link($name, "/browse/" . $tag, $attributes);
}
return $this->output($link);
}
/**
* Make an email link that displays the real email by javascript
* including noscript fallback for spam protection.
* Relies on emailLink from addons.js.
*
* @param string Email address to link to
* @param string js_id (Unique) Javascript ID for the email field
* @param sting spanclass CSS class to give to email string
*/
function email($email = '', $js_id = '', $spanclass = 'email') {
if (!$email) return false;
if (!$js_id) $js_id = md5($email); // ugly but unique.
$noscriptemail = str_replace(array('@', '.'), array(' at ', ' dot '), $email);
// unsanitize and re-encode email so html entities are not shown in plain text by javascript code
$email = addslashes($this->Html->unsanitize($email));
$emailparts = explode('@', $email, 2);
$o = ''.$noscriptemail."\n"
. "\n";
return $this->output($o);
}
}
?>