public function onAfterRender()
 {
     if ($this->app->isAdmin()) {
         return;
     }
     $app = JFactory::getApplication();
     $option = $app->input->get('option');
     $view = $app->input->get('view');
     $tmpl = $app->input->get('tmpl');
     $body = JResponse::GetBody();
     if ($app->isSite() && $tmpl != 'component') {
         $_cls = explode(',', $this->_params->get('item_class'));
         if (empty($_cls)) {
             return;
         }
         $cls = array();
         for ($i = 0; $i < count($_cls); $i++) {
             $cls[] = trim($_cls[$i]);
         }
         $cls_str = implode(', ', $cls);
         $body = str_replace('</body>', $this->_addScriptQV($cls_str) . '</body>', $body);
         JResponse::setBody($body);
         return true;
     }
     $is_ajax = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
     $is_ajax_qv = (int) JRequest::getVar('isajax_qv', 0);
     if ($is_ajax && $is_ajax_qv) {
         $body = JResponse::GetBody();
         preg_match("~<body.*?>(.*?)<\\/body>~is", $body, $match);
         echo '<div id="sj_quickview">' . $match[1] . '</div>';
         die;
         //die(json_encode('<div id="sj_quickview">'.$match[1].'</div>'));
     }
 }
    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);
      }
    }
Esempio n. 3
0
    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);
    }
 function onAfterRender()
 {
     if ($this->_admin || $this->_view == '') {
         return;
     }
     $body = JResponse::GetBody();
     if ($this->_params->get('display_pagination') == 0) {
         $body = str_replace('div class="pagination">', 'div class="pagination" style="display:none;">', $body);
     }
     $body = str_replace('</body>', $this->addBtnLoadMore() . '</body>', $body);
     $body = str_replace('</body>', $this->addjQuery() . '</body>', $body);
     JResponse::setBody($body);
     return true;
 }