47 'pObj' =>
'Using InfoPageTyposcriptConfigController::$pObj is deprecated and will not be possible anymore in TYPO3 v10.0.',
48 'function_key' =>
'Using InfoPageTyposcriptConfigController::$function_key is deprecated, property will be removed in TYPO3 v10.0.',
49 'extClassConf' =>
'Using InfoPageTyposcriptConfigController::$extClassConf is deprecated, property will be removed in TYPO3 v10.0.',
50 'localLangFile' =>
'Using InfoPageTyposcriptConfigController::$localLangFile is deprecated, property will be removed in TYPO3 v10.0.',
51 'extObj' =>
'Using InfoPageTyposcriptConfigController::$extObj is deprecated, property will be removed in TYPO3 v10.0.',
58 'modMenu' =>
'Using InfoPageTyposcriptConfigController::modMenu() is deprecated and will not be possible anymore in TYPO3 v10.0.',
59 'extObjContent' =>
'Using InfoPageTyposcriptConfigController::extObjContent() is deprecated, method will be removed in TYPO3 v10.0.',
109 $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
111 $languageService->includeLLFile(
'EXT:info/Resources/Private/Language/InfoPageTsConfig.xlf');
115 if (!empty($this->localLangFile)) {
117 $languageService->includeLLFile($this->localLangFile);
119 $this->
id = (int)GeneralUtility::_GP(
'id');
121 $this->pObj->MOD_MENU = array_merge($this->pObj->MOD_MENU, $this->modMenu());
129 public function main()
131 $pageId = (int)GeneralUtility::_GP(
'id');
132 $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
135 $this->view->assign(
'pageZero', 1);
137 if (count($pagesUsingTSConfig) > 0) {
138 $this->view->assign(
'overviewOfPagesUsingTSConfig', $pagesUsingTSConfig);
141 if ($this->pObj->MOD_SETTINGS[
'tsconf_parts'] == 99) {
146 foreach ($TSparts as $k => $v) {
147 if ($k !==
'uid_0') {
149 if ($k ===
'defaultPageTSconfig') {
150 $line[
'defaultPageTSconfig'] = 1;
152 $editIdList = substr($k, 4);
153 $pUids[] = $editIdList;
160 $editIdList =>
'edit',
163 'columnsOnly' =>
'TSconfig',
164 'returnUrl' => GeneralUtility::getIndpEnv(
'REQUEST_URI')
166 $line[
'editIcon'] = (string)$uriBuilder->buildUriFromRoute(
'record_edit', $urlParameters);
167 $line[
'editTitle'] =
'editTSconfig';
171 $tsparser = GeneralUtility::makeInstance(TypoScriptParser::class);
172 $tsparser->lineNumberOffset = 0;
173 $line[
'content'] = $tsparser->doSyntaxHighlight(trim($v) . LF);
178 if (!empty($pUids)) {
182 implode(
',', $pUids) =>
'edit',
185 'columnsOnly' =>
'TSconfig',
186 'returnUrl' => GeneralUtility::getIndpEnv(
'REQUEST_URI')
188 $url = (string)$uriBuilder->buildUriFromRoute(
'record_edit', $urlParameters);
189 $editIcon = htmlspecialchars($url);
190 $editTitle =
'editTSconfig_all';
196 $this->view->assign(
'tsconfParts99', 1);
198 $this->view->assign(
'lines', $lines);
199 $this->view->assign(
'editIcon', $editIcon);
200 $this->view->assign(
'editTitle', $editTitle);
202 $this->view->assign(
'tsconfParts99', 0);
204 $tmpl = GeneralUtility::makeInstance(ExtendedTemplateService::class);
205 $tmpl->ext_expandAllNotes = 1;
206 $tmpl->ext_noPMicons = 1;
209 switch ($this->pObj->MOD_SETTINGS[
'tsconf_parts']) {
211 $pageTsConfig = $pageTsConfig[
'mod.'] ?? [];
214 $pageTsConfig = $pageTsConfig[
'mod.'][
'web_layout.'] ?? [];
217 $pageTsConfig = $pageTsConfig[
'mod.'][
'web_view.'] ?? [];
220 $pageTsConfig = $pageTsConfig[
'mod.'][
'web_modules.'] ?? [];
223 $pageTsConfig = $pageTsConfig[
'mod.'][
'web_list.'] ?? [];
226 $pageTsConfig = $pageTsConfig[
'mod.'][
'web_info.'] ?? [];
229 $pageTsConfig = $pageTsConfig[
'mod.'][
'web_func.'] ?? [];
232 $pageTsConfig = $pageTsConfig[
'mod.'][
'web_ts.'] ?? [];
235 $pageTsConfig = $pageTsConfig[
'RTE.'] ?? [];
238 $pageTsConfig = $pageTsConfig[
'TCEFORM.'] ?? [];
241 $pageTsConfig = $pageTsConfig[
'TCEMAIN.'] ?? [];
244 $pageTsConfig = $pageTsConfig[
'TSFE.'] ?? [];
247 $pageTsConfig = $pageTsConfig[
'TCAdefaults.'] ?? [];
250 $pageTsConfig = $pageTsConfig[
'user.'] ?? [];
257 $this->view->assign(
'tree', $tmpl->ext_getObjTree($pageTsConfig,
'',
'',
'',
'', $this->pObj->MOD_SETTINGS[
'tsconf_alphaSort']));
259 $this->view->assign(
'alphaSort',
BackendUtility::getFuncCheck($this->
id,
'SET[tsconf_alphaSort]', $this->pObj->MOD_SETTINGS[
'tsconf_alphaSort'],
'',
'',
'id="checkTsconf_alphaSort"'));
260 $this->view->assign(
'dropdownMenu',
BackendUtility::getDropdownMenu($this->
id,
'SET[tsconf_parts]', $this->pObj->MOD_SETTINGS[
'tsconf_parts'], $this->pObj->MOD_MENU[
'tsconf_parts']));
262 return $this->view->render();
275 0 => $lang->getLL(
'tsconf_parts_0'),
276 1 => $lang->getLL(
'tsconf_parts_1'),
277 '1a' => $lang->getLL(
'tsconf_parts_1a'),
278 '1b' => $lang->getLL(
'tsconf_parts_1b'),
279 '1c' => $lang->getLL(
'tsconf_parts_1c'),
280 '1d' => $lang->getLL(
'tsconf_parts_1d'),
281 '1e' => $lang->getLL(
'tsconf_parts_1e'),
282 '1f' => $lang->getLL(
'tsconf_parts_1f'),
283 '1g' => $lang->getLL(
'tsconf_parts_1g'),
290 99 => $lang->getLL(
'tsconf_configFields')
292 'tsconf_alphaSort' =>
'1'
295 unset($modMenuAdd[
'tsconf_parts'][99]);
307 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(
'pages');
308 $queryBuilder->getRestrictions()
310 ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
311 ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
314 ->select(
'uid',
'TSconfig')
317 $queryBuilder->expr()->neq(
319 $queryBuilder->createNamedParameter(
'', \PDO::PARAM_STR)
326 while ($row = $res->fetch()) {
341 protected function setInPageArray(&$hierarchicArray, $rootlineArray, $row)
343 ksort($rootlineArray);
344 reset($rootlineArray);
345 if (!$rootlineArray[0][
'uid']) {
346 array_shift($rootlineArray);
348 $currentElement = current($rootlineArray);
349 $hierarchicArray[$currentElement[
'uid']] = htmlspecialchars($currentElement[
'title']);
350 array_shift($rootlineArray);
351 if (!empty($rootlineArray)) {
352 if (!isset($hierarchicArray[$currentElement[
'uid'] .
'.'])) {
353 $hierarchicArray[$currentElement[
'uid'] .
'.'] = [];
355 $this->
setInPageArray($hierarchicArray[$currentElement[
'uid'] .
'.'], $rootlineArray, $row);
371 $out[
'uid'] = $row[
'uid'];
372 $lines = GeneralUtility::trimExplode(
"\r\n", $row[
'TSconfig']);
373 foreach ($lines as $line) {
374 if (strpos($line,
'<INCLUDE_TYPOSCRIPT:') !==
false) {
378 $out[
'includeLines'] = $includeLines;
379 $out[
'writtenLines'] = (count($lines) - $includeLines);
392 protected function getList($pageArray, $lines = [], $pageDepth = 0)
394 if (!is_array($pageArray)) {
398 foreach ($pageArray as $identifier => $_) {
403 $line[
'padding'] = ($pageDepth * 20) + 10;
404 if (isset($pageArray[$identifier .
'_'])) {
405 $line[
'link'] = GeneralUtility::linkThisScript([
'id' => $identifier]);
407 $line[
'title'] =
'ID: ' . $identifier;
408 $line[
'pageTitle'] = GeneralUtility::fixed_lgd_cs($pageArray[$identifier], 30);
409 $line[
'includedFiles'] = ($pageArray[$identifier .
'_'][
'includeLines'] === 0 ?
'' : $pageArray[$identifier .
'_'][
'includeLines']);
410 $line[
'lines'] = ($pageArray[$identifier .
'_'][
'writtenLines'] === 0 ?
'' : $pageArray[$identifier .
'_'][
'writtenLines']);
415 $line[
'pageTitle'] = GeneralUtility::fixed_lgd_cs($pageArray[$identifier], 30);
416 $line[
'includedFiles'] =
'';
420 $lines = $this->
getList($pageArray[$identifier .
'.'], $lines, $pageDepth + 1);
432 $view = GeneralUtility::makeInstance(StandaloneView::class);
450 if (is_array($this->extClassConf) && $this->extClassConf[
'name']) {
451 $this->extObj = GeneralUtility::makeInstance($this->extClassConf[
'name']);
452 $this->extObj->init($this->pObj, $this->extClassConf);
465 if (is_object($this->extObj)) {
466 return $this->extObj->main();