Пример #1
0
 function onAfterRender()
 {
     // in case someone is overriding form field
     if ($this->app->isAdmin() && $this->run_plg == 1 && $this->templateView) {
         $body = Yjsg::getBody();
         if (version_compare(JVERSION, '3.0', '<')) {
             // bug in usergroup field type output
             $body = str_replace('jformparams', "jform_params_", $body);
         }
         if (version_compare(JVERSION, '3.0', '<')) {
             $body = preg_replace('/title="(.*?)::(.*?)">/', 'data-original-title="$1" data-content="$2">', $body);
             $body = str_replace('hasTip', "adminLabel", $body);
         } else {
             $body = preg_replace('/title="(.*?)<\\/strong><br \\/>(.*?)">/', 'data-original-title="$1</strong>" data-content="$2">', $body);
             $body = str_replace(array('hasTooltip', 'hasPopover'), "adminLabel", $body);
         }
         Yjsg::setBody($body);
     }
     if ($this->app->isSite() && $this->run_plg == 1) {
         // add before and after body custom codes
         $body = Yjsg::getBody();
         $afterbody = Yjsg::tplParam('cc_after_body');
         $beforecbody = Yjsg::tplParam('cc_before_cbody');
         $bootstrapv = Yjsg::tplParam('bootstrap_version');
         if (empty($bootstrapv)) {
             $bootstrapv = 'bootstrapoff';
         }
         if (!empty($afterbody) || !empty($beforecbody)) {
             if (!empty($afterbody)) {
                 $body = preg_replace('/(<body.*?\\">)(.*)/', "\$0\n\t" . $afterbody, $body);
             }
             if (!empty($beforecbody)) {
                 $body = str_replace('</body>', "\n\t" . $beforecbody . "\n\t</body>", $body);
             }
             Yjsg::setBody($body);
         }
         // make pagination class names same in all jversions
         if ($this->Input('view') == 'article') {
             $paginationreplace = array('<ul class="pagenav">' => '<ul class="pager">', 'pagenav-prev' => 'previous', 'pagenav-next' => 'next');
             $body = str_replace(array_keys($paginationreplace), $paginationreplace, $body);
             if (version_compare(JVERSION, '3.0', '<')) {
                 if ($this->yjsg->preplugin()) {
                     $body = preg_replace('/(<div class="pagination">(.*?)<ul>)/s', '<div class="jb_pagin"><ul class="pager">', $body);
                 } else {
                     $body = preg_replace('/(<div class="pagination">(.*?)<ul>)/s', '<div class="yjsg-pager-links"><ul class="pager">', $body);
                 }
             } else {
                 if ($this->yjsg->preplugin()) {
                     $body = preg_replace('/(<div class="pager">(.*?)<ul>)/s', '<div class="jb_pagin"><ul class="pager">', $body);
                 } else {
                     $body = preg_replace('/(<div class="pager">(.*?)<ul>)/s', '<div class="yjsg-pager-links"><ul class="pager">', $body);
                 }
             }
             Yjsg::setBody($body);
         }
         // yjsg shortcodes
         $body = yjsg_shortcodes($body);
         Yjsg::setBody($body);
         // module positions
         if ($this->app->input->getBool('modulepositions')) {
             $rep = '<div class="yjsg-module-positions yjsquare">mainbody</div>';
             $body = preg_replace('/(<div class=\\"yjsgarticle\\">.*?<!--end news item -->)/s', $rep, $body);
             Yjsg::setBody($body);
         }
     }
 }
Пример #2
0
 function onAfterRender()
 {
     if ($this->app->isSite() && $this->run_plg == 1) {
         // add before and after body custom codes
         $body = Yjsg::getBody();
         $afterbody = Yjsg::tplParam('cc_after_body');
         $beforecbody = Yjsg::tplParam('cc_before_cbody');
         $bootstrapv = Yjsg::tplParam('bootstrap_version');
         if (empty($bootstrapv)) {
             $bootstrapv = 'bootstrapoff';
         }
         if (!empty($afterbody) || !empty($beforecbody)) {
             if (!empty($afterbody)) {
                 $body = preg_replace('/(<body.*?\\">)(.*)/', "\$0\n\t" . $afterbody, $body);
             }
             if (!empty($beforecbody)) {
                 $body = str_replace('</body>', "\n\t" . $beforecbody . "\n\t</body>", $body);
             }
             Yjsg::setBody($body);
         }
         // make pagination class names same in all jversions
         if ($this->Input('view') == 'article') {
             $paginationreplace = array('<ul class="pagenav">' => '<ul class="pager">', 'pagenav-prev' => 'previous', 'pagenav-next' => 'next');
             $body = str_replace(array_keys($paginationreplace), $paginationreplace, $body);
             if (version_compare(JVERSION, '3.0', '<')) {
                 if ($this->yjsg->preplugin()) {
                     $body = preg_replace('/(<div class="pagination">(.*?)<ul>)/s', '<div class="jb_pagin"><ul class="pager">', $body);
                 } else {
                     $body = preg_replace('/(<div class="pagination">(.*?)<ul>)/s', '<div class="yjsg-pager-links"><ul class="pager">', $body);
                 }
             } else {
                 if ($this->yjsg->preplugin()) {
                     $body = preg_replace('/(<div class="pager">(.*?)<ul>)/s', '<div class="jb_pagin"><ul class="pager">', $body);
                 } else {
                     $body = preg_replace('/(<div class="pager">(.*?)<ul>)/s', '<div class="yjsg-pager-links"><ul class="pager">', $body);
                 }
             }
             Yjsg::setBody($body);
         }
         // yjsg shortcodes
         require_once YJSGPATH . 'includes/yjsgshortcodes/yjsg_shortcodes.php';
         $body = yjsg_shortcodes($body);
         Yjsg::setBody($body);
         // module positions
         if ($this->app->input->getBool('modulepositions')) {
             $rep = '<div class="yjsg-module-positions yjsquare">mainbody</div>';
             $body = preg_replace('/(<div class=\\"yjsgarticle\\">.*?<!--end news item -->)/s', $rep, $body);
             Yjsg::setBody($body);
         }
     }
 }
Пример #3
0
function yjsg_run_shortcodes($matches)
{
    return yjsg_shortcodes($matches[1]);
}