/** * Construcor of this object */ public function __construct($pObj) { parent::__construct($pObj); $this->templavoilaIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('templavoila'); if ($this->templavoilaIsLoaded) { $enableFields = TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('pages') . TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages'); $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid,title', 'pages', 'pid = 0' . $enableFields); $GLOBALS['TT'] = new t3lib_timeTrackNull(); $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], $row['uid'], 0); $GLOBALS['TSFE']->sys_page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_pageSelect'); $GLOBALS['TSFE']->sys_page->init(TRUE); $GLOBALS['TSFE']->initTemplate(); // Filling the config-array, first with the main "config." part if (is_array($GLOBALS['TSFE']->tmpl->setup['config.'])) { $GLOBALS['TSFE']->config['config'] = $GLOBALS['TSFE']->tmpl->setup['config.']; } // override it with the page/type-specific "config." if (is_array($GLOBALS['TSFE']->pSetup['config.'])) { $GLOBALS['TSFE']->config['config'] = TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($GLOBALS['TSFE']->config['config'], $GLOBALS['TSFE']->pSetup['config.']); } // generate basic rootline $GLOBALS['TSFE']->rootLine = array(0 => array('uid' => $row['uid'], 'title' => $row['title'])); $this->tv = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_templavoila_pi1'); } $this->counter = 0; foreach ($this->indexCTypes as $value) { $cTypes[] = 'CType="' . $value . '"'; } $this->whereClauseForCType = implode(' OR ', $cTypes); // get all available sys_language_uid records $this->sysLanguages = TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages(); }