6 * Sample plugin to replace emoticons in plain text message body with real icons
9 * @author Thomas Bruederli
10 * @website http://roundcube.net
12 class emoticons extends rcube_plugin
14 public $task = 'mail';
20 $this->add_hook('message_part_after', array($this, 'replace'));
23 ':)' => html::img(array('src' => './program/js/tiny_mce/plugins/emotions/img/smiley-smile.gif', 'alt' => ':)')),
24 ':-)' => html::img(array('src' => './program/js/tiny_mce/plugins/emotions/img/smiley-smile.gif', 'alt' => ':-)')),
25 ':(' => html::img(array('src' => './program/js/tiny_mce/plugins/emotions/img/smiley-cry.gif', 'alt' => ':(')),
26 ':-(' => html::img(array('src' => './program/js/tiny_mce/plugins/emotions/img/smiley-cry.gif', 'alt' => ':-(')),
30 function replace($args)
32 if ($args['type'] == 'plain')
33 return array('body' => strtr($args['body'], $this->map));