Ejemplo n.º 1
0
 function onAfterRender()
 {
     if (defined('PLAZART_PLUGIN') && Plazart::detect()) {
         $plazartapp = Plazart::getApp();
         if ($plazartapp) {
             if (JFactory::getApplication()->isAdmin()) {
                 $plazartapp->render();
             } else {
                 $plazartapp->snippet();
                 //                    $optimized  =   Plazart::OptimizeCode();
                 //                    $optimized->OptimizeCode();
                 if (class_exists('TZRules')) {
                     $buf = TZRules::parseIt();
                     JResponse::setBody($buf);
                 }
             }
         }
     }
     //		if($japp->isAdmin()){
     //			if(Plazart::detect()){
     //				$plazartapp = Plazart::getApp();
     //				$plazartapp->render();
     //			}
     //		} else {
     //            if(Plazart::detect()){
     //                $optimized  =   Plazart::OptimizeCode();
     //                $optimized->OptimizeCode();
     //
     //                if (class_exists('TZRules')) {
     //                    $buf = TZRules::parseIt();
     //                    JResponse::setBody($buf);
     //                }
     //            }
     //        }
 }
Ejemplo n.º 2
0
 public static function unittest()
 {
     $app = JFactory::getApplication();
     $tpl = $app->getTemplate(true);
     $plazartapp = Plazart::getApp($tpl);
     $layout = JFactory::getApplication()->input->getCmd('layout', 'default');
     ob_start();
     $plazartapp->loadLayout($layout);
     ob_clean();
     echo "Positions for layout [{$layout}]: <br />";
     var_dump($plazartapp->getPositions());
 }
Ejemplo n.º 3
0
<?php

/**
 * Plazart Framework
 * Author: Sonle
 * Version: 4.3
 * @copyright   Copyright (C) 2012 - 2015 TemPlaza.com. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
// No direct access.
defined('_JEXEC') or die;
//check if plazart plugin is existed
if (!defined('PLAZART')) {
    die(JText::_('Plazart framework does not ready! Please enable Plazart plugin system!'));
    //    throw new Exception('Plazart framework not ready! Please install plazart plugin system!');
}
// include framework classes and files
$plazart = Plazart::getApp($this);
// get configured layout
$layout = $plazart->getLayout();
$plazart->loadLayout($layout);