Beispiel #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);
     //                }
     //            }
     //        }
 }
Beispiel #2
0
 public static function parseIt()
 {
     if (!version_compare(JVERSION, '3.2', '>=')) {
         jimport('joomla.environment.response');
     }
     self::$body = JResponse::getBody();
     // if the custom rules are defined
     if (count(self::$rules)) {
         // use it for parsing the website
         foreach (self::$rules as $pattern => $replace) {
             self::$body = preg_replace($pattern, $replace, self::$body);
         }
     }
     return self::$body;
 }