Example #1
0
 /**
  * Initalize root page (TSFE and stuff)
  *
  * @param   integer $rootPageId $rootPageId
  */
 protected function _initRootPage($rootPageId)
 {
     \Metaseo\Metaseo\Utility\FrontendUtility::init($rootPageId);
 }
Example #2
0
 /**
  * Init TSFE (for simulated pagetitle)
  *
  * @param   array        $page         Page
  * @param   NULL|array   $rootLine     Rootline
  * @param   NULL|array   $pageData     Page data (recursive generated)
  * @param   NULL|array   $rootlineFull Rootline full
  * @param   NULL|integer $sysLanguage  System language
  * @return  void
  */
 protected function _initTsfe($page, $rootLine = NULL, $pageData = NULL, $rootlineFull = NULL, $sysLanguage = NULL)
 {
     static $cacheTSFE = array();
     static $lastTsSetupPid = NULL;
     $pageUid = (int) $page['uid'];
     if ($rootLine === NULL) {
         $sysPageObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
         $rootLine = $sysPageObj->getRootLine($pageUid);
         // save full rootline, we need it in TSFE
         $rootlineFull = $rootLine;
     }
     // check if current page has a ts-setup-template
     // if not, we go down the tree to the parent page
     if (count($rootLine) >= 2 && !empty($this->_templatePidList) && empty($this->_templatePidList[$pageUid])) {
         // go to parent page in rootline
         reset($rootLine);
         next($rootLine);
         $prevPage = current($rootLine);
         // strip current page from rootline
         reset($rootLine);
         $currPageIndex = key($rootLine);
         unset($rootLine[$currPageIndex]);
         \Metaseo\Metaseo\Utility\FrontendUtility::init($prevPage['uid'], $rootLine, $pageData, $rootlineFull, $sysLanguage);
     }
     \Metaseo\Metaseo\Utility\FrontendUtility::init($page['uid'], $rootLine, $pageData, $rootlineFull, $sysLanguage);
 }