?
Path : /home/admin/domains/happytokorea.com/public_html_bk/test3/plugins/system/ |
Current File : /home/admin/domains/happytokorea.com/public_html_bk/test3/plugins/system/statusindicator.php |
<?php /** * @ ActiveHelper LiveHelp MenuItem Status Indicator Plugin * @version : 1.0 * @author : ActiveHelper Inc. * @copyright : (C) 2010- ActiveHelper Inc. * @license : GNU/GPL http://www.gnu.org/copyleft/gpl.html **/ defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin'); $mainframe->registerEvent( 'onAfterRender', 'MenuItemChatLinkBuilding' ); $pluginparams; function MenuItemChatLinkBuilding(){ $row = JResponse::getBody(); global $pluginparams; /* Get Plugin info */ $plugin =& JPluginHelper::getPlugin('system', 'statusindicator'); $pluginparams = new JParameter( $plugin->params ); $regex = '/<a (.*?)>(.*?)<\/a>/i'; $row = preg_replace_callback($regex, 'NormalizeLinks', $row); $regex = '/<a (.*?)href=[\"\']\/'. $pluginparams->get('search_key', 'ACTIVEHELPER-STATUS-INDICATOR.HTML') . '[\"\'](.*?)>([^<]{0,})<\/a>/i'; $row = preg_replace_callback($regex, 'BuildChatLink', $row); JResponse::setBody($row); return true; } function NormalizeLinks($matches) { return "\n".$matches[0]."\n"; } /** * Change the menu item keyword for the chat call. */ function BuildChatLink() { global $pluginparams; $chat_start = JURI::root() . 'components/com_activehelper_livehelp/' . 'server' . '/' . 'index.php'; return '<a onclick="s1.openLiveHelp(); s1.closeInfo(); return false;" href="'.$chat_start.'" >'. $pluginparams->get('sititle', 'Chat Here') . '</a>'; } ?>