function onAfterRender() { $runmode = $this->params->get('runmode'); if ($runmode != 1) return; // $user =& JFactory::getUser(); $app = JFactory::getApplication(); if ($app->isSite()) { $page = JResponse::GetBody(); $page = do_shortcode($page); JResponse::SetBody($page); } }
public function addBtnShortCodes() { $page = JResponse::GetBody(); $button = $this->listShortCodes(); $stext = '<script type="text/javascript"> function jSelectShortcode(text) { jQuery("#yt_shorcodes").removeClass("open"); text = text.replace(/\'/g, \'"\'); //1.Editor Content if(document.getElementById(\'jform_articletext\') != null) { jInsertEditorText(text, \'jform_articletext\'); } if(document.getElementById(\'jform_description\') != null) { jInsertEditorText(text, \'jform_description\'); } //2.Editor K2 if(document.getElementById(\'description\') != null) { jInsertEditorText(text, \'description\'); } if(document.getElementById(\'text\') != null) { jInsertEditorText(text, \'text\'); } //3.Editor VirtueMart if(document.getElementById(\'category_description\') != null) { jInsertEditorText(text, \'category_description\'); } if(document.getElementById(\'product_desc\') != null) { jInsertEditorText(text, \'product_desc\'); } //4.Editor Contact if(document.getElementById(\'jform_misc\') != null) { jInsertEditorText(text, \'jform_misc\'); } //5.Editor Easyblog if(document.getElementById(\'write_content\') != null) { jInsertEditorText(text, \'write_content\'); } //6.Editor Joomshoping if(document.getElementById(\'description1\') != null) { jInsertEditorText(text, \'description1\'); } //6.Editor HTML if(document.getElementById(\'jform_content\') != null) { jInsertEditorText(text, \'jform_content\'); } SqueezeBox.close(); } </script>'; $page = str_replace('<div id="editor-xtd-buttons">', '<div id="editor-xtd-buttons">' . $button, $page); $page = str_replace('<div id="editor-xtd-buttons" class="btn-toolbar pull-left">', '<div id="editor-xtd-buttons" class="btn-toolbar pull-left">' . $button, $page); $page = str_replace('</body>', $stext . '</body>', $page); JResponse::SetBody($page); }