Source for file mailto.php
Documentation is available at mailto.php
* Outputs a mailto link with optional spam-proof (okay probably not) encoding
* * address : target email address
* * text : display text to show for the link, defaults to the address if not provided
* * subject : the email subject
* * encode : one of the available encoding (none, js, jscharcode or hex)
* * cc : address(es) to carbon copy, comma separated
* * bcc : address(es) to blind carbon copy, comma separated
* * newsgroups : newsgroup(s) to post to, comma separated
* * followupto : address(es) to follow up, comma separated
* * extra : additional attributes to add to the <a> tag
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://dwoo.org/LICENSE Modified BSD License
function Dwoo_Plugin_mailto(Dwoo $dwoo, $address, $text=
null, $subject=
null, $encode=
null, $cc=
null, $bcc=
null, $newsgroups=
null, $followupto=
null, $extra=
null)
if (!empty($newsgroups)) {
if (!empty($followupto)) {
$address =
rtrim($address, '?&');
return '<a href="mailto:'.
$address.
'" '.
$extra.
'>'.
$text.
'</a>';
$str =
'document.write(\'<a href="mailto:'.
$address.
'" '.
$extra.
'>'.
$text.
'</a>\');';
for ($i=
0; $i<
$len; $i++
) {
return '<script type="text/javascript">eval(unescape(\''.
$out.
'\'));</script>';
case 'javascript_charcode':
$str =
'<a href="mailto:'.
$address.
'" '.
$extra.
'>'.
$text.
'</a>';
$out =
'<script type="text/javascript">'.
"\n<!--\ndocument.write(String.fromCharCode(";
for ($i=
0; $i<
$len; $i++
) {
$out .=
ord($str[$i]).
',';
return rtrim($out, ',') .
"));\n-->\n</script>\n";
if (strpos($address, '?') !==
false) {
return $dwoo->triggerError('Mailto: Hex encoding is not possible with extra attributes, use one of : <em>js, jscharcode or none</em>.', E_USER_WARNING);
$out =
'<a href="mailto:';
for ($i=
0; $i<
$len; $i++
) {
for ($i=
0; $i<
$len; $i++
) {
return $dwoo->triggerError('Mailto: <em>encode</em> argument is invalid, it must be one of : <em>none (= no value), js, js_charcode or hex</em>', E_USER_WARNING);
Documentation generated on Sun, 07 Feb 2010 17:53:52 +0000 by phpDocumentor 1.4.0