function onAfterRender() { global $mainframe; if ($mainframe->isAdmin()) { return; } $app =& JFactory::getApplication(); $theme = $this->params->get('theme', 'default'); if ($theme == 'custom') { $theme = $this->params->get('custom_theme', 'default'); } $file = file_get_contents(JURI::base() . "plugins/system/pretty/html/" . $theme . ".html", true); if ($file != null && $file != '') { $popup = '0'; $file = preg_replace("/popupid/", $popup, $file); } JResponse::appendBody($file); }
/** * @return void */ public static function debugLanguage() { ob_start(); $lang = JFactory::getLanguage(); echo '<h4>Parsing errors in language files</h4>'; $errorfiles = $lang->getErrorFiles(); if (count($errorfiles)) { echo '<ul>'; foreach ($errorfiles as $file => $error) { echo "<li>{$error}</li>"; } echo '</ul>'; } else { echo '<pre>None</pre>'; } echo '<h4>Untranslated Strings</h4>'; echo '<pre>'; $orphans = $lang->getOrphans(); if (count($orphans)) { ksort($orphans, SORT_STRING); foreach ($orphans as $key => $occurance) { $guess = str_replace('_', ' ', $key); $parts = explode(' ', $guess); if (count($parts) > 1) { array_shift($parts); $guess = implode(' ', $parts); } $guess = trim($guess); $key = trim(strtoupper($key)); $key = preg_replace('#\\s+#', '_', $key); $key = preg_replace('#\\W#', '', $key); // Prepare the text $guesses[] = $key . '="' . $guess . '"'; } echo "\n\n# " . $file . "\n\n"; echo implode("\n", $guesses); } else { echo 'None'; } echo '</pre>'; $debug = ob_get_clean(); JResponse::appendBody($debug); }
static function exit_handler($hook) { global $mainframe, $_PROFILER; $data = $mainframe->_dispatchEnd(); $mainframe->render($data); if (JDEBUG) { $_PROFILER->mark('afterRender'); JResponse::appendBody(implode('', $_PROFILER->getBuffer())); } echo JResponse::toString($mainframe->getCfg('gzip')); $mainframe->close(); }