|
When you're using Joomla's Article Manager, you get spoiled by its email cloaking. Then you start creating modules or dealing with other areas that don't incorporate the email cloaking and it's a little disappointing.
One area I get surprised by is that Custom HTML modules (mod_custom) do not implement cloaking - a little weird but Joomla is huge. I haven't been able to keep up with 1.5.7 or .8 so possibly this has changed.
In any case, I have have several components and areas that I wanted to put in the Joomla cloaking. One area (a custom error page) didn't have a reference to $mainframe so it broke on line 17 in plugins/content/emailcloak.php. So, you may or may not need the first line depending on what you're trying to do.
so, I don't have a solution for mod_custom yet, although now that I think about it, I may be able to create a new view using MVC... anyway, I'll post that if I get mod_custom tamed.
Here's the code:
global $mainframe;
$plugin =& JPluginHelper::getPlugin('content', 'emailcloak');
$pluginParams = new JParameter( $plugin->params );
require_once (JPATH_SITE.DS.'plugins'.DS.'content'.DS.'emailcloak.php');
$row = new stdClass;
$row->text = WHATEVER STRING/CONTENT NEEDS PROCESSING;
plgContentEmailCloak($row,$pluginParams);
echo $row->text;
As always, YMMV depending on app/component/module/etc and version of Joomla. This block has been reliable for me. Enjoy!
|