48 'pObj' =>
'Using TranslationStatusController::$pObj is deprecated and will not be possible anymore in TYPO3 v10.0.',
49 'function_key' =>
'Using TranslationStatusController::function_key$ is deprecated, property will be removed in TYPO3 v10.0.',
50 'extClassConf' =>
'Using TranslationStatusController::$extClassConf is deprecated, property will be removed in TYPO3 v10.0.',
51 'localLangFile' =>
'Using TranslationStatusController::$localLangFile is deprecated, property will be removed in TYPO3 v10.0.',
52 'extObj' =>
'Using TranslationStatusController::$extObj is deprecated, property will be removed in TYPO3 v10.0.',
59 'getContentElementCount' =>
'Using TranslationStatusController::getContentElementCount() is deprecated and will not be possible anymore in TYPO3 v10.0.',
60 'getLangStatus' =>
'Using TranslationStatusController::getLangStatus() is deprecated and will not be possible anymore in TYPO3 v10.0.',
61 'renderL10nTable' =>
'Using TranslationStatusController::renderL10nTable() is deprecated and will not be possible anymore in TYPO3 v10.0.',
62 'modMenu' =>
'Using TranslationStatusController::modMenu() is deprecated and will not be possible anymore in TYPO3 v10.0.',
63 'extObjContent' =>
'Using TranslationStatusController::extObjContent() is deprecated, method will be removed in TYPO3 v10.0.',
113 $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
114 $this->
id = (int)GeneralUtility::_GP(
'id');
118 if (!empty($this->localLangFile)) {
123 $this->pObj->MOD_MENU = array_merge($this->pObj->MOD_MENU, $this->modMenu());
131 public function main()
133 $theOutput =
'<h1>' . htmlspecialchars($this->
getLanguageService()->sL(
'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_title')) .
'</h1>';
138 $theOutput .=
'<div class="form-inline form-inline-spaced">';
141 $theOutput .= $h_func;
143 $theOutput .=
BackendUtility::cshItem(
'_MOD_web_info',
'lang',
null,
'<div class="form-group"><span class="btn btn-default btn-sm">|</span></div><br />');
144 $theOutput .=
'</div>';
147 $treeStartingPoint = (int)$this->
id;
149 $depth = $this->pObj->MOD_SETTINGS[
'depth'];
151 $tree = GeneralUtility::makeInstance(PageTreeView::class);
153 $tree->addField(
'l18n_cfg');
155 $HTML = $this->iconFactory->getIconForRecord(
'pages', $treeStartingRecord,
Icon::SIZE_SMALL)->render();
157 'row' => $treeStartingRecord,
162 $tree->getTree($treeStartingPoint, $depth,
'');
180 0 => $lang->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
181 1 => $lang->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
182 2 => $lang->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
183 3 => $lang->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
184 4 => $lang->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
185 999 => $lang->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_infi')
189 $menuArray[
'lang'] = [];
190 foreach ($this->siteLanguages as $language) {
191 if ($language->getLanguageId() === 0) {
192 $menuArray[
'lang'][0] =
'[All]';
194 $menuArray[
'lang'][$language->getLanguageId()] = $language->getTitle();
215 $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
218 $showPageId = !empty($userTsConfig[
'options.'][
'pageTree.'][
'showPageIdWithTitle']);
220 foreach ($tree->tree as $data) {
222 $langRecUids[0][] = $data[
'row'][
'uid'];
223 $pageTitle = ($showPageId ?
'[' . (int)$data[
'row'][
'uid'] .
'] ' :
'') . GeneralUtility::fixed_lgd_cs($data[
'row'][
'title'], $titleLen);
225 $tCells[] =
'<td' . ($data[
'row'][
'_CSSCLASS'] ?
' class="' . $data[
'row'][
'_CSSCLASS'] .
'"' :
'') .
'>' .
226 ($data[
'depthData'] ?:
'') .
228 '<a href="#" onclick="' . htmlspecialchars(
229 'top.loadEditId(' . (
int)$data[
'row'][
'uid'] .
',"&SET[language]=0"); return false;'
230 ) .
'" title="' . $lang->sL(
'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPage') .
'">' .
231 htmlspecialchars($pageTitle) .
233 ((string)$data[
'row'][
'nav_title'] !==
'' ?
' [Nav: <em>' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($data[
'row'][
'nav_title'], $titleLen)) .
'</em>]' :
'') .
237 $viewPageLink =
'<a href="#" onclick="' . htmlspecialchars(
246 ) .
'" class="btn btn-default" title="' . $lang->sL(
'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_viewPage') .
'">' .
247 $this->iconFactory->getIcon(
'actions-view',
Icon::SIZE_SMALL)->render() .
'</a>';
248 $status = GeneralUtility::hideIfDefaultLanguage($data[
'row'][
'l18n_cfg']) ?
'danger' :
'success';
250 $editUrl = (string)$uriBuilder->buildUriFromRoute(
'record_edit', [
253 $data[
'row'][
'uid'] =>
'edit'
256 'returnUrl' => GeneralUtility::getIndpEnv(
'REQUEST_URI')
258 $info =
'<a href="#" onclick="' . htmlspecialchars(
267 ) .
'" class="btn btn-default" title="' . $lang->sL(
'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_viewPage') .
'">' .
268 $this->iconFactory->getIcon(
'actions-view-page',
Icon::SIZE_SMALL)->render() .
'</a>';
269 $info .=
'<a href="' . htmlspecialchars($editUrl)
270 .
'" class="btn btn-default" title="' . $lang->sL(
271 'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editDefaultLanguagePage'
272 ) .
'">' . $this->iconFactory->getIcon(
'actions-page-open',
Icon::SIZE_SMALL)->render() .
'</a>';
274 $info .= GeneralUtility::hideIfDefaultLanguage($data[
'row'][
'l18n_cfg']) ?
'<span title="' . htmlspecialchars($lang->sL(
'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.l18n_cfg.I.1')) .
'">D</span>' :
' ';
275 $info .= GeneralUtility::hideIfNotTranslated($data[
'row'][
'l18n_cfg']) ?
'<span title="' . htmlspecialchars($lang->sL(
'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.l18n_cfg.I.2')) .
'">N</span>' :
' ';
277 $tCells[] =
'<td class="' . $status .
' col-border-left"><div class="btn-group">' . $info .
'</div></td>';
278 $tCells[] =
'<td class="' . $status .
'" title="' . $lang->sL(
279 'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_CEcount'
282 foreach ($this->siteLanguages as $siteLanguage) {
283 $languageId = $siteLanguage->getLanguageId();
284 if ($languageId === 0) {
287 if ($this->pObj->MOD_SETTINGS[
'lang'] == 0 || (
int)$this->pObj->MOD_SETTINGS[
'lang'] === $languageId) {
289 if (is_array($row)) {
290 $langRecUids[$languageId][] = $row[
'uid'];
291 $status = $row[
'_HIDDEN'] ? (GeneralUtility::hideIfNotTranslated($data[
'row'][
'l18n_cfg']) || GeneralUtility::hideIfDefaultLanguage($data[
'row'][
'l18n_cfg']) ?
'danger' :
'') :
'success';
292 $icon = $this->iconFactory->getIconForRecord(
'pages', $row,
Icon::SIZE_SMALL)->render();
293 $info = $icon . ($showPageId ?
' [' . (int)$row[
'uid'] .
']' :
'') .
' ' . htmlspecialchars(
294 GeneralUtility::fixed_lgd_cs($row[
'title'], $titleLen)
295 ) . ((string)$row[
'nav_title'] !==
'' ?
' [Nav: <em>' . htmlspecialchars(
296 GeneralUtility::fixed_lgd_cs($row[
'nav_title'], $titleLen)
297 ) .
'</em>]' :
'') . ($row[
'_COUNT'] > 1 ?
'<div>' . $lang->sL(
298 'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_badThingThereAre'
300 $tCells[] =
'<td class="' . $status .
' col-border-left">' .
301 '<a href="#" onclick="' . htmlspecialchars(
302 'top.loadEditId(' . (
int)$data[
'row'][
'uid'] .
',"&SET[language]=' . $languageId .
'"); return false;'
303 ) .
'" title="' . $lang->sL(
304 'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPageLang'
305 ) .
'">' . $info .
'</a></td>';
308 $editUrl = (string)$uriBuilder->buildUriFromRoute(
'record_edit', [
311 $row[
'uid'] =>
'edit'
314 'returnUrl' => GeneralUtility::getIndpEnv(
'REQUEST_URI')
316 $info = str_replace(
'###LANG_UID###', $languageId, $viewPageLink);
317 $info .=
'<a href="' . htmlspecialchars($editUrl)
318 .
'" class="btn btn-default" title="' . $lang->sL(
319 'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editLanguageOverlayRecord'
320 ) .
'">' . $this->iconFactory->getIcon(
'actions-open',
Icon::SIZE_SMALL)->render() .
'</a>';
321 $tCells[] =
'<td class="' . $status .
'"><div class="btn-group">' . $info .
'</div></td>';
322 $tCells[] =
'<td class="' . $status .
'" title="' . $lang->sL(
323 'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_CEcount'
326 $status = GeneralUtility::hideIfNotTranslated($data[
'row'][
'l18n_cfg']) || GeneralUtility::hideIfDefaultLanguage($data[
'row'][
'l18n_cfg']) ?
'danger' :
'';
327 $info =
'<div class="btn-group"><label class="btn btn-default btn-checkbox">';
328 $info .=
'<input type="checkbox" data-lang="' . $languageId .
'" data-uid="' . (int)$data[
'row'][
'uid'] .
'" name="newOL[' . $languageId .
'][' . $data[
'row'][
'uid'] .
']" value="1" />';
329 $info .=
'<span class="t3-icon fa"></span></label></div>';
330 $newOL_js[$languageId] .=
331 ' +(document.webinfoForm['
332 . GeneralUtility::quoteJSvalue(
'newOL[' . $languageId .
'][' . $data[
'row'][
'uid'] .
']')
334 . GeneralUtility::quoteJSvalue(
'&edit[pages][' . $data[
'row'][
'uid'] .
']=new')
337 $tCells[] =
'<td class="' . $status .
' col-border-left"> </td>';
338 $tCells[] =
'<td class="' . $status .
'"> </td>';
339 $tCells[] =
'<td class="' . $status .
'">' . $info .
'</td>';
351 $tCells[] =
'<td>' . $lang->sL(
'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_page') .
'</td>';
352 if (is_array($langRecUids[0])) {
353 $editUrl = (string)$uriBuilder->buildUriFromRoute(
'record_edit', [
356 implode(
',', $langRecUids[0]) =>
'edit'
359 'columnsOnly' =>
'title,nav_title,l18n_cfg,hidden',
360 'returnUrl' => GeneralUtility::getIndpEnv(
'REQUEST_URI')
362 $editIco =
'<a href="' . htmlspecialchars($editUrl)
363 .
'" class="btn btn-default" title="' . $lang->sL(
364 'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPageProperties'
365 ) .
'">' . $this->iconFactory->getIcon(
'actions-document-open',
Icon::SIZE_SMALL)->render() .
'</a>';
369 $tCells[] =
'<td class="col-border-left" colspan="2">' . $lang->sL(
370 'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_default'
371 ) .
' ' . $editIco .
'</td>';
372 foreach ($this->siteLanguages as $siteLanguage) {
373 $languageId = $siteLanguage->getLanguageId();
374 if ($languageId === 0) {
377 if ($this->pObj->MOD_SETTINGS[
'lang'] == 0 || (
int)$this->pObj->MOD_SETTINGS[
'lang'] === $languageId) {
379 $tCells[] =
'<td class="col-border-left">' . htmlspecialchars($siteLanguage->getTitle()) .
'</td>';
381 if (is_array($langRecUids[$languageId])) {
382 $editUrl = (string)$uriBuilder->buildUriFromRoute(
'record_edit', [
385 implode(
',', $langRecUids[$languageId]) =>
'edit'
388 'columnsOnly' =>
'title,nav_title,hidden',
389 'returnUrl' => GeneralUtility::getIndpEnv(
'REQUEST_URI')
391 $editButton =
'<a href="' . htmlspecialchars($editUrl)
392 .
'" class="btn btn-default" title="' . $lang->sL(
393 'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editLangOverlays'
394 ) .
'">' . $this->iconFactory->getIcon(
'actions-document-open',
Icon::SIZE_SMALL)->render() .
'</a>';
399 $createLink = (string)$uriBuilder->buildUriFromRoute(
'tce_db', [
400 'redirect' => GeneralUtility::getIndpEnv(
'REQUEST_URI')
402 $newButton =
'<a href="' .
403 htmlspecialchars($createLink) .
404 '" data-edit-url="' .
405 htmlspecialchars($createLink) .
406 '" class="btn btn-default disabled t3js-language-new-' .
410 'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_getlangsta_createNewTranslationHeaders'
413 $this->iconFactory->getIcon(
'actions-document-new',
Icon::SIZE_SMALL)->render() .
416 $tCells[] =
'<td class="btn-group">' . $editButton . $newButton .
'</td>';
417 $tCells[] =
'<td> </td>';
422 '<div class="table-fit">' .
423 '<table class="table table-striped table-hover" id="langTable">' .
426 implode(
'', $tCells) .
445 trigger_error(
'This method will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
447 $allowed_languages = array_flip(explode(
',', $this->
getBackendUser()->groupData[
'allowed_languages']));
449 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
450 ->getQueryBuilderForTable(
'sys_language')
452 ->from(
'sys_language')
453 ->orderBy(
'sorting');
454 $res = $queryBuilder->execute();
456 if (is_array($allowed_languages) && !empty($allowed_languages)) {
458 if (isset($allowed_languages[
$output[
'uid']])) {
463 $outputArray = $res->fetchAll();
477 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
478 ->getQueryBuilderForTable(
'pages');
482 ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class))
483 ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
484 $result = $queryBuilder
488 $queryBuilder->expr()->eq(
489 $GLOBALS[
'TCA'][
'pages'][
'ctrl'][
'transOrigPointerField'],
490 $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT)
494 $queryBuilder->expr()->eq(
495 $GLOBALS[
'TCA'][
'pages'][
'ctrl'][
'languageField'],
496 $queryBuilder->createNamedParameter($langId, \PDO::PARAM_INT)
501 $row = $result->fetch();
503 if (is_array($row)) {
504 $row[
'_COUNT'] = $queryBuilder->count(
'uid')->execute()->fetchColumn(0);
505 $row[
'_HIDDEN'] = $row[
'hidden'] || (int)$row[
'endtime'] > 0 && (
int)$row[
'endtime'] <
$GLOBALS[
'EXEC_TIME'] ||
$GLOBALS[
'EXEC_TIME'] < (int)$row[
'starttime'];
507 $result->closeCursor();
520 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
521 ->getQueryBuilderForTable(
'tt_content');
522 $queryBuilder->getRestrictions()
524 ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
525 ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
526 $count = $queryBuilder
530 $queryBuilder->expr()->eq(
532 $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT)
536 $queryBuilder->expr()->eq(
538 $queryBuilder->createNamedParameter($sysLang, \PDO::PARAM_INT)
543 return $count ?:
'-';
553 $currentSite =
$GLOBALS[
'TYPO3_REQUEST']->getAttribute(
'site');
554 $this->siteLanguages = $currentSite->getAvailableLanguages($this->
getBackendUser(),
false, (
int)$this->
id);
564 if (is_array($this->extClassConf) && $this->extClassConf[
'name']) {
565 $this->extObj = GeneralUtility::makeInstance($this->extClassConf[
'name']);
566 $this->extObj->init($this->pObj, $this->extClassConf);
579 if (is_object($this->extObj)) {
580 return $this->extObj->main();
607 return GeneralUtility::makeInstance(PageRenderer::class);