Exemple #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);
         }
     }
 }
Exemple #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);
         }
     }
 }
Exemple #3
0
Yjsg::yjsgtooltip();
if (version_compare(JVERSION, '3.0', 'ge')) {
    JHtml::_('behavior.modal', 'a.modal_jform_contenthistory');
}
$this->form->loadFile(dirname(__FILE__) . DIRECTORY_SEPARATOR . "article.xml");
// Create shortcut to parameters.
$params = $this->state->get('params');
//$images = json_decode($this->item->images);
//$urls = json_decode($this->item->urls);
// This checks if the editor config options have ever been saved. If they haven't they will fall back to the original settings.
$editoroptions = isset($params->show_publishing_options);
if (!$editoroptions) {
    $params->show_urls_images_frontend = '0';
}
// Yjsg article extra fields
$yjsg_article_options = Yjsg::tplParam('yjsg_article_options');
$user = JFactory::getUser();
$userGroups = $user->groups;
$showYjsgArticleOptions = false;
if (is_array($yjsg_article_options) && array_intersect($yjsg_article_options, $userGroups)) {
    $showYjsgArticleOptions = true;
}
if ($showYjsgArticleOptions) {
    $yjsgarticlefields = array();
    $yjsgarticle_category_fields = array();
    $attrib = $this->form->getFieldsets('attribs');
    foreach ($attrib as $yjsgextras) {
        if (isset($yjsgextras->yjsgextra) && $yjsgextras->yjsgextra == 'yjsgarticle') {
            $yjsgarticlefields[] = $yjsgextras;
        }
        if (isset($yjsgextras->yjsgcategory)) {