当前位置: 首页>>代码示例>>PHP>>正文


PHP JResponse::toString方法代码示例

本文整理汇总了PHP中JResponse::toString方法的典型用法代码示例。如果您正苦于以下问题:PHP JResponse::toString方法的具体用法?PHP JResponse::toString怎么用?PHP JResponse::toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JResponse的用法示例。


在下文中一共展示了JResponse::toString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onAfterInitialise

 /**
  * Converting the site URL to fit to the HTTP request
  *
  */
 function onAfterInitialise()
 {
     global $_PROFILER;
     $app =& JFactory::getApplication();
     $user =& JFactory::getUser();
     if ($app->isAdmin() || JDEBUG) {
         return;
     }
     if (!$user->get('guest') && $_SERVER['REQUEST_METHOD'] == 'GET') {
         $this->_cache->setCaching(true);
     }
     $data = $this->_cache->get();
     if ($data !== false) {
         // the following code searches for a token in the cached page and replaces it with the
         // proper token.
         $token = JUtility::getToken();
         $search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#';
         $replacement = '<input type="hidden" name="' . $token . '" value="1" />';
         $data = preg_replace($search, $replacement, $data);
         JResponse::setBody($data);
         echo JResponse::toString($app->getCfg('gzip'));
         if (JDEBUG) {
             $_PROFILER->mark('afterCache');
             echo implode('', $_PROFILER->getBuffer());
         }
         $app->close();
     }
 }
开发者ID:joebushi,项目名称:joomla,代码行数:32,代码来源:cache.php

示例2: init

 function init()
 {
     $mainframe =& JFactory::getApplication();
     $file = JRequest::getVar('file');
     $folder = JRequest::getVar('folder');
     jimport('joomla.filesystem.file');
     // only allow files that have .inc.php in the file name
     if (!$file || strpos($file, '.inc.php') === false) {
         echo JText::_('Access Denied');
         exit;
     }
     if (!$mainframe->isAdmin() && !JRequest::getCmd('usetemplate')) {
         $mainframe->setTemplate('system');
     }
     $_REQUEST['tmpl'] = 'component';
     $mainframe->_messageQueue = array();
     $html = '';
     $path = JPATH_SITE;
     if ($folder) {
         $path .= DS . implode(DS, explode('.', $folder));
     }
     $file = $path . DS . $file;
     if (JFile::exists($file)) {
         ob_start();
         include $file;
         $html = ob_get_contents();
         ob_end_clean();
     }
     $document =& JFactory::getDocument();
     $document->setBuffer($html, 'component');
     $document->addStyleSheet(JURI::root(true) . '/plugins/system/nonumberelements/css/default.css');
     $mainframe->render();
     echo JResponse::toString($mainframe->getCfg('gzip'));
     exit;
 }
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:35,代码来源:helper.php

示例3: render

 /**
  * Render the error page based on an exception.
  *
  * @param   Exception  $error  The exception for which to render the error page.
  *
  * @return  void
  *
  * @since   3.0
  */
 public static function render(Exception $error)
 {
     try {
         $app = JFactory::getApplication();
         $document = JDocument::getInstance('error');
         if (!$document) {
             // We're probably in an CLI environment
             exit($error->getMessage());
             $app->close(0);
         }
         $config = JFactory::getConfig();
         // Get the current template from the application
         $template = $app->getTemplate();
         // Push the error object into the document
         $document->setError($error);
         if (ob_get_contents()) {
             ob_end_clean();
         }
         $document->setTitle(JText::_('Error') . ': ' . $error->getCode());
         $data = $document->render(false, array('template' => $template, 'directory' => JPATH_THEMES, 'debug' => $config->get('debug')));
         // Failsafe to get the error displayed.
         if (empty($data)) {
             exit($error->getMessage());
         } else {
             // Do not allow cache
             JResponse::allowCache(false);
             JResponse::setBody($data);
             echo JResponse::toString();
         }
     } catch (Exception $e) {
         exit('Error displaying the error page: ' . $e->getMessage());
     }
 }
开发者ID:interfaceslivres,项目名称:ccmd-ufpb,代码行数:42,代码来源:page.php

示例4: onAfterInitialise

 /**
  * Converting the site URL to fit to the HTTP request
  *
  */
 function onAfterInitialise()
 {
     global $_PROFILER;
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     if ($app->isAdmin() || JDEBUG) {
         return;
     }
     if (count($app->getMessageQueue())) {
         return;
     }
     if ($user->get('guest') && $_SERVER['REQUEST_METHOD'] == 'GET') {
         $this->_cache->setCaching(true);
     }
     $data = $this->_cache->get();
     if ($data !== false) {
         JResponse::setBody($data);
         echo JResponse::toString($app->getCfg('gzip'));
         if (JDEBUG) {
             $_PROFILER->mark('afterCache');
             echo implode('', $_PROFILER->getBuffer());
         }
         $app->close();
     }
 }
开发者ID:jimyb3,项目名称:mathematicalteachingsite,代码行数:29,代码来源:cache.php

示例5: plgSh404sefofflinecode

/**
 * Output a correct response code when site is offline
 * to let know search engines that site data
 * should not be discarded or discounted
 */
function plgSh404sefofflinecode()
{
    $app = JFactory::getApplication();
    // are we in the backend, or not offline ?
    if (!defined('SH404SEF_IS_RUNNING') || $app->isAdmin() || !$app->getCfg('offline')) {
        return;
    }
    // get plugin params
    $plugin =& JPluginHelper::getPlugin('sh404sefcore', 'sh404sefofflinecode');
    $pluginParams = new JRegistry();
    $pluginParams->loadString($plugin->params);
    $disallowAdminAccess = $pluginParams->get('disallowAdminAccess', 0);
    if (!$disallowAdminAccess) {
        // admins are allowed, lets check if current user
        // is an admin, or if user is trying to log in
        $user =& JFactory::getUser();
        $option = JRequest::getCmd('option');
        $task = JRequest::getCmd('task');
        if ($option == 'com_users' && $task == 'user.login') {
            // Check for request forgeries
            JRequest::checkToken() or jexit('Invalid Token');
            $loggingIn = true;
        } else {
            $loggingIn = false;
        }
        // if already logged inadmin, or admin logging in, let it go
        if ($user->authorize('core.manage', 'com_sh404sef') || $loggingIn) {
            return;
        }
    }
    // need to render offline screen
    if ($disallowAdminAccess) {
        // admins not allowed, use our own
        // simplified template. Most likely being hacked so
        // close doors as much as possible
        $template = '';
        $file = 'sh404sef_offline_template.php';
        $directory = JPATH_ROOT . DS . 'plugins' . DS . 'sh404sefcore';
    } else {
        // admin can access, use Joomla! offline template,
        // that includes a login form
        $template = $app->getTemplate();
        $file = 'offline.php';
        $directory = JPATH_THEMES;
    }
    $params = array('template' => $template, 'file' => $file, 'directory' => $directory);
    $document =& JFactory::getDocument();
    $data = $document->render($app->getCfg('caching'), $params);
    // header : service unavailable
    JResponse::setHeader('HTTP/1.0 503', true);
    // give it some time
    $retryAfter = $pluginParams->get('retry_after_delay', 7400);
    // set header
    Jresponse::setheader('Retry-After', gmdate('D, d M Y H:i:s', time() + $retryAfter) . ' GMT');
    // echo document
    JResponse::setBody($data);
    echo JResponse::toString($app->getCfg('gzip'));
    // and terminate
    $app->close();
}
开发者ID:lautarodragan,项目名称:ideary,代码行数:65,代码来源:sh404sefofflinecode.php

示例6: onAfterInitialise

 /**
  * Converting the site URL to fit to the HTTP request
  *
  */
 function onAfterInitialise()
 {
     global $mainframe, $_PROFILER;
     $user =& JFactory::getUser();
     if ($mainframe->isAdmin() || JDEBUG) {
         return;
     }
     if (!$user->get('aid') && $_SERVER['REQUEST_METHOD'] == 'GET') {
         $this->_cache->setCaching(true);
     }
     $data = $this->_cache->get();
     if ($data !== false) {
         // the following code searches for a token in the cached page and replaces it with the
         // proper token.
         $token = JUtility::getToken();
         $search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#';
         $replacement = '<input type="hidden" name="' . $token . '" value="1" />';
         $data = preg_replace($search, $replacement, $data);
         /** HTGMOD **/
         // do the same thing for the JomSocial ajax token
         $search = '/jax_token_var = \'[0-9a-f]{32}\'/';
         $replacement = 'jax_token_var = \'' . $token . '\'';
         $data = preg_replace($search, $replacement, $data);
         /** END HTGMOD **/
         JResponse::setBody($data);
         echo JResponse::toString($mainframe->getCfg('gzip'));
         if (JDEBUG) {
             $_PROFILER->mark('afterCache');
             echo implode('', $_PROFILER->getBuffer());
         }
         $mainframe->close();
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:37,代码来源:cache.php

示例7: onAfterInitialise

 /**
  * Converting the site URL to fit to the HTTP request
  *
  */
 function onAfterInitialise()
 {
     global $_PROFILER;
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     if ($app->isAdmin()) {
         return;
     }
     if (count($app->getMessageQueue())) {
         return;
     }
     if ($user->get('guest') && $app->input->getMethod() == 'GET') {
         $this->_cache->setCaching(true);
     }
     $data = $this->_cache->get($this->_cache_key);
     if ($data !== false) {
         // Set cached body
         JResponse::setBody($data);
         echo JResponse::toString($app->getCfg('gzip'));
         if (JDEBUG) {
             $_PROFILER->mark('afterCache');
         }
         $app->close();
     }
 }
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:29,代码来源:cache.php

示例8: t3_init

 function t3_init()
 {
     t3import('core.parameter');
     t3import('core.extendable');
     t3import('core.template');
     t3import('core.basetemplate');
     t3import('core.cache');
     t3import('core.head');
     t3import('core.hook');
     t3import('core.joomla.view');
     if (!class_exists('JModuleHelper', false)) {
         t3import('core.joomla.modulehelper');
     }
     t3import('core.joomla.pagination');
     //Load template language
     $this->loadLanguage('tpl_' . T3_ACTIVE_TEMPLATE, JPATH_SITE);
     $params = T3Common::get_template_based_params();
     //instance cache object.
     $devmode = $params ? $params->get('devmode', '0') == '1' : false;
     T3Cache::getInstance($devmode);
     //Check if enable T3 info mode. Enable by default (if not set)
     if ($params->get('infomode', 1) == 1) {
         if (!JRequest::getCmd('t3info') && JRequest::getCmd('tp')) {
             JRequest::setVar('t3info', JRequest::getCmd('tp'));
         }
     }
     $key = T3Cache::getPageKey();
     $data = null;
     $user =& JFactory::getUser();
     if (!$devmode && JRequest::getCmd('cache') != 'no') {
         T3Cache::setCaching(true);
         JResponse::allowCache(true);
     }
     $data = T3Cache::get($key);
     if ($data) {
         if (!preg_match('#<jdoc:include\\ type="([^"]+)" (.*)\\/>#iU', $data)) {
             $mainframe = JFactory::getApplication();
             $token = JUtility::getToken();
             $search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#';
             $replacement = '<input type="hidden" name="' . $token . '" value="1" />';
             $data = preg_replace($search, $replacement, $data);
             JResponse::setBody($data);
             echo JResponse::toString($mainframe->getCfg('gzip'));
             if (JDEBUG) {
                 global $_PROFILER;
                 $_PROFILER->mark('afterCache');
                 echo implode('', $_PROFILER->getBuffer());
             }
             $mainframe->close();
         }
     }
     //Preload template
     t3import('core.preload');
     $preload = T3Preload::getInstance();
     $preload->load();
     $doc =& JFactory::getDocument();
     $t3 = T3Template::getInstance($doc);
     $t3->_html = $data;
 }
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:59,代码来源:framework.php

示例9: __construct

 function __construct()
 {
     $app = JFactory::getApplication();
     $url = JRequest::getVar('url');
     $func = new plgSystemNNFrameworkHelperFunctions();
     if ($url) {
         echo $func->getByUrl($url);
         die;
     }
     $file = JRequest::getVar('file');
     // only allow files that have .inc.php in the file name
     if (!$file || strpos($file, '.inc.php') === false) {
         die;
     }
     $folder = JRequest::getVar('folder');
     if ($folder) {
         $file = implode('/', explode('.', $folder)) . '/' . $file;
     }
     $allowed = array('administrator/components/com_dbreplacer/dbreplacer.inc.php', 'administrator/components/com_nonumbermanager/details.inc.php', 'administrator/components/com_rereplacer/images/image.inc.php', 'administrator/modules/mod_addtomenu/addtomenu/addtomenu.inc.php', 'plugins/editors-xtd/articlesanywhere/articlesanywhere.inc.php', 'plugins/editors-xtd/contenttemplater/contenttemplater.inc.php', 'plugins/editors-xtd/modulesanywhere/modulesanywhere.inc.php', 'plugins/editors-xtd/snippets/snippets.inc.php', 'plugins/editors-xtd/sourcerer/sourcerer.inc.php');
     if (!$file || in_array($file, $allowed) === false) {
         die;
     }
     jimport('joomla.filesystem.file');
     if ($app->isSite() && !JRequest::getCmd('usetemplate')) {
         if (version_compare(JVERSION, '1.6.0', 'l')) {
             $app->setTemplate('../administrator/templates/khepri');
         } else {
             $app->setTemplate('../administrator/templates/bluestork');
         }
     }
     $_REQUEST['tmpl'] = 'component';
     JRequest::setVar('option', '1');
     $app->set('_messageQueue', '');
     $file = JPATH_SITE . '/' . $file;
     $html = '';
     if (JFile::exists($file)) {
         ob_start();
         include $file;
         $html = ob_get_contents();
         ob_end_clean();
     }
     $document = JFactory::getDocument();
     $document->setBuffer($html, 'component');
     if (version_compare(JVERSION, '1.6.0', 'l')) {
         $document->addStyleSheet(JURI::root(true) . '/administrator/templates/khepri/css/template.css');
         $document->addStyleSheet(JURI::root(true) . '/administrator/templates/khepri/css/icon.css');
         $document->addStyleSheet(JURI::root(true) . '/administrator/templates/khepri/css/rounded.css');
     } else {
         $document->addStyleSheet(JURI::root(true) . '/administrator/templates/bluestork/css/template.css');
     }
     $document->addScript(JURI::root(true) . '/includes/js/joomla.javascript.js');
     $app->render();
     $html = JResponse::toString($app->getCfg('gzip'));
     $html = preg_replace('#\\s*<' . 'link [^>]*href="[^"]*templates/system/[^"]*\\.css[^"]*"[^>]* />#s', '', $html);
     echo $html;
     die;
 }
开发者ID:spiridonov-oa,项目名称:SheinCandles,代码行数:57,代码来源:helper.php

示例10: raiseError

 function raiseError($code, $msg, $info = null, $backtrace = false)
 {
     jimport('joomla.error.exception');
     $exception = new JException($msg, $code, E_ERROR, $info, $backtrace);
     JResponse::setHeader('status', $exception->code . ' ' . str_replace("\n", ' ', $exception->message));
     JResponse::setBody(json_encode($exception));
     echo JResponse::toString();
     exit;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:9,代码来源:error.php

示例11: __construct

 function __construct()
 {
     $url = JFactory::getApplication()->input->getString('url', '');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
     $func = new NNFrameworkFunctions();
     if ($url) {
         echo $func->getByUrl($url);
         die;
     }
     $file = JFactory::getApplication()->input->getString('file', '');
     // only allow files that have .inc.php in the file name
     if (!$file || strpos($file, '.inc.php') === false) {
         die;
     }
     $folder = JFactory::getApplication()->input->getString('folder', '');
     if ($folder) {
         $file = implode('/', explode('.', $folder)) . '/' . $file;
     }
     $allowed = array('administrator/components/com_dbreplacer/dbreplacer.inc.php', 'administrator/components/com_nonumbermanager/details.inc.php', 'administrator/modules/mod_addtomenu/addtomenu.inc.php', 'media/rereplacer/images/image.inc.php', 'plugins/editors-xtd/articlesanywhere/articlesanywhere.inc.php', 'plugins/editors-xtd/contenttemplater/contenttemplater.inc.php', 'plugins/editors-xtd/modulesanywhere/modulesanywhere.inc.php', 'plugins/editors-xtd/snippets/snippets.inc.php', 'plugins/editors-xtd/sourcerer/sourcerer.inc.php');
     if (!$file || in_array($file, $allowed) === false) {
         die;
     }
     jimport('joomla.filesystem.file');
     if (JFactory::getApplication()->isSite()) {
         JFactory::getApplication()->setTemplate('../administrator/templates/isis');
     }
     $_REQUEST['tmpl'] = 'component';
     JFactory::getApplication()->input->set('option', '1');
     JHtml::_('bootstrap.framework');
     JFactory::getDocument()->addScript(JURI::root(true) . '/administrator/templates/isis/js/template.js');
     JFactory::getDocument()->addStyleSheet(JURI::root(true) . '/administrator/templates/isis/css/template.css');
     JHtml::stylesheet('nnframework/popup.min.css', false, true);
     $file = JPATH_SITE . '/' . $file;
     $html = '';
     if (JFile::exists($file)) {
         ob_start();
         include $file;
         $html = ob_get_contents();
         ob_end_clean();
     }
     JFactory::getDocument()->setBuffer($html, 'component');
     if (version_compare(JVERSION, '3.2', 'l')) {
         JFactory::getApplication()->render();
     } else {
         nnApplication::render();
     }
     $html = JResponse::toString(JFactory::getApplication()->getCfg('gzip'));
     $html = preg_replace('#\\s*<' . 'link [^>]*href="[^"]*templates/system/[^"]*\\.css[^"]*"[^>]* />#s', '', $html);
     $html = preg_replace('#(<' . 'body [^>]*class=")#s', '\\1nnpopup ', $html);
     $html = str_replace('<' . 'body>', '<' . 'body class="nnpopup"', $html);
     echo $html;
     die;
 }
开发者ID:naka211,项目名称:jydsk,代码行数:53,代码来源:helper.php

示例12: __construct

 function __construct()
 {
     $mainframe =& JFactory::getApplication();
     $url = JRequest::getVar('url');
     $options = JRequest::getVar('url_options', array(), 'post', 'array');
     $func = new plgSystemNoNumberElementsHelperFunctions();
     if ($url) {
         echo $func->getByUrl($url, $options);
         exit;
     }
     $file = JRequest::getVar('file');
     // only allow files that have .inc.php in the file name
     if (!$file || strpos($file, '.inc.php') === false) {
         echo JText::_('Access Denied');
         exit;
     }
     $folder = JRequest::getVar('folder');
     jimport('joomla.filesystem.file');
     if ($mainframe->isSite() && !JRequest::getCmd('usetemplate')) {
         $mainframe->setTemplate('system');
     }
     $_REQUEST['tmpl'] = 'component';
     JRequest::setVar('option', '1');
     if (version_compare(JVERSION, '1.6.0', 'l')) {
         // For Joomla 1.5
         $mainframe->_messageQueue = array();
     } else {
         // Still have to figure out how to empty message queue in J1.6
     }
     $path = JPATH_SITE;
     if ($folder) {
         $path .= DS . implode(DS, explode('.', $folder));
     }
     $file = $path . DS . $file;
     $html = '';
     if (JFile::exists($file)) {
         ob_start();
         include $file;
         $html = ob_get_contents();
         ob_end_clean();
     }
     $document =& JFactory::getDocument();
     $document->setBuffer($html, 'component');
     $document->addStyleSheet(JURI::root(true) . '/templates/system/css/system.css');
     $document->addStyleSheet(JURI::root(true) . '/plugins/system/nonumberelements/css/default.css');
     $document->addScript(JURI::root(true) . '/includes/js/joomla.javascript.js');
     $mainframe->render();
     echo JResponse::toString($mainframe->getCfg('gzip'));
     exit;
 }
开发者ID:jtresca,项目名称:nysurveyor,代码行数:50,代码来源:helper.php

示例13: create

 public function create()
 {
     $output = '';
     $size = JRequest::getCmd('size', '');
     if (!in_array($size, array('min', 'medium'))) {
         throw new Exception('The image size is not recognized', 500);
     }
     $image = JRequest::getVar('image', '');
     $id = JRequest::getInt('id', 0);
     $imagePath = JPATH_ROOT . DS . 'images' . DS . 'com_jea' . DS . 'images' . DS . $id . DS . $image;
     $thumbDir = JPATH_ROOT . DS . 'images' . DS . 'com_jea' . DS . 'thumb-' . $size;
     $thumbPath = $thumbDir . DS . $id . '-' . $image;
     if (file_exists($thumbPath)) {
         $output = readfile($thumbPath);
     } elseif (file_exists($imagePath)) {
         if (!JFolder::exists($thumbPath)) {
             JFolder::create($thumbDir);
         }
         $params = JComponentHelper::getParams('com_jea');
         if ($size == 'medium') {
             $width = $params->get('thumb_medium_width', 400);
             $height = $params->get('thumb_medium_height', 300);
         } else {
             $width = $params->get('thumb_min_width', 120);
             $height = $params->get('thumb_min_height', 90);
         }
         $quality = (int) $params->get('jpg_quality', 90);
         $cropThumbnails = (bool) $params->get('crop_thumbnails', 0);
         $JImage = new JImage($imagePath);
         if ($cropThumbnails) {
             $thumb = $JImage->resize($width, $height, true, JImage::SCALE_OUTSIDE);
             $left = $thumb->getWidth() > $width ? intval(($thumb->getWidth() - $width) / 2) : 0;
             $top = $thumb->getHeight() > $height ? intval(($thumb->getHeight() - $height) / 2) : 0;
             $thumb->crop($width, $height, $left, $top, false);
         } else {
             $thumb = $JImage->resize($width, $height);
         }
         $thumb->toFile($thumbPath, IMAGETYPE_JPEG, array('quality' => $quality));
         $output = readfile($thumbPath);
     } else {
         throw new Exception('The image ' . $image . ' was not found', 500);
     }
     JResponse::setHeader('Content-Type', 'image/jpeg', true);
     JResponse::setHeader('Content-Transfer-Encoding', 'binary');
     JResponse::allowCache(false);
     JResponse::setBody($output);
     echo JResponse::toString();
     exit;
 }
开发者ID:Cloudum,项目名称:com_jea,代码行数:49,代码来源:thumbnail.php

示例14: __construct

 function __construct()
 {
     $mainframe =& JFactory::getApplication();
     $url = JRequest::getVar('url');
     $options = JRequest::getVar('url_options', array(), 'post', 'array');
     $func = new plgSystemNNFrameworkHelperFunctions();
     if ($url) {
         echo $func->getByUrl($url, $options);
         exit;
     }
     $file = JRequest::getVar('file');
     // only allow files that have .inc.php in the file name
     if (!$file || strpos($file, '.inc.php') === false) {
         die;
     }
     $folder = JRequest::getVar('folder');
     if ($folder) {
         $file = implode('/', explode('.', $folder)) . '/' . $file;
     }
     $allowed = array('administrator/components/com_dbreplacer/dbreplacer.inc.php', 'administrator/components/com_nonumbermanager/details.inc.php', 'administrator/components/com_rereplacer/images/image.inc.php', 'administrator/modules/mod_addtomenu/addtomenu/addtomenu.inc.php', 'plugins/editors-xtd/articlesanywhere/articlesanywhere.inc.php', 'plugins/editors-xtd/contenttemplater/contenttemplater.inc.php', 'plugins/editors-xtd/modulesanywhere/modulesanywhere.inc.php', 'plugins/editors-xtd/snippets/snippets.inc.php', 'plugins/editors-xtd/sourcerer/sourcerer.inc.php');
     if (!$file || in_array($file, $allowed) === false) {
         die;
     }
     jimport('joomla.filesystem.file');
     if ($mainframe->isSite() && !JRequest::getCmd('usetemplate')) {
         $mainframe->setTemplate('system');
     }
     $_REQUEST['tmpl'] = 'component';
     JRequest::setVar('option', '1');
     $mainframe->set('_messageQueue', '');
     $file = JPATH_SITE . '/' . $file;
     $html = '';
     if (JFile::exists($file)) {
         ob_start();
         include $file;
         $html = ob_get_contents();
         ob_end_clean();
     }
     $document =& JFactory::getDocument();
     $document->setBuffer($html, 'component');
     $document->addStyleSheet(JURI::root(true) . '/templates/system/css/system.css');
     $document->addStyleSheet(JURI::root(true) . '/plugins/system/nnframework/css/default.css');
     $document->addScript(JURI::root(true) . '/includes/js/joomla.javascript.js');
     $mainframe->render();
     echo JResponse::toString($mainframe->getCfg('gzip'));
     exit;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:47,代码来源:helper.php

示例15: render

 function render()
 {
     $url = JFactory::getApplication()->input->getString('url', '');
     $func = new NNFrameworkFunctions();
     if ($url) {
         echo $func->getByUrl($url);
         die;
     }
     $allowed = array('administrator/components/com_dbreplacer/ajax.php', 'administrator/modules/mod_addtomenu/popup.php', 'media/rereplacer/images/popup.php', 'plugins/editors-xtd/articlesanywhere/popup.php', 'plugins/editors-xtd/contenttemplater/popup.php', 'plugins/editors-xtd/dummycontent/popup.php', 'plugins/editors-xtd/modals/popup.php', 'plugins/editors-xtd/modulesanywhere/popup.php', 'plugins/editors-xtd/sliders/popup.php', 'plugins/editors-xtd/snippets/popup.php', 'plugins/editors-xtd/sourcerer/popup.php', 'plugins/editors-xtd/tabs/popup.php', 'plugins/editors-xtd/tooltips/popup.php', 'administrator/components/com_dbreplacer/dbreplacer.inc.php', 'administrator/components/com_nonumbermanager/details.inc.php', 'administrator/modules/mod_addtomenu/addtomenu.inc.php', 'media/rereplacer/images/image.inc.php', 'plugins/editors-xtd/articlesanywhere/articlesanywhere.inc.php', 'plugins/editors-xtd/contenttemplater/contenttemplater.inc.php', 'plugins/editors-xtd/dummycontent/dummycontent.inc.php', 'plugins/editors-xtd/modulesanywhere/modulesanywhere.inc.php', 'plugins/editors-xtd/snippets/snippets.inc.php', 'plugins/editors-xtd/sourcerer/sourcerer.inc.php');
     $file = JFactory::getApplication()->input->getString('file', '');
     $folder = JFactory::getApplication()->input->getString('folder', '');
     if ($folder) {
         $file = implode('/', explode('.', $folder)) . '/' . $file;
     }
     if (!$file || in_array($file, $allowed) === false) {
         die;
     }
     jimport('joomla.filesystem.file');
     if (JFactory::getApplication()->isSite()) {
         JFactory::getApplication()->setTemplate('../administrator/templates/isis');
     }
     $_REQUEST['tmpl'] = 'component';
     JFactory::getApplication()->input->set('option', 'com_content');
     header('Content-Type: text/html; charset=utf-8');
     JHtml::_('bootstrap.framework');
     JFactory::getDocument()->addScript(JUri::root(true) . '/administrator/templates/isis/js/template.js');
     JFactory::getDocument()->addStyleSheet(JUri::root(true) . '/administrator/templates/isis/css/template.css');
     JHtml::stylesheet('nnframework/popup.min.css', false, true);
     $file = JPATH_SITE . '/' . $file;
     $html = '';
     if (JFile::exists($file)) {
         ob_start();
         include $file;
         $html = ob_get_contents();
         ob_end_clean();
     }
     JFactory::getDocument()->setBuffer($html, 'component');
     NNApplication::render();
     $html = JResponse::toString(JFactory::getApplication()->getCfg('gzip'));
     $html = preg_replace('#\\s*<' . 'link [^>]*href="[^"]*templates/system/[^"]*\\.css[^"]*"[^>]* />#s', '', $html);
     $html = preg_replace('#(<' . 'body [^>]*class=")#s', '\\1nnpopup ', $html);
     $html = str_replace('<' . 'body>', '<' . 'body class="nnpopup"', $html);
     echo $html;
     die;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:45,代码来源:helper.php


注:本文中的JResponse::toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。