3 namespace TYPO3\CMS\Frontend\Controller;
52 0 =>
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_0'),
53 1 =>
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_1'),
54 2 =>
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_2'),
55 3 =>
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_3'),
56 4 =>
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_4'),
57 999 =>
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_infi')
62 $menuArray[
'lang'] = array(
65 foreach (
$lang as $langRec) {
66 $menuArray[
'lang'][$langRec[
'uid']] = $langRec[
'title'];
78 $theOutput = $this->pObj->doc->header($this->
getLanguageService()->sL(
'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_title'));
79 if ($this->pObj->id) {
81 $theOutput .=
'<div class="form-inline form-inline-spaced">';
84 $theOutput .= $h_func;
87 $theOutput .=
'</div>';
90 $treeStartingPoint = (int)$this->pObj->id;
92 $depth = $this->pObj->MOD_SETTINGS[
'depth'];
95 $tree->init(
'AND ' . $this->
getBackendUser()->getPagePermsClause(1));
96 $tree->addField(
'l18n_cfg');
98 $HTML = $this->iconFactory->getIconForRecord(
'pages', $treeStartingRecord,
Icon::SIZE_SMALL)->render();
99 $tree->tree[] = array(
100 'row' => $treeStartingRecord,
105 $tree->getTree($treeStartingPoint, $depth,
'');
129 $langRecUids = array();
130 foreach ($tree->tree as $data) {
132 $langRecUids[0][] = $data[
'row'][
'uid'];
134 $tCells[] =
'<td' . ($data[
'row'][
'_CSSCLASS'] ?
' class="' . $data[
'row'][
'_CSSCLASS'] .
'"' :
'') .
'>' .
135 ($data[
'depthData'] ?:
'') .
137 '<a href="#" onclick="' . htmlspecialchars(
138 'top.loadEditId(' . (
int)$data[
'row'][
'uid'] .
',"&SET[language]=0"); return false;'
139 ) .
'" title="' .
$lang->sL(
'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPage') .
'">' .
142 ((string)$data[
'row'][
'nav_title'] !==
'' ?
' [Nav: <em>' . htmlspecialchars(
GeneralUtility::fixed_lgd_cs($data[
'row'][
'nav_title'], $titleLen)) .
'</em>]' :
'') .
147 $data[
'row'][
'uid'],
'',
'',
'',
'',
'&L=###LANG_UID###')
148 ) .
'" class="btn btn-default" title="' .
$lang->sL(
'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_viewPage') .
'">' .
149 $this->iconFactory->getIcon(
'actions-document-view',
Icon::SIZE_SMALL)->render() .
'</a>';
150 $status = $data[
'row'][
'l18n_cfg'] & 1 ?
'danger' :
'success';
152 $editUrl = BackendUtility::getModuleUrl(
'record_edit', [
155 $data[
'row'][
'uid'] =>
'edit'
160 $info =
'<a href="' . htmlspecialchars($editUrl)
161 .
'" class="btn btn-default" title="' .
$lang->sL(
162 'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editDefaultLanguagePage'
163 ) .
'">' . $this->iconFactory->getIcon(
'actions-document-open',
Icon::SIZE_SMALL)->render() .
'</a>';
164 $info .= str_replace(
'###LANG_UID###',
'0', $viewPageLink);
166 $info .= $data[
'row'][
'l18n_cfg'] & 1 ?
'<span title="' .
$lang->sL(
'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.l18n_cfg.I.1',
true) .
'">D</span>' :
' ';
167 $info .=
GeneralUtility::hideIfNotTranslated($data[
'row'][
'l18n_cfg']) ?
'<span title="' .
$lang->sL(
'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.l18n_cfg.I.2',
true) .
'">N</span>' :
' ';
169 $tCells[] =
'<td class="' . $status .
' col-border-left btn-group">' . $info .
'</td>';
170 $tCells[] =
'<td class="' . $status .
'" title="' .
$lang->sL(
171 'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_CEcount'
174 $disableLanguages = isset($modSharedTSconfig[
'properties'][
'disableLanguages']) ?
GeneralUtility::trimExplode(
',', $modSharedTSconfig[
'properties'][
'disableLanguages'],
true) : array();
176 foreach ($languages as $langRow) {
177 if ($this->pObj->MOD_SETTINGS[
'lang'] == 0 || (
int)$this->pObj->MOD_SETTINGS[
'lang'] === (
int)$langRow[
'uid']) {
178 $row = $this->
getLangStatus($data[
'row'][
'uid'], $langRow[
'uid']);
180 if (is_array($row)) {
181 $langRecUids[$langRow[
'uid']][] = $row[
'uid'];
183 $icon = $this->iconFactory->getIconForRecord(
'pages_language_overlay', $row,
Icon::SIZE_SMALL)->render();
184 $info = $icon . htmlspecialchars(
186 ) . ((string)$row[
'nav_title'] !==
'' ?
' [Nav: <em>' . htmlspecialchars(
188 ) .
'</em>]' :
'') . ($row[
'_COUNT'] > 1 ?
'<div>' .
$lang->sL(
189 'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_badThingThereAre'
191 $tCells[] =
'<td class="' . $status .
' col-border-left">' .
192 '<a href="#" onclick="' . htmlspecialchars(
193 'top.loadEditId(' . (
int)$data[
'row'][
'uid'] .
',"&SET[language]=' . $langRow[
'uid'] .
'"); return false;'
194 ) .
'" title="' .
$lang->sL(
195 'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPageLang'
196 ) .
'">' . $info .
'</a></td>';
199 $editUrl = BackendUtility::getModuleUrl(
'record_edit', [
201 'pages_language_overlay' => [
202 $row[
'uid'] =>
'edit'
207 $info =
'<a href="' . htmlspecialchars($editUrl)
208 .
'" class="btn btn-default" title="' .
$lang->sL(
209 'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editLanguageOverlayRecord'
210 ) .
'">' . $this->iconFactory->getIcon(
'actions-document-open',
Icon::SIZE_SMALL)->render() .
'</a>';
211 $info .= str_replace(
'###LANG_UID###', $langRow[
'uid'], $viewPageLink);
212 $tCells[] =
'<td class="' . $status .
' btn-group">' . $info .
'</td>';
213 $tCells[] =
'<td class="' . $status .
'" title="' .
$lang->sL(
214 'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_CEcount'
217 if (in_array($langRow[
'uid'], $disableLanguages)) {
223 $info =
'<input type="checkbox" name="newOL[' . $langRow[
'uid'] .
'][' . $data[
'row'][
'uid'] .
']" value="1" />';
224 $newOL_js[$langRow[
'uid']] .=
'
225 +(document.webinfoForm['
232 $tCells[] =
'<td class="' . $status .
' col-border-left"> </td>';
233 $tCells[] =
'<td class="' . $status .
'"> </td>';
234 $tCells[] =
'<td class="' . $status .
'">' . $info .
'</td>';
246 $tCells[] =
'<td>' .
$lang->sL(
'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_page') .
':</td>';
247 if (is_array($langRecUids[0])) {
248 $editUrl = BackendUtility::getModuleUrl(
'record_edit', [
251 implode(
',', $langRecUids[0]) =>
'edit'
254 'columnsOnly' =>
'title,nav_title,l18n_cfg,hidden',
257 $editIco =
'<a href="' . htmlspecialchars($editUrl)
258 .
'" class="btn btn-default" title="' .
$lang->sL(
259 'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPageProperties'
260 ) .
'">' . $this->iconFactory->getIcon(
'actions-document-open',
Icon::SIZE_SMALL)->render() .
'</a>';
264 $tCells[] =
'<td class="col-border-left" colspan="2">' .
$lang->sL(
265 'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_default'
266 ) .
':' . $editIco .
'</td>';
267 foreach ($languages as $langRow) {
268 if ($this->pObj->MOD_SETTINGS[
'lang'] == 0 || (
int)$this->pObj->MOD_SETTINGS[
'lang'] === (
int)$langRow[
'uid']) {
270 $tCells[] =
'<td class="col-border-left">' . htmlspecialchars($langRow[
'title']) .
'</td>';
272 if (is_array($langRecUids[$langRow[
'uid']])) {
273 $editUrl = BackendUtility::getModuleUrl(
'record_edit', [
275 'pages_language_overlay' => [
276 implode(
',', $langRecUids[$langRow[
'uid']]) =>
'edit'
279 'columnsOnly' =>
'title,nav_title,hidden',
282 $editButton =
'<a href="' . htmlspecialchars($editUrl)
283 .
'" class="btn btn-default" title="' .
$lang->sL(
284 'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editLangOverlays'
285 ) .
'">' . $this->iconFactory->getIcon(
'actions-document-open',
Icon::SIZE_SMALL)->render() .
'</a>';
290 $params =
'&columnsOnly=title,hidden,sys_language_uid&overrideVals[pages_language_overlay][sys_language_uid]=' . $langRow[
'uid'];
292 if (!empty($newOL_js[$langRow[
'uid']])) {
293 $onClickArray = explode(
'?', $onClick, 2);
294 $lastElement = array_pop($onClickArray);
295 array_push($onClickArray,
'\'' . $newOL_js[$langRow[
'uid']] .
' + \'&' . $lastElement);
296 $onClick = implode(
'?', $onClickArray);
298 $newButton =
'<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($onClick)
299 .
'" title="' .
$lang->sL(
300 'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_getlangsta_createNewTranslationHeaders'
301 ) .
'">' . $this->iconFactory->getIcon(
'actions-document-new',
Icon::SIZE_SMALL)->render() .
'</a>';
303 $tCells[] =
'<td class="btn-group">' . $editButton . $newButton .
'</td>';
304 $tCells[] =
'<td> </td>';
309 '<div class="table-fit">' .
310 '<table class="table table-striped table-hover" id="langTable">' .
313 implode(
'', $tCells) .
332 $allowed_languages = array_flip(explode(
',', $this->
getBackendUser()->groupData[
'allowed_languages']));
335 $outputArray = array();
337 if (is_array($allowed_languages) && !empty($allowed_languages)) {
338 if (isset($allowed_languages[$row[
'uid']])) {
339 $outputArray[] = $row;
342 $outputArray[] = $row;
360 'pages_language_overlay',
361 'pid=' . (
int)$pageId .
362 ' AND sys_language_uid=' . (
int)$langId .
368 if (is_array($row)) {
370 $row[
'_HIDDEN'] = $row[
'hidden'] || (int)$row[
'endtime'] > 0 && (
int)$row[
'endtime'] <
$GLOBALS[
'EXEC_TIME'] ||
$GLOBALS[
'EXEC_TIME'] < (int)$row[
'starttime'];
385 return $count ?:
'-';