/**
  * @param $plugin
  * @param $pluginPageId
  * @return \ApacheSolrForTypo3\Solr\Plugin\Results\Results
  * @throws \InvalidArgumentException
  */
 protected function getPluginInstance($plugin, $pluginPageId = 1)
 {
     switch ($plugin) {
         case 'results':
             $pluginClassName = 'ApacheSolrForTypo3\\Solr\\Plugin\\Results\\Results';
             break;
         case 'search':
             $pluginClassName = 'ApacheSolrForTypo3\\Solr\\Plugin\\Search\\Search';
             break;
         case 'frequent_search':
             $pluginClassName = 'ApacheSolrForTypo3\\Solr\\Plugin\\FrequentSearches\\FrequentSearches';
             break;
         default:
             throw new \InvalidArgumentException('Invalid plugin ' . $plugin);
     }
     $fakeTSFE = $this->getConfiguredTSFE(array(), $pluginPageId);
     $fakeTSFE->newCObj();
     $GLOBALS['TSFE'] = $fakeTSFE;
     PageGenerator::pagegenInit();
     PageGenerator::renderContent();
     $fakeTSFE->newCObj();
     $fakeTSFE->fe_user->id = 'id';
     /** @var $plugin \ApacheSolrForTypo3\Solr\Plugin\Results\Results */
     $plugin = GeneralUtility::makeInstance($pluginClassName);
     $plugin->cObj = $fakeTSFE->cObj;
     return $plugin;
 }
Example #2
0
 /**
  * Returns the filename of the additional CSS for the banners
  *
  * @param array $banners Banners
  * @return string
  */
 public function getAdditionalCssFile($banners)
 {
     $css = $this->getAdditionalCss($banners);
     $filename = '';
     if ($css != '') {
         $filename = PageGenerator::inline2TempFile($css, 'css');
     }
     return $filename;
 }
 /**
  * Initialize full GLOBALS[TSFE] based on given page id
  *
  * @param integer $pageId
  * @return void
  */
 public static function initializeFrontendPage($pageId = 0)
 {
     static::initializeTypoScriptFrontendController($pageId);
     static::initializeFrontendUserAuthentication();
     $controller =& $GLOBALS['TSFE'];
     if (!$controller->sys_page instanceof \TYPO3\CMS\Frontend\Page\PageRepository) {
         $controller->determineId();
     }
     if (!$controller->tmpl instanceof \TYPO3\CMS\Core\TypoScript\TemplateService) {
         $controller->initTemplate();
     }
     if (!is_array($controller->config)) {
         $controller->getConfigArray();
     }
     static::initializeContentObjectRenderer();
     if (empty($controller->indexedDocTitle)) {
         \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
     }
 }
 /**
  * Calculates and sets the internal linkVars based upon the current
  * $_GET parameters and the setting "config.linkVars".
  *
  * @return void
  */
 public function calculateLinkVars()
 {
     $this->linkVars = '';
     $linkVars = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', (string) $this->config['config']['linkVars']);
     if (empty($linkVars)) {
         return;
     }
     $getData = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET();
     foreach ($linkVars as $linkVar) {
         $test = $value = '';
         if (preg_match('/^(.*)\\((.+)\\)$/', $linkVar, $match)) {
             $linkVar = trim($match[1]);
             $test = trim($match[2]);
         }
         if ($linkVar === '' || !isset($getData[$linkVar])) {
             continue;
         }
         if (!is_array($getData[$linkVar])) {
             $temp = rawurlencode($getData[$linkVar]);
             if ($test !== '' && !\TYPO3\CMS\Frontend\Page\PageGenerator::isAllowedLinkVarValue($temp, $test)) {
                 // Error: This value was not allowed for this key
                 continue;
             }
             $value = '&' . $linkVar . '=' . $temp;
         } else {
             if ($test !== '' && strcmp('array', $test)) {
                 // Error: This key must not be an array!
                 continue;
             }
             $value = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($linkVar, $getData[$linkVar]);
         }
         $this->linkVars .= $value;
     }
 }
 /**
  * Generate the page title again as TSFE->altPageTitle might have been modified by an inc script
  *
  * @return void
  */
 protected function regeneratePageTitle()
 {
     \TYPO3\CMS\Frontend\Page\PageGenerator::generatePageTitle();
 }
Example #6
0
 /**
  * @param string $fixture
  * @param array $importPageIds
  */
 protected function indexPageIdsFromFixture($fixture, $importPageIds)
 {
     $this->importDataSetFromFixture($fixture);
     foreach ($importPageIds as $importPageId) {
         $GLOBALS['TT'] = $this->getMockBuilder(TimeTracker::class)->disableOriginalConstructor()->getMock();
         $fakeTSFE = $this->getConfiguredTSFE(array(), $importPageId);
         $fakeTSFE->newCObj();
         $GLOBALS['TSFE'] = $fakeTSFE;
         PageGenerator::pagegenInit();
         PageGenerator::renderContent();
         /** @var $pageIndexer \ApacheSolrForTypo3\Solr\Typo3PageIndexer */
         $pageIndexer = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\Typo3PageIndexer', $fakeTSFE);
         $pageIndexer->indexPage();
     }
     /** @var $beUser  \TYPO3\CMS\Core\Authentication\BackendUserAuthentication */
     $beUser = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication');
     $GLOBALS['BE_USER'] = $beUser;
 }
 /**
  * Generate the page title again as TSFE->altPageTitle might have been modified by an inc script
  *
  * @return void
  */
 protected function regeneratePageTitle()
 {
     PageGenerator::generatePageTitle();
 }
 /**
  * Handles a frontend request
  *
  * @param \Psr\Http\Message\ServerRequestInterface $request
  * @return NULL|\Psr\Http\Message\ResponseInterface
  */
 public function handleRequest(\Psr\Http\Message\ServerRequestInterface $request)
 {
     $response = null;
     $this->request = $request;
     $this->initializeTimeTracker();
     // Hook to preprocess the current request:
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
             $hookParameters = array();
             GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
         }
         unset($hookFunction);
         unset($hookParameters);
     }
     $this->initializeController();
     if ($GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_force'] && !GeneralUtility::cmpIP(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {
         $this->controller->pageUnavailableAndExit('This page is temporarily unavailable.');
     }
     $this->controller->connectToDB();
     $this->controller->sendRedirect();
     // Output compression
     // Remove any output produced until now
     $this->bootstrap->endOutputBufferingAndCleanPreviousOutput();
     $this->initializeOutputCompression();
     // Initializing the Frontend User
     $this->timeTracker->push('Front End user initialized', '');
     $this->controller->initFEuser();
     $this->timeTracker->pull();
     // Initializing a possible logged-in Backend User
     /** @var $GLOBALS['BE_USER'] \TYPO3\CMS\Backend\FrontendBackendUserAuthentication */
     $GLOBALS['BE_USER'] = $this->controller->initializeBackendUser();
     // Process the ID, type and other parameters.
     // After this point we have an array, $page in TSFE, which is the page-record
     // of the current page, $id.
     $this->timeTracker->push('Process ID', '');
     // Initialize admin panel since simulation settings are required here:
     if ($this->controller->isBackendUserLoggedIn()) {
         $GLOBALS['BE_USER']->initializeAdminPanel();
         $this->bootstrap->initializeBackendRouter()->loadExtensionTables();
     } else {
         $this->bootstrap->loadCachedTca();
     }
     $this->controller->checkAlternativeIdMethods();
     $this->controller->clear_preview();
     $this->controller->determineId();
     // Now, if there is a backend user logged in and he has NO access to this page,
     // then re-evaluate the id shown! _GP('ADMCMD_noBeUser') is placed here because
     // \TYPO3\CMS\Version\Hook\PreviewHook might need to know if a backend user is logged in.
     if ($this->controller->isBackendUserLoggedIn() && (!$GLOBALS['BE_USER']->extPageReadAccess($this->controller->page) || GeneralUtility::_GP('ADMCMD_noBeUser'))) {
         // Remove user
         unset($GLOBALS['BE_USER']);
         $this->controller->beUserLogin = false;
         // Re-evaluate the page-id.
         $this->controller->checkAlternativeIdMethods();
         $this->controller->clear_preview();
         $this->controller->determineId();
     }
     $this->controller->makeCacheHash();
     $this->timeTracker->pull();
     // Admin Panel & Frontend editing
     if ($this->controller->isBackendUserLoggedIn()) {
         $GLOBALS['BE_USER']->initializeFrontendEdit();
         if ($GLOBALS['BE_USER']->adminPanel instanceof AdminPanelView) {
             $this->bootstrap->initializeLanguageObject();
         }
         if ($GLOBALS['BE_USER']->frontendEdit instanceof FrontendEditingController) {
             $GLOBALS['BE_USER']->frontendEdit->initConfigOptions();
         }
     }
     // Starts the template
     $this->timeTracker->push('Start Template', '');
     $this->controller->initTemplate();
     $this->timeTracker->pull();
     // Get from cache
     $this->timeTracker->push('Get Page from cache', '');
     $this->controller->getFromCache();
     $this->timeTracker->pull();
     // Get config if not already gotten
     // After this, we should have a valid config-array ready
     $this->controller->getConfigArray();
     // Setting language and locale
     $this->timeTracker->push('Setting language and locale', '');
     $this->controller->settingLanguage();
     $this->controller->settingLocale();
     $this->timeTracker->pull();
     // Convert POST data to utf-8 for internal processing if metaCharset is different
     $this->controller->convPOSTCharset();
     $this->controller->initializeRedirectUrlHandlers();
     $this->controller->handleDataSubmission();
     // Check for shortcut page and redirect
     $this->controller->checkPageForShortcutRedirect();
     $this->controller->checkPageForMountpointRedirect();
     // Generate page
     $this->controller->setUrlIdToken();
     $this->timeTracker->push('Page generation', '');
     if ($this->controller->isGeneratePage()) {
         $this->controller->generatePage_preProcessing();
         $temp_theScript = $this->controller->generatePage_whichScript();
         if ($temp_theScript) {
             include $temp_theScript;
         } else {
             PageGenerator::pagegenInit();
             // Global content object
             $this->controller->newCObj();
             // Content generation
             if (!$this->controller->isINTincScript()) {
                 PageGenerator::renderContent();
                 $this->controller->setAbsRefPrefix();
             }
         }
         $this->controller->generatePage_postProcessing();
     } elseif ($this->controller->isINTincScript()) {
         PageGenerator::pagegenInit();
         // Global content object
         $this->controller->newCObj();
     }
     $this->controller->releaseLocks();
     $this->timeTracker->pull();
     // Render non-cached parts
     if ($this->controller->isINTincScript()) {
         $this->timeTracker->push('Non-cached objects', '');
         $this->controller->INTincScript();
         $this->timeTracker->pull();
     }
     // Output content
     $sendTSFEContent = false;
     if ($this->controller->isOutputting()) {
         $this->timeTracker->push('Print Content', '');
         $this->controller->processOutput();
         $sendTSFEContent = true;
         $this->timeTracker->pull();
     }
     // Store session data for fe_users
     $this->controller->storeSessionData();
     // Statistics
     $GLOBALS['TYPO3_MISC']['microtime_end'] = microtime(true);
     $this->controller->setParseTime();
     if (isset($this->controller->config['config']['debug'])) {
         $debugParseTime = (bool) $this->controller->config['config']['debug'];
     } else {
         $debugParseTime = !empty($this->controller->TYPO3_CONF_VARS['FE']['debug']);
     }
     if ($this->controller->isOutputting() && $debugParseTime) {
         $this->controller->content .= LF . '<!-- Parsetime: ' . $this->controller->scriptParseTime . 'ms -->';
     }
     $this->controller->redirectToExternalUrl();
     // Preview info
     $this->controller->previewInfo();
     // Hook for end-of-frontend
     $this->controller->hook_eofe();
     // Finish timetracking
     $this->timeTracker->pull();
     // Check memory usage
     MonitorUtility::peakMemoryUsage();
     // beLoginLinkIPList
     echo $this->controller->beLoginLinkIPList();
     // Admin panel
     if ($this->controller->isBackendUserLoggedIn() && $GLOBALS['BE_USER'] instanceof FrontendBackendUserAuthentication) {
         if ($GLOBALS['BE_USER']->extAdmEnabled) {
             // Style sheet is also used for frontend editing.
             $this->controller->content = str_ireplace('</head>', $GLOBALS['BE_USER']->adminPanel->getAdminPanelHeaderData() . '</head>', $this->controller->content);
         }
         if ($GLOBALS['BE_USER']->isAdminPanelVisible()) {
             $this->controller->content = str_ireplace('</body>', $GLOBALS['BE_USER']->displayAdminPanel() . '</body>', $this->controller->content);
         }
     }
     if ($sendTSFEContent) {
         /** @var \TYPO3\CMS\Core\Http\Response $response */
         $response = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Http\Response::class);
         $response->getBody()->write($this->controller->content);
     }
     // Debugging Output
     if (isset($GLOBALS['error']) && is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debugOutput'))) {
         $GLOBALS['error']->debugOutput();
     }
     if (TYPO3_DLOG) {
         GeneralUtility::devLog('END of FRONTEND session', 'cms', 0, array('_FLUSH' => true));
     }
     return $response;
 }
Example #9
0
<?php

require_once 'Classes/class.tx_odshtml2pdf.php';
// generate original content
require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('frontend') . 'Classes/Page/PageGenerator.php';
$GLOBALS['TT']->push('pagegen.php, initialize');
// Initialization of some variables
\TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
// Global content object...
$GLOBALS['TSFE']->newCObj();
$GLOBALS['TT']->pull();
// Content generation
// If this is an array, it's a sign that this script is included in order to include certain INT-scripts
if (!$GLOBALS['TSFE']->isINTincScript()) {
    $GLOBALS['TT']->push('pagegen.php, render');
    \TYPO3\CMS\Frontend\Page\PageGenerator::renderContent();
    $GLOBALS['TSFE']->setAbsRefPrefix();
    $GLOBALS['TT']->pull();
}
// instead of calling processOutput...
//---------------------------- begin ProcessOutput --------------
// substitute fe user
$token = trim($GLOBALS['TSFE']->config['config']['USERNAME_substToken']);
$token = $token ? $token : '<!--###USERNAME###-->';
if (strpos($GLOBALS['TSFE']->content, $token)) {
    $GLOBALS['TSFE']->set_no_cache();
    if ($GLOBALS['TSFE']->fe_user->user['uid']) {
        $GLOBALS['TSFE']->content = str_replace($token, $GLOBALS['TSFE']->fe_user->user['uid'], $GLOBALS['TSFE']->content);
    }
}
// Substitutes get_URL_ID in case of GET-fallback
Example #10
0
 /**
  * Generate the body content
  *
  * If there is an error, no reference to a record, a Flash Message will be
  * displayed
  *
  * @return string The body content
  */
 protected function getBodyContent($data, $table)
 {
     // template1
     $wizardView = GeneralUtility::makeInstance(\TYPO3\CMS\Fluid\View\StandaloneView::class);
     $wizardView->setFormat('html');
     $wizardView->setLayoutRootPaths([10 => ExtensionManagementUtility::extPath('cs_seo') . '/Resources/Private/Layouts/']);
     $wizardView->setTemplatePathAndFilename(ExtensionManagementUtility::extPath('cs_seo') . 'Resources/Private/Templates/Wizard.html');
     if (strpos($data['uid'], 'NEW') === false) {
         // set pageID for TSSetup check
         $pageUid = $table == 'pages' ? $data['uid'] : $data['pid'];
         $_GET['id'] = $pageUid;
         // check if TS page type exists
         /** @var BackendConfigurationManager $configurationManager */
         $backendConfigurationManager = GeneralUtility::makeInstance(BackendConfigurationManager::class);
         $fullTS = $backendConfigurationManager->getTypoScriptSetup();
         if (isset($fullTS['types.'][$this->typeNum])) {
             // render page title
             $rootline = BackendUtility::BEgetRootLine($pageUid);
             /** @var TSFEUtility $TSFEUtility */
             $TSFEUtility = GeneralUtility::makeInstance(TSFEUtility::class, $pageUid, $data['sys_language_uid']);
             $siteTitle = $TSFEUtility->getSiteTitle();
             $pageTitleSeparator = $TSFEUtility->getPageTitleSeparator();
             $config = $TSFEUtility->getConfig();
             if ($table == 'pages' || $table == 'pages_language_overlay') {
                 PageGenerator::generatePageTitle();
                 $pageTitle = static::getPageRenderer()->getTitle();
                 // get page path
                 $path = $TSFEUtility->getPagePath();
                 // TYPO3 8
                 $urlScheme = is_array($data['url_scheme']) ? $data['url_scheme'][0] : $data['url_scheme'];
                 // check if path is absolute
                 if (strpos($path, '://') !== false) {
                     $path = '';
                 }
             } else {
                 $pageTitle = $TSFEUtility->getFinalTitle($data['title'], $data['title_only']);
                 $path = '';
                 $urlScheme = 'http://';
             }
             $wizardView->assignMultiple(['config' => $config, 'domain' => BackendUtility::firstDomainRecord($rootline), 'data' => $data, 'pageTitle' => $pageTitle, 'pageTitleSeparator' => $pageTitleSeparator, 'path' => $path, 'siteTitle' => $siteTitle, 'urlScheme' => $urlScheme]);
         } else {
             $wizardView->assign('error', 'no_ts');
         }
     } else {
         $wizardView->assign('error', 'no_data');
     }
     return $wizardView->render();
 }
Example #11
0
 /**
  * Initializes a TypoScript Frontend necessary for using TypoScript and TypoLink functions
  *
  * @param int $id
  * @param int $typeNum
  *
  * @return void
  */
 protected function initTSFE($id = 1, $typeNum = 0)
 {
     \TYPO3\CMS\Frontend\Utility\EidUtility::initTCA();
     if (!is_object($GLOBALS['TT'])) {
         $GLOBALS['TT'] = new \TYPO3\CMS\Core\TimeTracker\NullTimeTracker();
         $GLOBALS['TT']->start();
     }
     $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], $id, $typeNum);
     $GLOBALS['TSFE']->sys_page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
     $GLOBALS['TSFE']->sys_page->init(TRUE);
     $GLOBALS['TSFE']->connectToDB();
     $GLOBALS['TSFE']->initFEuser();
     $GLOBALS['TSFE']->determineId();
     $GLOBALS['TSFE']->initTemplate();
     $GLOBALS['TSFE']->rootLine = $GLOBALS['TSFE']->sys_page->getRootLine($id, '');
     $GLOBALS['TSFE']->getConfigArray();
     \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
 }
 /**
  * Handles a frontend request
  *
  * @return void
  */
 public function handleRequest()
 {
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadTypo3LoadedExtAndExtLocalconf(TRUE)->applyAdditionalConfigurationSettings();
     // Timetracking started
     $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']);
     if (empty($configuredCookieName)) {
         $configuredCookieName = 'be_typo_user';
     }
     if ($_COOKIE[$configuredCookieName]) {
         $GLOBALS['TT'] = new \TYPO3\CMS\Core\TimeTracker\TimeTracker();
     } else {
         $GLOBALS['TT'] = new \TYPO3\CMS\Core\TimeTracker\NullTimeTracker();
     }
     $GLOBALS['TT']->start();
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeTypo3DbGlobal();
     // Hook to preprocess the current request:
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
             $hookParameters = array();
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
         }
         unset($hookFunction);
         unset($hookParameters);
     }
     // Look for extension ID which will launch alternative output engine
     if ($temp_extId = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('eID')) {
         if ($classPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$temp_extId])) {
             // Remove any output produced until now
             ob_clean();
             require $classPath;
         }
         die;
     }
     /** @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
     $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('type'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('no_cache'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cHash'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('jumpurl'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('MP'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('RDCT'));
     if ($GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_force'] && !\TYPO3\CMS\Core\Utility\GeneralUtility::cmpIP(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {
         $GLOBALS['TSFE']->pageUnavailableAndExit('This page is temporarily unavailable.');
     }
     $GLOBALS['TSFE']->connectToDB();
     $GLOBALS['TSFE']->sendRedirect();
     // Output compression
     // Remove any output produced until now
     ob_clean();
     if ($GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] && extension_loaded('zlib')) {
         if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'])) {
             // Prevent errors if ini_set() is unavailable (safe mode)
             @ini_set('zlib.output_compression_level', $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel']);
         }
         ob_start(array(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Utility\\CompressionUtility'), 'compressionOutputHandler'));
     }
     // FE_USER
     $GLOBALS['TT']->push('Front End user initialized', '');
     /** @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
     $GLOBALS['TSFE']->initFEuser();
     $GLOBALS['TT']->pull();
     // BE_USER
     /** @var $GLOBALS['BE_USER'] \TYPO3\CMS\Backend\FrontendBackendUserAuthentication */
     $GLOBALS['BE_USER'] = $GLOBALS['TSFE']->initializeBackendUser();
     // Process the ID, type and other parameters.
     // After this point we have an array, $page in TSFE, which is the page-record
     // of the current page, $id.
     $GLOBALS['TT']->push('Process ID', '');
     // Initialize admin panel since simulation settings are required here:
     if ($GLOBALS['TSFE']->isBackendUserLoggedIn()) {
         $GLOBALS['BE_USER']->initializeAdminPanel();
         \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(TRUE);
     } else {
         \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca();
     }
     $GLOBALS['TSFE']->checkAlternativeIdMethods();
     $GLOBALS['TSFE']->clear_preview();
     $GLOBALS['TSFE']->determineId();
     // Now, if there is a backend user logged in and he has NO access to this page,
     // then re-evaluate the id shown! _GP('ADMCMD_noBeUser') is placed here because
     // \TYPO3\CMS\Version\Hook\PreviewHook might need to know if a backend user is logged in.
     if ($GLOBALS['TSFE']->isBackendUserLoggedIn() && (!$GLOBALS['BE_USER']->extPageReadAccess($GLOBALS['TSFE']->page) || \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('ADMCMD_noBeUser'))) {
         // Remove user
         unset($GLOBALS['BE_USER']);
         $GLOBALS['TSFE']->beUserLogin = FALSE;
         // Re-evaluate the page-id.
         $GLOBALS['TSFE']->checkAlternativeIdMethods();
         $GLOBALS['TSFE']->clear_preview();
         $GLOBALS['TSFE']->determineId();
     }
     $GLOBALS['TSFE']->makeCacheHash();
     $GLOBALS['TT']->pull();
     // Admin Panel & Frontend editing
     if ($GLOBALS['TSFE']->isBackendUserLoggedIn()) {
         $GLOBALS['BE_USER']->initializeFrontendEdit();
         if ($GLOBALS['BE_USER']->adminPanel instanceof \TYPO3\CMS\Frontend\View\AdminPanelView) {
             \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeLanguageObject()->initializeSpriteManager();
         }
         if ($GLOBALS['BE_USER']->frontendEdit instanceof \TYPO3\CMS\Core\FrontendEditing\FrontendEditingController) {
             $GLOBALS['BE_USER']->frontendEdit->initConfigOptions();
         }
     }
     // Starts the template
     $GLOBALS['TT']->push('Start Template', '');
     $GLOBALS['TSFE']->initTemplate();
     $GLOBALS['TT']->pull();
     // Get from cache
     $GLOBALS['TT']->push('Get Page from cache', '');
     $GLOBALS['TSFE']->getFromCache();
     $GLOBALS['TT']->pull();
     // Get config if not already gotten
     // After this, we should have a valid config-array ready
     $GLOBALS['TSFE']->getConfigArray();
     // Setting language and locale
     $GLOBALS['TT']->push('Setting language and locale', '');
     $GLOBALS['TSFE']->settingLanguage();
     $GLOBALS['TSFE']->settingLocale();
     $GLOBALS['TT']->pull();
     // Convert POST data to internal "renderCharset" if different from the metaCharset
     $GLOBALS['TSFE']->convPOSTCharset();
     // Check JumpUrl
     $GLOBALS['TSFE']->setExternalJumpUrl();
     $GLOBALS['TSFE']->checkJumpUrlReferer();
     $GLOBALS['TSFE']->handleDataSubmission();
     // Check for shortcut page and redirect
     $GLOBALS['TSFE']->checkPageForShortcutRedirect();
     $GLOBALS['TSFE']->checkPageForMountpointRedirect();
     // Generate page
     $GLOBALS['TSFE']->setUrlIdToken();
     $GLOBALS['TT']->push('Page generation', '');
     if ($GLOBALS['TSFE']->isGeneratePage()) {
         $GLOBALS['TSFE']->generatePage_preProcessing();
         $temp_theScript = $GLOBALS['TSFE']->generatePage_whichScript();
         if ($temp_theScript) {
             include $temp_theScript;
         } else {
             \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
             // Global content object
             $GLOBALS['TSFE']->newCObj();
             // LIBRARY INCLUSION, TypoScript
             $temp_incFiles = \TYPO3\CMS\Frontend\Page\PageGenerator::getIncFiles();
             foreach ($temp_incFiles as $temp_file) {
                 include_once './' . $temp_file;
             }
             // Content generation
             if (!$GLOBALS['TSFE']->isINTincScript()) {
                 \TYPO3\CMS\Frontend\Page\PageGenerator::renderContent();
                 $GLOBALS['TSFE']->setAbsRefPrefix();
             }
         }
         $GLOBALS['TSFE']->generatePage_postProcessing();
     } elseif ($GLOBALS['TSFE']->isINTincScript()) {
         \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
         // Global content object
         $GLOBALS['TSFE']->newCObj();
         // LIBRARY INCLUSION, TypoScript
         $temp_incFiles = \TYPO3\CMS\Frontend\Page\PageGenerator::getIncFiles();
         foreach ($temp_incFiles as $temp_file) {
             include_once './' . $temp_file;
         }
     }
     $GLOBALS['TT']->pull();
     // $GLOBALS['TSFE']->config['INTincScript']
     if ($GLOBALS['TSFE']->isINTincScript()) {
         $GLOBALS['TT']->push('Non-cached objects', '');
         $GLOBALS['TSFE']->INTincScript();
         $GLOBALS['TT']->pull();
     }
     // Output content
     $sendTSFEContent = FALSE;
     if ($GLOBALS['TSFE']->isOutputting()) {
         $GLOBALS['TT']->push('Print Content', '');
         $GLOBALS['TSFE']->processOutput();
         $sendTSFEContent = TRUE;
         $GLOBALS['TT']->pull();
     }
     // Store session data for fe_users
     $GLOBALS['TSFE']->storeSessionData();
     // Statistics
     $GLOBALS['TYPO3_MISC']['microtime_end'] = microtime(TRUE);
     $GLOBALS['TSFE']->setParseTime();
     if (isset($GLOBALS['TSFE']->config['config']['debug'])) {
         $debugParseTime = (bool) $GLOBALS['TSFE']->config['config']['debug'];
     } else {
         $debugParseTime = !empty($GLOBALS['TSFE']->TYPO3_CONF_VARS['FE']['debug']);
     }
     if ($GLOBALS['TSFE']->isOutputting() && $debugParseTime) {
         $GLOBALS['TSFE']->content .= LF . '<!-- Parsetime: ' . $GLOBALS['TSFE']->scriptParseTime . 'ms -->';
     }
     // Check JumpUrl
     $GLOBALS['TSFE']->jumpurl();
     // Preview info
     $GLOBALS['TSFE']->previewInfo();
     // Hook for end-of-frontend
     $GLOBALS['TSFE']->hook_eofe();
     // Finish timetracking
     $GLOBALS['TT']->pull();
     // Check memory usage
     \TYPO3\CMS\Core\Utility\MonitorUtility::peakMemoryUsage();
     // beLoginLinkIPList
     echo $GLOBALS['TSFE']->beLoginLinkIPList();
     // Admin panel
     if ($GLOBALS['TSFE']->isBackendUserLoggedIn() && $GLOBALS['BE_USER'] instanceof \TYPO3\CMS\Backend\FrontendBackendUserAuthentication && $GLOBALS['BE_USER']->isAdminPanelVisible()) {
         $GLOBALS['TSFE']->content = str_ireplace('</head>', $GLOBALS['BE_USER']->adminPanel->getAdminPanelHeaderData() . '</head>', $GLOBALS['TSFE']->content);
         $GLOBALS['TSFE']->content = str_ireplace('</body>', $GLOBALS['BE_USER']->displayAdminPanel() . '</body>', $GLOBALS['TSFE']->content);
     }
     if ($sendTSFEContent) {
         echo $GLOBALS['TSFE']->content;
     }
     // Debugging Output
     if (isset($GLOBALS['error']) && is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debugOutput'))) {
         $GLOBALS['error']->debugOutput();
     }
     if (TYPO3_DLOG) {
         \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('END of FRONTEND session', 'cms', 0, array('_FLUSH' => TRUE));
     }
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->shutdown();
 }
 /**
  * Initializes TSFE and sets $GLOBALS['TSFE']
  *
  * @return	void
  */
 protected function initTSFE()
 {
     $GLOBALS['TSFE'] = $tsfe = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], GeneralUtility::_GP('id'), '');
     /** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $tsfe */
     $tsfe->connectToDB();
     $tsfe->initFEuser();
     \TYPO3\CMS\Frontend\Utility\EidUtility::initTCA();
     $tsfe->determineId();
     $tsfe->initTemplate();
     $tsfe->getConfigArray();
     $tsfe->settingLanguage();
     // Get linkVars, absRefPrefix, etc
     \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
 }
 /**
  * Initializes the title for the RSS feed of the current action consisting
  * of the page title and the content element header.
  *
  * @param \TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view
  */
 protected function initializeRssTitle(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view)
 {
     if (!empty($this->settings['list']['rss']['channel']['title'])) {
         $view->assign('rssTitle', $this->settings['list']['rss']['channel']['title']);
         return;
     }
     $rssTitle = $this->configurationManager->getContentObject()->data['header'];
     \TYPO3\CMS\Frontend\Page\PageGenerator::generatePageTitle();
     $rssTitle .= ' - ' . $this->getTypoScriptFrontendController()->getPageRenderer()->getTitle();
     $view->assign('rssTitle', $rssTitle);
 }
 /**
  * Initializes TSFE and sets $GLOBALS['TSFE']
  *
  * @return	void
  */
 protected function initTSFE()
 {
     $GLOBALS['TSFE'] = $tsfe = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], GeneralUtility::_GP('id'), '');
     /** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $tsfe */
     $tsfe->connectToDB();
     $tsfe->initFEuser();
     $tsfe->checkAlternativeIdMethods();
     $tsfe->determineId();
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca();
     $tsfe->initTemplate();
     $tsfe->getConfigArray();
     // Get linkVars, absRefPrefix, etc
     \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
 }
Example #16
0
        foreach ($temp_incFiles as $temp_file) {
            include_once './' . $temp_file;
        }
        // Content generation
        if (!$TSFE->isINTincScript()) {
            \TYPO3\CMS\Frontend\Page\PageGenerator::renderContent();
            $TSFE->setAbsRefPrefix();
        }
    }
    $TSFE->generatePage_postProcessing();
} elseif ($TSFE->isINTincScript()) {
    \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
    // Global content object
    $TSFE->newCObj();
    // LIBRARY INCLUSION, TypoScript
    $temp_incFiles = \TYPO3\CMS\Frontend\Page\PageGenerator::getIncFiles();
    foreach ($temp_incFiles as $temp_file) {
        include_once './' . $temp_file;
    }
}
$TT->pull();
// $TSFE->config['INTincScript']
if ($TSFE->isINTincScript()) {
    $TT->push('Non-cached objects', '');
    $TSFE->INTincScript();
    $TT->pull();
}
// Output content
$sendTSFEContent = FALSE;
if ($TSFE->isOutputting()) {
    $TT->push('Print Content', '');
Example #17
0
 /**
  * @return The parsed string.
  * @author Marc Hirdes <*****@*****.**>
  */
 public function render()
 {
     $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
     $pageRenderer->addJsFooterFile(\TYPO3\CMS\Frontend\Page\PageGenerator::inline2TempFile($this->renderChildren(), 'js'), 'text/javascript', true, false, '', true);
     return '';
 }
 /**
  * Initializes TSFE.
  * 
  * @return void
  */
 protected function initializeTsfe()
 {
     /* @var $tsfe \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
     $tsfe = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('type'), true);
     $GLOBALS['TSFE'] =& $tsfe;
     $tsfe->initFEuser();
     $tsfe->initUserGroups();
     $tsfe->checkAlternativeIdMethods();
     $tsfe->determineId();
     $tsfe->getCompressedTCarray();
     $tsfe->sys_page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
     $tsfe->initTemplate();
     $tsfe->getConfigArray();
     $tsfe->settingLanguage();
     $tsfe->settingLocale();
     $tsfe->calculateLinkVars();
     $tsfe->newCObj();
     \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
 }