2 namespace TYPO3\CMS\InfoPagetsconfig\Controller;
39 $this->
getLanguageService()->includeLLFile(
'EXT:info_pagetsconfig/Resources/Private/Language/locallang.xlf');
51 'tsconf_parts' => array(
52 0 =>
$lang->getLL(
'tsconf_parts_0'),
53 1 =>
$lang->getLL(
'tsconf_parts_1'),
54 '1a' =>
$lang->getLL(
'tsconf_parts_1a'),
55 '1b' =>
$lang->getLL(
'tsconf_parts_1b'),
56 '1c' =>
$lang->getLL(
'tsconf_parts_1c'),
57 '1d' =>
$lang->getLL(
'tsconf_parts_1d'),
58 '1e' =>
$lang->getLL(
'tsconf_parts_1e'),
59 '1f' =>
$lang->getLL(
'tsconf_parts_1f'),
60 '1g' =>
$lang->getLL(
'tsconf_parts_1g'),
66 99 =>
$lang->getLL(
'tsconf_configFields')
68 'tsconf_alphaSort' =>
'1'
71 unset($modMenuAdd[
'tsconf_parts'][99]);
85 return '<div class="nowrap"><div class="table-fit"><table class="table table-striped table-hover" id="tsconfig-overview">' .
88 '<th>' .
$lang->getLL(
'pagetitle') .
'</th>' .
89 '<th>' .
$lang->getLL(
'included_tsconfig_files') .
'</th>' .
90 '<th>' .
$lang->getLL(
'written_tsconfig_lines') .
'</th>' .
96 $menu =
'<div class="form-inline form-inline-spaced">';
97 $menu .=
BackendUtility::getDropdownMenu($this->pObj->id,
'SET[tsconf_parts]', $this->pObj->MOD_SETTINGS[
'tsconf_parts'], $this->pObj->MOD_MENU[
'tsconf_parts']);
98 $menu .=
'<div class="checkbox"><label for="checkTsconf_alphaSort">' .
BackendUtility::getFuncCheck($this->pObj->id,
'SET[tsconf_alphaSort]', $this->pObj->MOD_SETTINGS[
'tsconf_alphaSort'],
'',
'',
'id="checkTsconf_alphaSort"') .
' ' . $this->
getLanguageService()->getLL(
'sort_alphabetic',
true) .
'</label></div>';
100 $theOutput = $this->pObj->doc->header($this->
getLanguageService()->getLL(
'tsconf_title'));
102 if ($this->pObj->MOD_SETTINGS[
'tsconf_parts'] == 99) {
106 foreach ($TSparts as $k => $v) {
108 if ($k ==
'defaultPageTSconfig') {
109 $pTitle =
'<strong>' . $this->
getLanguageService()->getLL(
'editTSconfig_default',
true) .
'</strong>';
112 $pUids[] = substr($k, 4);
114 $pTitle = $this->pObj->doc->getHeader(
'pages', $row,
'',
false);
115 $editIdList = substr($k, 4);
119 $editIdList =>
'edit',
122 'columnsOnly' =>
'TSconfig',
125 $url = BackendUtility::getModuleUrl(
'record_edit', $urlParameters);
126 $editIcon =
'<a href="' . htmlspecialchars(
$url) .
'" title="' . $this->
getLanguageService()->getLL(
'editTSconfig',
true) .
'">' . $this->iconFactory->getIcon(
'actions-document-open',
Icon::SIZE_SMALL)->render() .
'</a>';
128 $TScontent = nl2br(htmlspecialchars(trim($v) . LF));
130 $tsparser->lineNumberOffset = 0;
131 $TScontent = $tsparser->doSyntaxHighlight(trim($v) . LF);
133 <tr><td nowrap="nowrap" class="bgColor5">' . $pTitle .
'</td></tr>
134 <tr><td nowrap="nowrap" class="bgColor4">' . $TScontent . $editIcon .
'</td></tr>
135 <tr><td> </td></tr>
139 if (!empty($pUids)) {
143 implode(
',', $pUids) =>
'edit',
146 'columnsOnly' =>
'TSconfig',
149 $url = BackendUtility::getModuleUrl(
'record_edit', $urlParameters);
150 $editIcon =
'<a href="' . htmlspecialchars(
$url) .
'" title="' . $this->
getLanguageService()->getLL(
'editTSconfig_all',
true) .
'">' . $this->iconFactory->getIcon(
'actions-document-open',
Icon::SIZE_SMALL)->render() .
'<strong>' . $this->
getLanguageService()->getLL(
'editTSconfig_all',
true) .
'</strong>' .
'</a>';
154 $theOutput .=
'<div>';
156 <!-- Edit fields: -->
157 <table border="0" cellpadding="0" cellspacing="1">' . implode(
'', $lines) .
'</table><br />' . $editIcon;
158 $theOutput .=
'</div>';
167 $tmpl->linkObjects = 0;
169 $tmpl->ext_expandAllNotes = 1;
170 $tmpl->ext_noPMicons = 1;
173 switch ($this->pObj->MOD_SETTINGS[
'tsconf_parts']) {
217 $modTSconfig = $modTSconfig[
'properties'];
218 if (!is_array($modTSconfig)) {
219 $modTSconfig = array();
223 $tree = $tmpl->ext_getObjTree($modTSconfig,
'',
'',
'',
'', $this->pObj->MOD_SETTINGS[
'tsconf_alphaSort']);
225 $theOutput .=
'<div>';
226 $theOutput .= $csh . $menu .
'<div class="nowrap">' . $tree .
'</div>';
227 $theOutput .=
'</div>';
242 $res = $db->exec_SELECTquery(
248 $pageArray = array();
249 while ($row = $db->sql_fetch_assoc($res)) {
267 ksort($rootlineArray);
268 reset($rootlineArray);
269 if (!$rootlineArray[0][
'uid']) {
270 array_shift($rootlineArray);
272 $currentElement = current($rootlineArray);
273 $hierarchicArray[$currentElement[
'uid']] = htmlspecialchars($currentElement[
'title']);
274 array_shift($rootlineArray);
275 if (!empty($rootlineArray)) {
276 if (!isset($hierarchicArray[($currentElement[
'uid'] .
'.')])) {
277 $hierarchicArray[$currentElement[
'uid'] .
'.'] = array();
279 $this->
setInPageArray($hierarchicArray[$currentElement[
'uid'] .
'.'], $rootlineArray, $row);
295 $out[
'uid'] = $row[
'uid'];
297 foreach ($lines as $line) {
298 if (strpos($line,
'<INCLUDE_TYPOSCRIPT:') !==
false) {
302 $out[
'includeLines'] = $includeLines;
303 $out[
'writtenLines'] = (count($lines) - $includeLines);
316 protected function renderList($pageArray, $lines = array(), $pageDepth = 0)
318 $cellStyle =
'padding-left: ' . ($pageDepth * 20) .
'px';
319 if (!is_array($pageArray)) {
323 foreach ($pageArray as $identifier => $_) {
327 if (isset($pageArray[$identifier .
'_'])) {
330 <td nowrap style="' . $cellStyle .
'">
333 .
'" title="' . htmlspecialchars(
'ID: ' . $identifier) .
'">'
336 <td>' . ($pageArray[($identifier .
'_')][
'includeLines'] === 0 ?
'' : $pageArray[($identifier .
'_')][
'includeLines']) .
'</td>
337 <td>' . ($pageArray[$identifier .
'_'][
'writtenLines'] === 0 ?
'' : $pageArray[$identifier .
'_'][
'writtenLines']) .
'</td>
341 <td nowrap style="' . $cellStyle .
'">'
348 $lines = $this->
renderList($pageArray[$identifier .
'.'], $lines, $pageDepth + 1);