[TASK] Move PageInformationController & TranslationStatusController 71/53471/7
authorGeorg Ringer <georg.ringer@gmail.com>
Fri, 14 Jul 2017 09:36:15 +0000 (11:36 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Mon, 14 Aug 2017 13:16:12 +0000 (15:16 +0200)
Move the mentioned controllers from EXT:frontend to EXT:info as
those belongs there.

Resolves: #81865
Releases: master
Change-Id: I3ea6f8e3ffd802078330f19aa77c1b28e85437a7
Reviewed-on: https://review.typo3.org/53471
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
16 files changed:
composer.json
composer.lock
typo3/sysext/frontend/Classes/Controller/PageInformationController.php [deleted file]
typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php [deleted file]
typo3/sysext/frontend/Resources/Private/Language/locallang_csh_webinfo.xlf [deleted file]
typo3/sysext/frontend/Resources/Private/Language/locallang_webinfo.xlf [deleted file]
typo3/sysext/frontend/ext_tables.php
typo3/sysext/info/Classes/Controller/PageInformationController.php [new file with mode: 0644]
typo3/sysext/info/Classes/Controller/TranslationStatusController.php [new file with mode: 0644]
typo3/sysext/info/Migrations/Code/ClassAliasMap.php [new file with mode: 0644]
typo3/sysext/info/Migrations/Code/LegacyClassesForIde.php [new file with mode: 0644]
typo3/sysext/info/Resources/Private/Language/locallang_csh_webinfo.xlf [new file with mode: 0644]
typo3/sysext/info/Resources/Private/Language/locallang_webinfo.xlf [new file with mode: 0644]
typo3/sysext/info/composer.json
typo3/sysext/info/ext_tables.php
typo3/sysext/sys_note/Classes/Hook/InfoModuleHook.php

index 48a86fa..24977e3 100644 (file)
@@ -75,6 +75,7 @@
                                "typo3/sysext/core/Migrations/Code/ClassAliasMap.php",
                                "typo3/sysext/extbase/Migrations/Code/ClassAliasMap.php",
                                "typo3/sysext/fluid/Migrations/Code/ClassAliasMap.php",
+                               "typo3/sysext/info/Migrations/Code/ClassAliasMap.php",
                                "typo3/sysext/version/Migrations/Code/ClassAliasMap.php"
                        ]
                },
index 607c174..3c85214 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "1aaae55ba684f7dabde068ee55807a5d",
+    "content-hash": "fd66c8fafee6011bc40bcdbc0ae93d96",
     "packages": [
         {
             "name": "cogpowered/finediff",
diff --git a/typo3/sysext/frontend/Classes/Controller/PageInformationController.php b/typo3/sysext/frontend/Classes/Controller/PageInformationController.php
deleted file mode 100644 (file)
index 69ef7cc..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-<?php
-namespace TYPO3\CMS\Frontend\Controller;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\View\PageLayoutView;
-use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Class for displaying page information (records, page record properties)
- */
-class PageInformationController extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule
-{
-    /**
-     * Returns the menu array
-     *
-     * @return array
-     */
-    public function modMenu()
-    {
-        return [
-            'pages' => [
-                0 => $GLOBALS['LANG']->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:pages_0'),
-                2 => $GLOBALS['LANG']->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:pages_2'),
-                1 => $GLOBALS['LANG']->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:pages_1')
-            ],
-            'depth' => [
-                0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
-                1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
-                2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
-                3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
-                4 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
-                999 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi')
-            ]
-        ];
-    }
-
-    /**
-     * MAIN function for page information display
-     *
-     * @return string Output HTML for the module.
-     */
-    public function main()
-    {
-        $theOutput = '<h1>' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:page_title')) . '</h1>';
-        $dblist = GeneralUtility::makeInstance(PageLayoutView::class);
-        $dblist->descrTable = '_MOD_web_info';
-        $dblist->thumbs = 0;
-        $dblist->script = BackendUtility::getModuleUrl('web_info');
-        $dblist->showIcon = 0;
-        $dblist->setLMargin = 0;
-        $dblist->agePrefixes = $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.minutesHoursDaysYears');
-        $dblist->pI_showUser = 1;
-
-        switch ((int)$this->pObj->MOD_SETTINGS['pages']) {
-            case 1:
-                $dblist->fieldArray = ['title', 'uid'] + array_keys($this->cleanTableNames());
-                break;
-            case 2:
-                $dblist->fieldArray = [
-                    'title',
-                    'uid',
-                    'lastUpdated',
-                    'newUntil',
-                    'no_cache',
-                    'cache_timeout',
-                    'php_tree_stop',
-                    'TSconfig',
-                    'is_siteroot',
-                    'fe_login_mode'
-                ];
-                break;
-            default:
-                $dblist->fieldArray = [
-                    'title',
-                    'uid',
-                    'alias',
-                    'starttime',
-                    'endtime',
-                    'fe_group',
-                    'target',
-                    'url',
-                    'shortcut',
-                    'shortcut_mode'
-                ];
-        }
-
-        // PAGES:
-        $this->pObj->MOD_SETTINGS['pages_levels'] = $this->pObj->MOD_SETTINGS['depth'];
-        // ONLY for the sake of dblist module which uses this value.
-        $h_func = BackendUtility::getDropdownMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']);
-        $h_func .= BackendUtility::getDropdownMenu($this->pObj->id, 'SET[pages]', $this->pObj->MOD_SETTINGS['pages'], $this->pObj->MOD_MENU['pages']);
-        $dblist->start($this->pObj->id, 'pages', 0);
-        $dblist->generateList();
-        // CSH
-        $optionKey = $this->pObj->MOD_SETTINGS['pages'];
-        $cshPagetreeOverview = BackendUtility::cshItem($dblist->descrTable, 'func_' . $optionKey, null, '<span class="btn btn-default btn-sm">|</span>');
-
-        $theOutput .= '<div class="form-inline form-inline-spaced">'
-            . $h_func
-            . '<div class="form-group">' . $cshPagetreeOverview . '</div>'
-            . '</div>'
-            . $dblist->HTMLcode;
-
-        // Additional footer content
-        $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook'];
-        if (is_array($footerContentHook)) {
-            foreach ($footerContentHook as $hook) {
-                $params = [];
-                $theOutput .= GeneralUtility::callUserFunction($hook, $params, $this);
-            }
-        }
-        return $theOutput;
-    }
-
-    /**
-     * Function, which fills in the internal array, $this->allowedTableNames with all tables to
-     * which the user has access. Also a set of standard tables (pages, sys_filemounts, etc...)
-     * are filtered out. So what is left is basically all tables which makes sense to list content from.
-     *
-     * @return string[]
-     */
-    protected function cleanTableNames()
-    {
-        // Get all table names:
-        $tableNames = array_flip(array_keys($GLOBALS['TCA']));
-        // Unset common names:
-        unset($tableNames['pages']);
-        unset($tableNames['sys_filemounts']);
-        unset($tableNames['sys_action']);
-        unset($tableNames['sys_workflows']);
-        unset($tableNames['be_users']);
-        unset($tableNames['be_groups']);
-        $allowedTableNames = [];
-        // Traverse table names and set them in allowedTableNames array IF they can be read-accessed by the user.
-        if (is_array($tableNames)) {
-            foreach ($tableNames as $k => $v) {
-                if (!$GLOBALS['TCA'][$k]['ctrl']['hideTable'] && $this->getBackendUser()->check('tables_select', $k)) {
-                    $allowedTableNames['table_' . $k] = $k;
-                }
-            }
-        }
-        return $allowedTableNames;
-    }
-
-    /**
-     * @return BackendUserAuthentication
-     */
-    protected function getBackendUser()
-    {
-        return $GLOBALS['BE_USER'];
-    }
-}
diff --git a/typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php b/typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php
deleted file mode 100644 (file)
index 0a6411f..0000000
+++ /dev/null
@@ -1,468 +0,0 @@
-<?php
-
-namespace TYPO3\CMS\Frontend\Controller;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Tree\View\PageTreeView;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
-use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
-use TYPO3\CMS\Core\Imaging\Icon;
-use TYPO3\CMS\Core\Imaging\IconFactory;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Class for displaying translation status of pages in the tree.
- */
-class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule
-{
-    /**
-     * @var IconFactory
-     */
-    protected $iconFactory;
-
-    /**
-     * @var string
-     * static table for pages_language_overlay
-     */
-    protected static $pageLanguageOverlayTable = 'pages_language_overlay';
-
-    /**
-     * Construct for initialize class variables
-     */
-    public function __construct()
-    {
-        $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
-    }
-
-    /**
-     * Returns the menu array
-     *
-     * @return array
-     */
-    public function modMenu()
-    {
-        $lang = $this->getLanguageService();
-        $menuArray = [
-            'depth' => [
-                0 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
-                1 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
-                2 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
-                3 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
-                4 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
-                999 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi')
-            ]
-        ];
-        // Languages:
-        $lang = $this->getSystemLanguages();
-        $menuArray['lang'] = [
-            0 => '[All]'
-        ];
-        foreach ($lang as $langRec) {
-            $menuArray['lang'][$langRec['uid']] = $langRec['title'];
-        }
-        return $menuArray;
-    }
-
-    /**
-     * MAIN function for page information of localization
-     *
-     * @return string Output HTML for the module.
-     */
-    public function main()
-    {
-        $theOutput = '<h1>' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_title')) . '</h1>';
-        if ($this->pObj->id) {
-            // Depth selector:
-            $theOutput .= '<div class="form-inline form-inline-spaced">';
-            $h_func = BackendUtility::getDropdownMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']);
-            $h_func .= BackendUtility::getDropdownMenu($this->pObj->id, 'SET[lang]', $this->pObj->MOD_SETTINGS['lang'], $this->pObj->MOD_MENU['lang']);
-            $theOutput .= $h_func;
-            // Add CSH:
-            $theOutput .= BackendUtility::cshItem('_MOD_web_info', 'lang', null, '<div class="form-group"><span class="btn btn-default btn-sm">|</span></div><br />');
-            $theOutput .= '</div>';
-            // Showing the tree:
-            // Initialize starting point of page tree:
-            $treeStartingPoint = (int)$this->pObj->id;
-            $treeStartingRecord = BackendUtility::getRecordWSOL('pages', $treeStartingPoint);
-            $depth = $this->pObj->MOD_SETTINGS['depth'];
-            // Initialize tree object:
-            $tree = GeneralUtility::makeInstance(PageTreeView::class);
-            $tree->init('AND ' . $this->getBackendUser()->getPagePermsClause(1));
-            $tree->addField('l18n_cfg');
-            // Creating top icon; the current page
-            $HTML = $this->iconFactory->getIconForRecord('pages', $treeStartingRecord, Icon::SIZE_SMALL)->render();
-            $tree->tree[] = [
-                'row' => $treeStartingRecord,
-                'HTML' => $HTML
-            ];
-            // Create the tree from starting point:
-            if ($depth) {
-                $tree->getTree($treeStartingPoint, $depth, '');
-            }
-            // Render information table:
-            $theOutput .= $this->renderL10nTable($tree);
-        }
-        return $theOutput;
-    }
-
-    /**
-     * Rendering the localization information table.
-     *
-     * @param array $tree The Page tree data
-     * @return string HTML for the localization information table.
-     */
-    public function renderL10nTable(&$tree)
-    {
-        $lang = $this->getLanguageService();
-        // System languages retrieved:
-        $languages = $this->getSystemLanguages();
-        // Title length:
-        $titleLen = $this->getBackendUser()->uc['titleLen'];
-        // Put together the TREE:
-        $output = '';
-        $newOL_js = [];
-        $langRecUids = [];
-        foreach ($tree->tree as $data) {
-            $tCells = [];
-            $langRecUids[0][] = $data['row']['uid'];
-            // Page icons / titles etc.
-            $tCells[] = '<td' . ($data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '') . '>' .
-                ($data['depthData'] ?: '') .
-                BackendUtility::wrapClickMenuOnIcon($data['HTML'], 'pages', $data['row']['uid']) .
-                '<a href="#" onclick="' . htmlspecialchars(
-                    'top.loadEditId(' . (int)$data['row']['uid'] . ',"&SET[language]=0"); return false;'
-                ) . '" title="' . $lang->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPage') . '">' .
-                htmlspecialchars(GeneralUtility::fixed_lgd_cs($data['row']['title'], $titleLen)) .
-                '</a>' .
-                ((string)$data['row']['nav_title'] !== '' ? ' [Nav: <em>' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($data['row']['nav_title'], $titleLen)) . '</em>]' : '') .
-                '</td>';
-            // DEFAULT language:
-            // "View page" link is created:
-            $viewPageLink = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick(
-                    $data['row']['uid'], '', '', '', '', '&L=###LANG_UID###')
-                ) . '" class="btn btn-default" title="' . $lang->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_viewPage') . '">' .
-                $this->iconFactory->getIcon('actions-view', Icon::SIZE_SMALL)->render() . '</a>';
-            $status = GeneralUtility::hideIfDefaultLanguage($data['row']['l18n_cfg']) ? 'danger' : 'success';
-            // Create links:
-            $editUrl = BackendUtility::getModuleUrl('record_edit', [
-                'edit' => [
-                    'pages' => [
-                        $data['row']['uid'] => 'edit'
-                    ]
-                ],
-                'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-            ]);
-            $info = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick(
-                    $data['row']['uid'], '', '', '', '', '')
-                ) . '" class="btn btn-default" title="' . $lang->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_viewPage') . '">' .
-                $this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL)->render() . '</a>';
-            $info .= '<a href="' . htmlspecialchars($editUrl)
-                . '" class="btn btn-default" title="' . $lang->sL(
-                    'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editDefaultLanguagePage'
-                ) . '">' . $this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)->render() . '</a>';
-            $info .= '&nbsp;';
-            $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>' : '&nbsp;';
-            $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>' : '&nbsp;';
-            // Put into cell:
-            $tCells[] = '<td class="' . $status . ' col-border-left"><div class="btn-group">' . $info . '</div></td>';
-            $tCells[] = '<td class="' . $status . '" title="' . $lang->sL(
-                    'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_CEcount'
-                ) . '" align="center">' . $this->getContentElementCount($data['row']['uid'], 0) . '</td>';
-            $modSharedTSconfig = BackendUtility::getModTSconfig($data['row']['uid'], 'mod.SHARED');
-            $disableLanguages = isset($modSharedTSconfig['properties']['disableLanguages']) ? GeneralUtility::trimExplode(',', $modSharedTSconfig['properties']['disableLanguages'], true) : [];
-            // Traverse system languages:
-            foreach ($languages as $langRow) {
-                if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int)$this->pObj->MOD_SETTINGS['lang'] === (int)$langRow['uid']) {
-                    $row = $this->getLangStatus($data['row']['uid'], $langRow['uid']);
-                    $info = '';
-                    if (is_array($row)) {
-                        $langRecUids[$langRow['uid']][] = $row['uid'];
-                        $status = $row['_HIDDEN'] ? (GeneralUtility::hideIfNotTranslated($data['row']['l18n_cfg']) || GeneralUtility::hideIfDefaultLanguage($data['row']['l18n_cfg']) ? 'danger' : '') : 'success';
-                        $icon = $this->iconFactory->getIconForRecord('pages_language_overlay', $row, Icon::SIZE_SMALL)->render();
-                        $info = $icon . htmlspecialchars(
-                                GeneralUtility::fixed_lgd_cs($row['title'], $titleLen)
-                            ) . ((string)$row['nav_title'] !== '' ? ' [Nav: <em>' . htmlspecialchars(
-                                GeneralUtility::fixed_lgd_cs($row['nav_title'], $titleLen)
-                            ) . '</em>]' : '') . ($row['_COUNT'] > 1 ? '<div>' . $lang->sL(
-                                'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_badThingThereAre'
-                            ) . '</div>' : '');
-                        $tCells[] = '<td class="' . $status . ' col-border-left">' .
-                            '<a href="#" onclick="' . htmlspecialchars(
-                                'top.loadEditId(' . (int)$data['row']['uid'] . ',"&SET[language]=' . $langRow['uid'] . '"); return false;'
-                            ) . '" title="' . $lang->sL(
-                                'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPageLang'
-                            ) . '">' . $info . '</a></td>';
-                        // Edit whole record:
-                        // Create links:
-                        $editUrl = BackendUtility::getModuleUrl('record_edit', [
-                            'edit' => [
-                                'pages_language_overlay' => [
-                                    $row['uid'] => 'edit'
-                                ]
-                            ],
-                            'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-                        ]);
-                        $info = str_replace('###LANG_UID###', $langRow['uid'], $viewPageLink);
-                        $info .= '<a href="' . htmlspecialchars($editUrl)
-                            . '" class="btn btn-default" title="' . $lang->sL(
-                                'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editLanguageOverlayRecord'
-                            ) . '">' . $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL)->render() . '</a>';
-                        $tCells[] = '<td class="' . $status . '"><div class="btn-group">' . $info . '</div></td>';
-                        $tCells[] = '<td class="' . $status . '" title="' . $lang->sL(
-                                'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_CEcount'
-                            ) . '" align="center">' . $this->getContentElementCount($data['row']['uid'], $langRow['uid']) . '</td>';
-                    } else {
-                        if (in_array($langRow['uid'], $disableLanguages)) {
-                            // Language has been disabled for this page
-                            $status = 'danger';
-                            $info = '';
-                        } else {
-                            $status = GeneralUtility::hideIfNotTranslated($data['row']['l18n_cfg']) || GeneralUtility::hideIfDefaultLanguage($data['row']['l18n_cfg']) ? 'danger' : '';
-                            $info = '<div class="btn-group"><label class="btn btn-default btn-checkbox">';
-                            $info .= '<input type="checkbox" name="newOL[' . $langRow['uid'] . '][' . $data['row']['uid'] . ']" value="1" />';
-                            $info .= '<span class="t3-icon fa"></span></label></div>';
-                            $newOL_js[$langRow['uid']] .= '
-                                                               +(document.webinfoForm['
-                                . GeneralUtility::quoteJSvalue('newOL[' . $langRow['uid'] . '][' . $data['row']['uid'] . ']')
-                                . '].checked ? '
-                                . GeneralUtility::quoteJSvalue('&edit[pages_language_overlay][' . $data['row']['uid'] . ']=new')
-                                . ' : \'\')
-                                                       ';
-                        }
-                        $tCells[] = '<td class="' . $status . ' col-border-left">&nbsp;</td>';
-                        $tCells[] = '<td class="' . $status . '">&nbsp;</td>';
-                        $tCells[] = '<td class="' . $status . '">' . $info . '</td>';
-                    }
-                }
-            }
-            $output .= '
-                               <tr>
-                                       ' . implode('
-                                       ', $tCells) . '
-                               </tr>';
-        }
-        // Put together HEADER:
-        $tCells = [];
-        $tCells[] = '<td>' . $lang->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_page') . ':</td>';
-        if (is_array($langRecUids[0])) {
-            $editUrl = BackendUtility::getModuleUrl('record_edit', [
-                'edit' => [
-                    'pages' => [
-                        implode(',', $langRecUids[0]) => 'edit'
-                    ]
-                ],
-                'columnsOnly' => 'title,nav_title,l18n_cfg,hidden',
-                'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-            ]);
-            $editIco = '<a href="' . htmlspecialchars($editUrl)
-                . '" class="btn btn-default" title="' . $lang->sL(
-                    'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPageProperties'
-                ) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
-        } else {
-            $editIco = '';
-        }
-        $tCells[] = '<td class="col-border-left" colspan="2">' . $lang->sL(
-                'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_default'
-            ) . ':' . $editIco . '</td>';
-        foreach ($languages as $langRow) {
-            if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int)$this->pObj->MOD_SETTINGS['lang'] === (int)$langRow['uid']) {
-                // Title:
-                $tCells[] = '<td class="col-border-left">' . htmlspecialchars($langRow['title']) . '</td>';
-                // Edit language overlay records:
-                if (is_array($langRecUids[$langRow['uid']])) {
-                    $editUrl = BackendUtility::getModuleUrl('record_edit', [
-                        'edit' => [
-                            'pages_language_overlay' => [
-                                implode(',', $langRecUids[$langRow['uid']]) => 'edit'
-                            ]
-                        ],
-                        'columnsOnly' => 'title,nav_title,hidden',
-                        'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-                    ]);
-                    $editButton = '<a href="' . htmlspecialchars($editUrl)
-                        . '" class="btn btn-default" title="' . $lang->sL(
-                            'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editLangOverlays'
-                        ) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
-                } else {
-                    $editButton = '';
-                }
-                // Create new overlay records:
-                $params = '&columnsOnly=title,hidden,sys_language_uid&overrideVals[pages_language_overlay][sys_language_uid]=' . $langRow['uid'];
-                $onClick = BackendUtility::editOnClick($params);
-                if (!empty($newOL_js[$langRow['uid']])) {
-                    $onClickArray = explode('?', $onClick, 2);
-                    $lastElement = array_pop($onClickArray);
-                    $onClickArray[] = '\'' . $newOL_js[$langRow['uid']] . ' + \'&' . $lastElement;
-                    $onClick = implode('?', $onClickArray);
-                }
-                $newButton = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($onClick)
-                    . '" title="' . $lang->sL(
-                        'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_getlangsta_createNewTranslationHeaders'
-                    ) . '">' . $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render() . '</a>';
-
-                $tCells[] = '<td class="btn-group">' . $editButton . $newButton . '</td>';
-                $tCells[] = '<td>&nbsp;</td>';
-            }
-        }
-
-        $output =
-            '<div class="table-fit">' .
-                '<table class="table table-striped table-hover" id="langTable">' .
-                    '<thead>' .
-                        '<tr>' .
-                            implode('', $tCells) .
-                        '</tr>' .
-                    '</thead>' .
-                    '<tbody>' .
-                        $output .
-                    '</tbody>' .
-                '</table>' .
-            '</div>';
-        return $output;
-    }
-
-    /**
-     * Selects all system languages (from sys_language)
-     *
-     * @return array System language records in an array.
-     */
-    public function getSystemLanguages()
-    {
-        if (!$this->getBackendUser()->user['admin'] && $this->getBackendUser()->groupData['allowed_languages'] !== '') {
-            $allowed_languages = array_flip(explode(',', $this->getBackendUser()->groupData['allowed_languages']));
-        }
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getQueryBuilderForTable('sys_language');
-        $queryBuilder
-            ->getRestrictions()
-            ->removeAll();
-        $queryBuilder
-            ->select('*')
-            ->from('sys_language')
-            ->orderBy('sorting');
-        $res = $queryBuilder->execute();
-        $outputArray = [];
-        if (is_array($allowed_languages) && !empty($allowed_languages)) {
-            while ($output = $res->fetch()) {
-                if (isset($allowed_languages[$output['uid']])) {
-                    $outputArray[] = $output;
-                }
-            }
-        } else {
-            $outputArray = $res->fetchAll();
-        }
-        return $outputArray;
-    }
-
-    /**
-     * Get an alternative language record for a specific page / language
-     *
-     * @param int $pageId Page ID to look up for.
-     * @param int $langId Language UID to select for.
-     * @return array pages_languages_overlay record
-     */
-    public function getLangStatus($pageId, $langId)
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getQueryBuilderForTable(static::$pageLanguageOverlayTable);
-        $queryBuilder
-            ->getRestrictions()
-            ->removeAll()
-            ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class))
-            ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
-        $result = $queryBuilder
-            ->select('*')
-            ->from(static::$pageLanguageOverlayTable)
-            ->where(
-                $queryBuilder->expr()->eq(
-                    'pid',
-                    $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT)
-                )
-            )
-            ->andWhere(
-                $queryBuilder->expr()->eq(
-                    'sys_language_uid',
-                    $queryBuilder->createNamedParameter($langId, \PDO::PARAM_INT)
-                )
-            )
-            ->execute();
-
-        $row = $result->fetch();
-        BackendUtility::workspaceOL(static::$pageLanguageOverlayTable, $row);
-        if (is_array($row)) {
-            $row['_COUNT'] = $result->rowCount();
-            $row['_HIDDEN'] = $row['hidden'] || (int)$row['endtime'] > 0 && (int)$row['endtime'] < $GLOBALS['EXEC_TIME'] || $GLOBALS['EXEC_TIME'] < (int)$row['starttime'];
-        }
-        $result->closeCursor();
-        return $row;
-    }
-
-    /**
-     * Counting content elements for a single language on a page.
-     *
-     * @param int $pageId Page id to select for.
-     * @param int $sysLang Sys language uid
-     * @return int Number of content elements from the PID where the language is set to a certain value.
-     */
-    public function getContentElementCount($pageId, $sysLang)
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getQueryBuilderForTable(static::$pageLanguageOverlayTable);
-        $queryBuilder->getRestrictions()
-            ->removeAll()
-            ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
-            ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
-        $count = $queryBuilder
-            ->count('uid')
-            ->from('tt_content')
-            ->where(
-                $queryBuilder->expr()->eq(
-                    'pid',
-                    $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT)
-                )
-            )
-            ->andWhere(
-                $queryBuilder->expr()->eq(
-                    'sys_language_uid',
-                    $queryBuilder->createNamedParameter($sysLang, \PDO::PARAM_INT)
-                )
-            )
-            ->execute()
-            ->fetchColumn(0);
-        return $count ?: '-';
-    }
-
-    /**
-     * Returns LanguageService
-     *
-     * @return \TYPO3\CMS\Core\Localization\LanguageService
-     */
-    protected function getLanguageService()
-    {
-        return $GLOBALS['LANG'];
-    }
-
-    /**
-     * Returns the current BE user.
-     *
-     * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
-     */
-    protected function getBackendUser()
-    {
-        return $GLOBALS['BE_USER'];
-    }
-}
diff --git a/typo3/sysext/frontend/Resources/Private/Language/locallang_csh_webinfo.xlf b/typo3/sysext/frontend/Resources/Private/Language/locallang_csh_webinfo.xlf
deleted file mode 100644 (file)
index 0ea122b..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
-       <file t3:id="1415814788" source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:32Z" product-name="cms">
-               <header/>
-               <body>
-                       <trans-unit id="func_0.alttitle">
-                               <source>Basic Settings</source>
-                       </trans-unit>
-                       <trans-unit id="func_0.description">
-                               <source>Displays a selection of fields from page records which are regarded as foundational settings for pages. That includes aliases, start- and stop times, access restriction information etc.</source>
-                       </trans-unit>
-                       <trans-unit id="func_0.details" xml:space="preserve">
-                               <source>The Basic Settings view resembles the Cache and Age view quite a lot. They are different only by the selection of fields they show.
-
-&lt;b&gt;Batch editing page fields&lt;/b&gt;
-You will find multiple edit-icons around the interface. All edit icons in head lines will bring you to an editing dialog where you can change exactly that field for all listed tables! Very useful for batch-editing of say all "Start" times.
-If you click the edit icon at the ID numbers of pages you will get straight to the regular editing of a whole page record.</source>
-                       </trans-unit>
-                       <trans-unit id="_func_0.seeAlso" xml:space="preserve">
-                               <source>xMOD_csh_corebe:list_module,
-_MOD_web_info:func_2,
-_MOD_web_info:pagetree_overview</source>
-                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
-                       </trans-unit>
-                       <trans-unit id="_func_0.image" xml:space="preserve">
-                               <source>EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_4.png,
-EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_8.png,
-EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_9.png</source>
-                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
-                       </trans-unit>
-                       <trans-unit id="func_0.image_descr" xml:space="preserve">
-                               <source>The Basic Settings view offers a very convenient overview of page aliases, start times and access restriction settings in the tree branch.
-If you click an edit-icon in the header you will be able to edit that field for all listed pages.</source>
-                       </trans-unit>
-                       <trans-unit id="func_1.alttitle">
-                               <source>Record Overview</source>
-                       </trans-unit>
-                       <trans-unit id="func_1.description">
-                               <source>Record overview gives you an indispensable overview of the distribution of records in the page tree. Each database table in the system is represented with a column and for each page you can see the number of records from that table located on the page.</source>
-                       </trans-unit>
-                       <trans-unit id="func_1.details" xml:space="preserve">
-                               <source>&lt;b&gt;Notice:&lt;/b&gt; Be careful with the level-setting. A high level-setting may cause the module to respond very slowly if there are many pages and many records in the database as well!
-
-&lt;b&gt;Tree stop?&lt;/b&gt;
-Notice the red "+" next to a page in the page tree? This is due to a setting for that page record which means that the page tree will not expand for this page. Typically this is set for protection when there are a large amount of subpages underneath (hundreds of pages typically). If you click the icon/title the overview will jump to make this page the new root of the overview.</source>
-                       </trans-unit>
-                       <trans-unit id="_func_1.seeAlso" xml:space="preserve">
-                               <source>_MOD_web_info:pagetree_overview,
-pages:php_tree_stop</source>
-                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
-                       </trans-unit>
-                       <trans-unit id="_func_1.image">
-                               <source>EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_6.png</source>
-                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
-                       </trans-unit>
-                       <trans-unit id="func_1.image_descr">
-                               <source>You can easily see the distribution of Content Elements on a page. You can also see where Template Records - and basically any record! - are located in the page tree!</source>
-                       </trans-unit>
-                       <trans-unit id="func_2.alttitle">
-                               <source>Cache and Age</source>
-                       </trans-unit>
-                       <trans-unit id="func_2.description">
-                               <source>Displays a selection of fields from page records related to page caching and time settings.</source>
-                       </trans-unit>
-                       <trans-unit id="_func_2.seeAlso" xml:space="preserve">
-                               <source>_MOD_web_info:func_0,
-_MOD_web_info:pagetree_overview,
-pages:TSconfig</source>
-                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
-                       </trans-unit>
-                       <trans-unit id="_func_2.image" xml:space="preserve">
-                               <source>EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_5.png,
-EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_7.png</source>
-                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
-                       </trans-unit>
-                       <trans-unit id="func_2.image_descr" xml:space="preserve">
-                               <source>The "Cache and Age" view.
-Here you see the "TSconfig" column. The overview exposes that these two pages include some Page TSconfig code!</source>
-                       </trans-unit>
-
-                       <trans-unit id="lang.details" xml:space="preserve">
-                               <source>The overview uses colors to signal the availability and fall back situation for a given page. Here is a description for each color code:
-&lt;b&gt;Green background:&lt;/b&gt; Page is translated and viewable in this language. For translations it means that an active page overlay record is present.
-&lt;b&gt;Red background:&lt;/b&gt; Page &lt;em&gt;cannot&lt;/em&gt; be viewed in this language and you will see an error message if you try. Menus should automatically filter out links to pages with this translation.
-&lt;b&gt;Gray background (not available for default language):&lt;/b&gt; Page will fall back to the specified fallback mode for content. Depends on configuration. (sys_language_mode = content_fallback is recommended for most flexible fallback, sys_language_mode = strict will prevent this and issue an error instead!)
-
-&lt;b&gt;The pages "Localization settings:"&lt;/b&gt;
-It is the "Localization settings" of the page record that determines the modes above. In the column of the default translation each of these settings are represented by a "N" (Hide page if no translation for current language exists) or a "D" (Hide default translation of page).
-As you can see the page "Startpage" has the N flag set and therefore any access to the german version of that page will be blocked with an error message because there is no translation in german. By default "german access" to a non-translated page will just show the english content.
-There is also a page with the D flag ("[Dummy]"). The D flag means that the page is only available in one of the translations, in this case Danish. So any attempt to access the page in the default language or german will show an error message.
-
-So, when the "Localization settings" checkboxes for a page are used, you will get an error message when you try to request a page which has been blocked. This is a feature. The trick is not to create links to those pages.
-
-Menus generated from HMENU objects will always take "sys_language" into account and display only pages which can be accessed for that language. But combined with the "localization settings" of pages which may block page access this becomes a problem with pages which are &lt;em&gt;not&lt;/em&gt; translated (has gray background); You might get menu items which links to non-accessible pages.
-The problem basically is that "&amp;L=xx" is different from internal "sys_language". You would like to avoid that and to do so you should configure "sys_language_mode" to "content_fallback". If you do that sys_language will &lt;em&gt;always&lt;/em&gt; follow what "&amp;L=" instructs it to and your menus will be right. At the same time you will get the default content displayed if no translation exists (because content selection falls back).
-
-Finally, the number found in each column tells you how many content elements are found in the specified language.</source>
-                       </trans-unit>
-                       <trans-unit id="_lang.image" xml:space="preserve">
-                               <source>EXT:frontend/Resources/Public/Images/cshimages/localizationoverview.png,
-EXT:frontend/Resources/Public/Images/cshimages/localizationoverview1.png</source>
-                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
-                       </trans-unit>
-                       <trans-unit id="lang.image_descr" xml:space="preserve">
-                               <source>Localization overview in the Web&gt;Info module. Use the buttons to edit, view and create new page translation headers. Use the regular page module to put localized content on the pages.
-The "Localization settings" that affect availability of pages in the various languages.</source>
-                       </trans-unit>
-                       <trans-unit id="lang.alttitle">
-                               <source>Localization overview</source>
-                       </trans-unit>
-                       <trans-unit id="lang.description">
-                               <source>Gives an overview of which pages in the page tree are translated to the system languages installed.</source>
-                       </trans-unit>
-               </body>
-       </file>
-</xliff>
diff --git a/typo3/sysext/frontend/Resources/Private/Language/locallang_webinfo.xlf b/typo3/sysext/frontend/Resources/Private/Language/locallang_webinfo.xlf
deleted file mode 100644 (file)
index abe3e99..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
-       <file t3:id="1415814792" source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:32Z" product-name="cms">
-               <header/>
-               <body>
-                       <trans-unit id="page_title">
-                               <source>Pagetree overview</source>
-                       </trans-unit>
-                       <trans-unit id="page_sysnote">
-                               <source>Internal notes</source>
-                       </trans-unit>
-                       <trans-unit id="pageInformation">
-                               <source>Page information</source>
-                       </trans-unit>
-                       <trans-unit id="pages_0">
-                               <source>Basic settings</source>
-                       </trans-unit>
-                       <trans-unit id="pages_2">
-                               <source>Cache and Age</source>
-                       </trans-unit>
-                       <trans-unit id="pages_1">
-                               <source>Record overview</source>
-                       </trans-unit>
-                       <trans-unit id="stat_type_0">
-                               <source>Page hits</source>
-                       </trans-unit>
-                       <trans-unit id="stat_type_1">
-                               <source>Total hits</source>
-                       </trans-unit>
-                       <trans-unit id="stat_type_2">
-                               <source>Hits in main sections</source>
-                       </trans-unit>
-                       <trans-unit id="stat_period">
-                               <source>Statistics in the period %s back to %s</source>
-                       </trans-unit>
-                       <trans-unit id="pI_crUser">
-                               <source>Created by</source>
-                       </trans-unit>
-                       <trans-unit id="pI_crDate">
-                               <source>Created date</source>
-                       </trans-unit>
-                       <trans-unit id="pI_lastChange">
-                               <source>Last change</source>
-                       </trans-unit>
-                       <trans-unit id="pI_lastChangeContent">
-                               <source>Last change, content</source>
-                       </trans-unit>
-                       <trans-unit id="hits_title">
-                               <source>Hit Statistics</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_viewPage">
-                               <source>View page</source>
-                       </trans-unit>
-                       <trans-unit id="lang_title">
-                               <source>Localization overview</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_editDefaultLanguagePage">
-                               <source>Edit default language page properties</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_editLangOverlays">
-                               <source>Edit all language overlay records</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_editPageProperties">
-                               <source>Edit all page properties</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_editPage">
-                               <source>Edit page</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_editPageLang">
-                               <source>Edit page translation</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_badThingThereAre">
-                               <source>ERROR: there are two or more page overlay records for this language! Only one is allowed!</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_editLanguageOverlayRecord">
-                               <source>Edit language overlay record</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_page">
-                               <source>Page</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_default">
-                               <source>Default</source>
-                       </trans-unit>
-                       <trans-unit id="lang_getlangsta_createNewTranslationHeaders">
-                               <source>Create new translation headers</source>
-                       </trans-unit>
-                       <trans-unit id="lang_renderl10n_CEcount">
-                               <source>Content Element Count</source>
-                       </trans-unit>
-               </body>
-       </file>
-</xliff>
index 05d3672..4731ab5 100644 (file)
@@ -6,23 +6,9 @@ defined('TYPO3_MODE') or die();
 
 if (TYPO3_MODE === 'BE') {
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_web_layout', 'EXT:frontend/Resources/Private/Language/locallang_csh_weblayout.xlf');
-    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_web_info', 'EXT:frontend/Resources/Private/Language/locallang_csh_webinfo.xlf');
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('fe_groups', 'EXT:frontend/Resources/Private/Language/locallang_csh_fe_groups.xlf');
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('fe_users', 'EXT:frontend/Resources/Private/Language/locallang_csh_fe_users.xlf');
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('sys_domain', 'EXT:frontend/Resources/Private/Language/locallang_csh_sysdomain.xlf');
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('sys_template', 'EXT:frontend/Resources/Private/Language/locallang_csh_systmpl.xlf');
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tt_content', 'EXT:frontend/Resources/Private/Language/locallang_csh_ttcontent.xlf');
-
-    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
-        'web_info',
-        \TYPO3\CMS\Frontend\Controller\PageInformationController::class,
-        null,
-        'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:mod_tx_cms_webinfo_page'
-    );
-    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
-        'web_info',
-        \TYPO3\CMS\Frontend\Controller\TranslationStatusController::class,
-        null,
-        'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:mod_tx_cms_webinfo_lang'
-    );
 }
diff --git a/typo3/sysext/info/Classes/Controller/PageInformationController.php b/typo3/sysext/info/Classes/Controller/PageInformationController.php
new file mode 100644 (file)
index 0000000..9e8dbe0
--- /dev/null
@@ -0,0 +1,166 @@
+<?php
+namespace TYPO3\CMS\Info\Controller;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Backend\View\PageLayoutView;
+use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Class for displaying page information (records, page record properties)
+ */
+class PageInformationController extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule
+{
+    /**
+     * Returns the menu array
+     *
+     * @return array
+     */
+    public function modMenu()
+    {
+        return [
+            'pages' => [
+                0 => $GLOBALS['LANG']->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:pages_0'),
+                2 => $GLOBALS['LANG']->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:pages_2'),
+                1 => $GLOBALS['LANG']->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:pages_1')
+            ],
+            'depth' => [
+                0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
+                1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
+                2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
+                3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
+                4 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
+                999 => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi')
+            ]
+        ];
+    }
+
+    /**
+     * MAIN function for page information display
+     *
+     * @return string Output HTML for the module.
+     */
+    public function main()
+    {
+        $theOutput = '<h1>' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:page_title')) . '</h1>';
+        $dblist = GeneralUtility::makeInstance(PageLayoutView::class);
+        $dblist->descrTable = '_MOD_web_info';
+        $dblist->thumbs = 0;
+        $dblist->script = BackendUtility::getModuleUrl('web_info');
+        $dblist->showIcon = 0;
+        $dblist->setLMargin = 0;
+        $dblist->agePrefixes = $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.minutesHoursDaysYears');
+        $dblist->pI_showUser = 1;
+
+        switch ((int)$this->pObj->MOD_SETTINGS['pages']) {
+            case 1:
+                $dblist->fieldArray = ['title', 'uid'] + array_keys($this->cleanTableNames());
+                break;
+            case 2:
+                $dblist->fieldArray = [
+                    'title',
+                    'uid',
+                    'lastUpdated',
+                    'newUntil',
+                    'no_cache',
+                    'cache_timeout',
+                    'php_tree_stop',
+                    'TSconfig',
+                    'is_siteroot',
+                    'fe_login_mode'
+                ];
+                break;
+            default:
+                $dblist->fieldArray = [
+                    'title',
+                    'uid',
+                    'alias',
+                    'starttime',
+                    'endtime',
+                    'fe_group',
+                    'target',
+                    'url',
+                    'shortcut',
+                    'shortcut_mode'
+                ];
+        }
+
+        // PAGES:
+        $this->pObj->MOD_SETTINGS['pages_levels'] = $this->pObj->MOD_SETTINGS['depth'];
+        // ONLY for the sake of dblist module which uses this value.
+        $h_func = BackendUtility::getDropdownMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']);
+        $h_func .= BackendUtility::getDropdownMenu($this->pObj->id, 'SET[pages]', $this->pObj->MOD_SETTINGS['pages'], $this->pObj->MOD_MENU['pages']);
+        $dblist->start($this->pObj->id, 'pages', 0);
+        $dblist->generateList();
+        // CSH
+        $optionKey = $this->pObj->MOD_SETTINGS['pages'];
+        $cshPagetreeOverview = BackendUtility::cshItem($dblist->descrTable, 'func_' . $optionKey, null, '<span class="btn btn-default btn-sm">|</span>');
+
+        $theOutput .= '<div class="form-inline form-inline-spaced">'
+            . $h_func
+            . '<div class="form-group">' . $cshPagetreeOverview . '</div>'
+            . '</div>'
+            . $dblist->HTMLcode;
+
+        // Additional footer content
+        $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook'];
+        if (is_array($footerContentHook)) {
+            foreach ($footerContentHook as $hook) {
+                $params = [];
+                $theOutput .= GeneralUtility::callUserFunction($hook, $params, $this);
+            }
+        }
+        return $theOutput;
+    }
+
+    /**
+     * Function, which fills in the internal array, $this->allowedTableNames with all tables to
+     * which the user has access. Also a set of standard tables (pages, sys_filemounts, etc...)
+     * are filtered out. So what is left is basically all tables which makes sense to list content from.
+     *
+     * @return string[]
+     */
+    protected function cleanTableNames()
+    {
+        // Get all table names:
+        $tableNames = array_flip(array_keys($GLOBALS['TCA']));
+        // Unset common names:
+        unset($tableNames['pages']);
+        unset($tableNames['sys_filemounts']);
+        unset($tableNames['sys_action']);
+        unset($tableNames['sys_workflows']);
+        unset($tableNames['be_users']);
+        unset($tableNames['be_groups']);
+        $allowedTableNames = [];
+        // Traverse table names and set them in allowedTableNames array IF they can be read-accessed by the user.
+        if (is_array($tableNames)) {
+            foreach ($tableNames as $k => $v) {
+                if (!$GLOBALS['TCA'][$k]['ctrl']['hideTable'] && $this->getBackendUser()->check('tables_select', $k)) {
+                    $allowedTableNames['table_' . $k] = $k;
+                }
+            }
+        }
+        return $allowedTableNames;
+    }
+
+    /**
+     * @return BackendUserAuthentication
+     */
+    protected function getBackendUser()
+    {
+        return $GLOBALS['BE_USER'];
+    }
+}
diff --git a/typo3/sysext/info/Classes/Controller/TranslationStatusController.php b/typo3/sysext/info/Classes/Controller/TranslationStatusController.php
new file mode 100644 (file)
index 0000000..02e8c52
--- /dev/null
@@ -0,0 +1,468 @@
+<?php
+
+namespace TYPO3\CMS\Info\Controller;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Tree\View\PageTreeView;
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Database\ConnectionPool;
+use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
+use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Class for displaying translation status of pages in the tree.
+ */
+class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule
+{
+    /**
+     * @var IconFactory
+     */
+    protected $iconFactory;
+
+    /**
+     * @var string
+     * static table for pages_language_overlay
+     */
+    protected static $pageLanguageOverlayTable = 'pages_language_overlay';
+
+    /**
+     * Construct for initialize class variables
+     */
+    public function __construct()
+    {
+        $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+    }
+
+    /**
+     * Returns the menu array
+     *
+     * @return array
+     */
+    public function modMenu()
+    {
+        $lang = $this->getLanguageService();
+        $menuArray = [
+            'depth' => [
+                0 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
+                1 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
+                2 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
+                3 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
+                4 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
+                999 => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi')
+            ]
+        ];
+        // Languages:
+        $lang = $this->getSystemLanguages();
+        $menuArray['lang'] = [
+            0 => '[All]'
+        ];
+        foreach ($lang as $langRec) {
+            $menuArray['lang'][$langRec['uid']] = $langRec['title'];
+        }
+        return $menuArray;
+    }
+
+    /**
+     * MAIN function for page information of localization
+     *
+     * @return string Output HTML for the module.
+     */
+    public function main()
+    {
+        $theOutput = '<h1>' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_title')) . '</h1>';
+        if ($this->pObj->id) {
+            // Depth selector:
+            $theOutput .= '<div class="form-inline form-inline-spaced">';
+            $h_func = BackendUtility::getDropdownMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']);
+            $h_func .= BackendUtility::getDropdownMenu($this->pObj->id, 'SET[lang]', $this->pObj->MOD_SETTINGS['lang'], $this->pObj->MOD_MENU['lang']);
+            $theOutput .= $h_func;
+            // Add CSH:
+            $theOutput .= BackendUtility::cshItem('_MOD_web_info', 'lang', null, '<div class="form-group"><span class="btn btn-default btn-sm">|</span></div><br />');
+            $theOutput .= '</div>';
+            // Showing the tree:
+            // Initialize starting point of page tree:
+            $treeStartingPoint = (int)$this->pObj->id;
+            $treeStartingRecord = BackendUtility::getRecordWSOL('pages', $treeStartingPoint);
+            $depth = $this->pObj->MOD_SETTINGS['depth'];
+            // Initialize tree object:
+            $tree = GeneralUtility::makeInstance(PageTreeView::class);
+            $tree->init('AND ' . $this->getBackendUser()->getPagePermsClause(1));
+            $tree->addField('l18n_cfg');
+            // Creating top icon; the current page
+            $HTML = $this->iconFactory->getIconForRecord('pages', $treeStartingRecord, Icon::SIZE_SMALL)->render();
+            $tree->tree[] = [
+                'row' => $treeStartingRecord,
+                'HTML' => $HTML
+            ];
+            // Create the tree from starting point:
+            if ($depth) {
+                $tree->getTree($treeStartingPoint, $depth, '');
+            }
+            // Render information table:
+            $theOutput .= $this->renderL10nTable($tree);
+        }
+        return $theOutput;
+    }
+
+    /**
+     * Rendering the localization information table.
+     *
+     * @param array $tree The Page tree data
+     * @return string HTML for the localization information table.
+     */
+    public function renderL10nTable(&$tree)
+    {
+        $lang = $this->getLanguageService();
+        // System languages retrieved:
+        $languages = $this->getSystemLanguages();
+        // Title length:
+        $titleLen = $this->getBackendUser()->uc['titleLen'];
+        // Put together the TREE:
+        $output = '';
+        $newOL_js = [];
+        $langRecUids = [];
+        foreach ($tree->tree as $data) {
+            $tCells = [];
+            $langRecUids[0][] = $data['row']['uid'];
+            // Page icons / titles etc.
+            $tCells[] = '<td' . ($data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '') . '>' .
+                ($data['depthData'] ?: '') .
+                BackendUtility::wrapClickMenuOnIcon($data['HTML'], 'pages', $data['row']['uid']) .
+                '<a href="#" onclick="' . htmlspecialchars(
+                    'top.loadEditId(' . (int)$data['row']['uid'] . ',"&SET[language]=0"); return false;'
+                ) . '" title="' . $lang->sL('LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPage') . '">' .
+                htmlspecialchars(GeneralUtility::fixed_lgd_cs($data['row']['title'], $titleLen)) .
+                '</a>' .
+                ((string)$data['row']['nav_title'] !== '' ? ' [Nav: <em>' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($data['row']['nav_title'], $titleLen)) . '</em>]' : '') .
+                '</td>';
+            // DEFAULT language:
+            // "View page" link is created:
+            $viewPageLink = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick(
+                    $data['row']['uid'], '', '', '', '', '&L=###LANG_UID###')
+                ) . '" class="btn btn-default" title="' . $lang->sL('LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_viewPage') . '">' .
+                $this->iconFactory->getIcon('actions-view', Icon::SIZE_SMALL)->render() . '</a>';
+            $status = GeneralUtility::hideIfDefaultLanguage($data['row']['l18n_cfg']) ? 'danger' : 'success';
+            // Create links:
+            $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                'edit' => [
+                    'pages' => [
+                        $data['row']['uid'] => 'edit'
+                    ]
+                ],
+                'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+            ]);
+            $info = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick(
+                    $data['row']['uid'], '', '', '', '', '')
+                ) . '" class="btn btn-default" title="' . $lang->sL('LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_viewPage') . '">' .
+                $this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL)->render() . '</a>';
+            $info .= '<a href="' . htmlspecialchars($editUrl)
+                . '" class="btn btn-default" title="' . $lang->sL(
+                    'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editDefaultLanguagePage'
+                ) . '">' . $this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)->render() . '</a>';
+            $info .= '&nbsp;';
+            $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>' : '&nbsp;';
+            $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>' : '&nbsp;';
+            // Put into cell:
+            $tCells[] = '<td class="' . $status . ' col-border-left"><div class="btn-group">' . $info . '</div></td>';
+            $tCells[] = '<td class="' . $status . '" title="' . $lang->sL(
+                    'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_CEcount'
+                ) . '" align="center">' . $this->getContentElementCount($data['row']['uid'], 0) . '</td>';
+            $modSharedTSconfig = BackendUtility::getModTSconfig($data['row']['uid'], 'mod.SHARED');
+            $disableLanguages = isset($modSharedTSconfig['properties']['disableLanguages']) ? GeneralUtility::trimExplode(',', $modSharedTSconfig['properties']['disableLanguages'], true) : [];
+            // Traverse system languages:
+            foreach ($languages as $langRow) {
+                if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int)$this->pObj->MOD_SETTINGS['lang'] === (int)$langRow['uid']) {
+                    $row = $this->getLangStatus($data['row']['uid'], $langRow['uid']);
+                    $info = '';
+                    if (is_array($row)) {
+                        $langRecUids[$langRow['uid']][] = $row['uid'];
+                        $status = $row['_HIDDEN'] ? (GeneralUtility::hideIfNotTranslated($data['row']['l18n_cfg']) || GeneralUtility::hideIfDefaultLanguage($data['row']['l18n_cfg']) ? 'danger' : '') : 'success';
+                        $icon = $this->iconFactory->getIconForRecord('pages_language_overlay', $row, Icon::SIZE_SMALL)->render();
+                        $info = $icon . htmlspecialchars(
+                                GeneralUtility::fixed_lgd_cs($row['title'], $titleLen)
+                            ) . ((string)$row['nav_title'] !== '' ? ' [Nav: <em>' . htmlspecialchars(
+                                GeneralUtility::fixed_lgd_cs($row['nav_title'], $titleLen)
+                            ) . '</em>]' : '') . ($row['_COUNT'] > 1 ? '<div>' . $lang->sL(
+                                'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_badThingThereAre'
+                            ) . '</div>' : '');
+                        $tCells[] = '<td class="' . $status . ' col-border-left">' .
+                            '<a href="#" onclick="' . htmlspecialchars(
+                                'top.loadEditId(' . (int)$data['row']['uid'] . ',"&SET[language]=' . $langRow['uid'] . '"); return false;'
+                            ) . '" title="' . $lang->sL(
+                                'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPageLang'
+                            ) . '">' . $info . '</a></td>';
+                        // Edit whole record:
+                        // Create links:
+                        $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                            'edit' => [
+                                'pages_language_overlay' => [
+                                    $row['uid'] => 'edit'
+                                ]
+                            ],
+                            'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                        ]);
+                        $info = str_replace('###LANG_UID###', $langRow['uid'], $viewPageLink);
+                        $info .= '<a href="' . htmlspecialchars($editUrl)
+                            . '" class="btn btn-default" title="' . $lang->sL(
+                                'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editLanguageOverlayRecord'
+                            ) . '">' . $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL)->render() . '</a>';
+                        $tCells[] = '<td class="' . $status . '"><div class="btn-group">' . $info . '</div></td>';
+                        $tCells[] = '<td class="' . $status . '" title="' . $lang->sL(
+                                'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_CEcount'
+                            ) . '" align="center">' . $this->getContentElementCount($data['row']['uid'], $langRow['uid']) . '</td>';
+                    } else {
+                        if (in_array($langRow['uid'], $disableLanguages)) {
+                            // Language has been disabled for this page
+                            $status = 'danger';
+                            $info = '';
+                        } else {
+                            $status = GeneralUtility::hideIfNotTranslated($data['row']['l18n_cfg']) || GeneralUtility::hideIfDefaultLanguage($data['row']['l18n_cfg']) ? 'danger' : '';
+                            $info = '<div class="btn-group"><label class="btn btn-default btn-checkbox">';
+                            $info .= '<input type="checkbox" name="newOL[' . $langRow['uid'] . '][' . $data['row']['uid'] . ']" value="1" />';
+                            $info .= '<span class="t3-icon fa"></span></label></div>';
+                            $newOL_js[$langRow['uid']] .= '
+                                                               +(document.webinfoForm['
+                                . GeneralUtility::quoteJSvalue('newOL[' . $langRow['uid'] . '][' . $data['row']['uid'] . ']')
+                                . '].checked ? '
+                                . GeneralUtility::quoteJSvalue('&edit[pages_language_overlay][' . $data['row']['uid'] . ']=new')
+                                . ' : \'\')
+                                                       ';
+                        }
+                        $tCells[] = '<td class="' . $status . ' col-border-left">&nbsp;</td>';
+                        $tCells[] = '<td class="' . $status . '">&nbsp;</td>';
+                        $tCells[] = '<td class="' . $status . '">' . $info . '</td>';
+                    }
+                }
+            }
+            $output .= '
+                               <tr>
+                                       ' . implode('
+                                       ', $tCells) . '
+                               </tr>';
+        }
+        // Put together HEADER:
+        $tCells = [];
+        $tCells[] = '<td>' . $lang->sL('LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_page') . ':</td>';
+        if (is_array($langRecUids[0])) {
+            $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                'edit' => [
+                    'pages' => [
+                        implode(',', $langRecUids[0]) => 'edit'
+                    ]
+                ],
+                'columnsOnly' => 'title,nav_title,l18n_cfg,hidden',
+                'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+            ]);
+            $editIco = '<a href="' . htmlspecialchars($editUrl)
+                . '" class="btn btn-default" title="' . $lang->sL(
+                    'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPageProperties'
+                ) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
+        } else {
+            $editIco = '';
+        }
+        $tCells[] = '<td class="col-border-left" colspan="2">' . $lang->sL(
+                'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_default'
+            ) . ':' . $editIco . '</td>';
+        foreach ($languages as $langRow) {
+            if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int)$this->pObj->MOD_SETTINGS['lang'] === (int)$langRow['uid']) {
+                // Title:
+                $tCells[] = '<td class="col-border-left">' . htmlspecialchars($langRow['title']) . '</td>';
+                // Edit language overlay records:
+                if (is_array($langRecUids[$langRow['uid']])) {
+                    $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                        'edit' => [
+                            'pages_language_overlay' => [
+                                implode(',', $langRecUids[$langRow['uid']]) => 'edit'
+                            ]
+                        ],
+                        'columnsOnly' => 'title,nav_title,hidden',
+                        'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                    ]);
+                    $editButton = '<a href="' . htmlspecialchars($editUrl)
+                        . '" class="btn btn-default" title="' . $lang->sL(
+                            'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editLangOverlays'
+                        ) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
+                } else {
+                    $editButton = '';
+                }
+                // Create new overlay records:
+                $params = '&columnsOnly=title,hidden,sys_language_uid&overrideVals[pages_language_overlay][sys_language_uid]=' . $langRow['uid'];
+                $onClick = BackendUtility::editOnClick($params);
+                if (!empty($newOL_js[$langRow['uid']])) {
+                    $onClickArray = explode('?', $onClick, 2);
+                    $lastElement = array_pop($onClickArray);
+                    $onClickArray[] = '\'' . $newOL_js[$langRow['uid']] . ' + \'&' . $lastElement;
+                    $onClick = implode('?', $onClickArray);
+                }
+                $newButton = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($onClick)
+                    . '" title="' . $lang->sL(
+                        'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_getlangsta_createNewTranslationHeaders'
+                    ) . '">' . $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render() . '</a>';
+
+                $tCells[] = '<td class="btn-group">' . $editButton . $newButton . '</td>';
+                $tCells[] = '<td>&nbsp;</td>';
+            }
+        }
+
+        $output =
+            '<div class="table-fit">' .
+                '<table class="table table-striped table-hover" id="langTable">' .
+                    '<thead>' .
+                        '<tr>' .
+                            implode('', $tCells) .
+                        '</tr>' .
+                    '</thead>' .
+                    '<tbody>' .
+                        $output .
+                    '</tbody>' .
+                '</table>' .
+            '</div>';
+        return $output;
+    }
+
+    /**
+     * Selects all system languages (from sys_language)
+     *
+     * @return array System language records in an array.
+     */
+    public function getSystemLanguages()
+    {
+        if (!$this->getBackendUser()->user['admin'] && $this->getBackendUser()->groupData['allowed_languages'] !== '') {
+            $allowed_languages = array_flip(explode(',', $this->getBackendUser()->groupData['allowed_languages']));
+        }
+        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
+            ->getQueryBuilderForTable('sys_language');
+        $queryBuilder
+            ->getRestrictions()
+            ->removeAll();
+        $queryBuilder
+            ->select('*')
+            ->from('sys_language')
+            ->orderBy('sorting');
+        $res = $queryBuilder->execute();
+        $outputArray = [];
+        if (is_array($allowed_languages) && !empty($allowed_languages)) {
+            while ($output = $res->fetch()) {
+                if (isset($allowed_languages[$output['uid']])) {
+                    $outputArray[] = $output;
+                }
+            }
+        } else {
+            $outputArray = $res->fetchAll();
+        }
+        return $outputArray;
+    }
+
+    /**
+     * Get an alternative language record for a specific page / language
+     *
+     * @param int $pageId Page ID to look up for.
+     * @param int $langId Language UID to select for.
+     * @return array pages_languages_overlay record
+     */
+    public function getLangStatus($pageId, $langId)
+    {
+        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
+            ->getQueryBuilderForTable(static::$pageLanguageOverlayTable);
+        $queryBuilder
+            ->getRestrictions()
+            ->removeAll()
+            ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class))
+            ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
+        $result = $queryBuilder
+            ->select('*')
+            ->from(static::$pageLanguageOverlayTable)
+            ->where(
+                $queryBuilder->expr()->eq(
+                    'pid',
+                    $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT)
+                )
+            )
+            ->andWhere(
+                $queryBuilder->expr()->eq(
+                    'sys_language_uid',
+                    $queryBuilder->createNamedParameter($langId, \PDO::PARAM_INT)
+                )
+            )
+            ->execute();
+
+        $row = $result->fetch();
+        BackendUtility::workspaceOL(static::$pageLanguageOverlayTable, $row);
+        if (is_array($row)) {
+            $row['_COUNT'] = $result->rowCount();
+            $row['_HIDDEN'] = $row['hidden'] || (int)$row['endtime'] > 0 && (int)$row['endtime'] < $GLOBALS['EXEC_TIME'] || $GLOBALS['EXEC_TIME'] < (int)$row['starttime'];
+        }
+        $result->closeCursor();
+        return $row;
+    }
+
+    /**
+     * Counting content elements for a single language on a page.
+     *
+     * @param int $pageId Page id to select for.
+     * @param int $sysLang Sys language uid
+     * @return int Number of content elements from the PID where the language is set to a certain value.
+     */
+    public function getContentElementCount($pageId, $sysLang)
+    {
+        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
+            ->getQueryBuilderForTable(static::$pageLanguageOverlayTable);
+        $queryBuilder->getRestrictions()
+            ->removeAll()
+            ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
+            ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
+        $count = $queryBuilder
+            ->count('uid')
+            ->from('tt_content')
+            ->where(
+                $queryBuilder->expr()->eq(
+                    'pid',
+                    $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT)
+                )
+            )
+            ->andWhere(
+                $queryBuilder->expr()->eq(
+                    'sys_language_uid',
+                    $queryBuilder->createNamedParameter($sysLang, \PDO::PARAM_INT)
+                )
+            )
+            ->execute()
+            ->fetchColumn(0);
+        return $count ?: '-';
+    }
+
+    /**
+     * Returns LanguageService
+     *
+     * @return \TYPO3\CMS\Core\Localization\LanguageService
+     */
+    protected function getLanguageService()
+    {
+        return $GLOBALS['LANG'];
+    }
+
+    /**
+     * Returns the current BE user.
+     *
+     * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
+     */
+    protected function getBackendUser()
+    {
+        return $GLOBALS['BE_USER'];
+    }
+}
diff --git a/typo3/sysext/info/Migrations/Code/ClassAliasMap.php b/typo3/sysext/info/Migrations/Code/ClassAliasMap.php
new file mode 100644 (file)
index 0000000..314dc79
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+return [
+    'TYPO3\\CMS\\Frontend\\Controller\\PageInformationController' => \TYPO3\CMS\Info\Controller\PageInformationController::class,
+    'TYPO3\\CMS\\Frontend\\Controller\\TranslationStatusController' => \TYPO3\CMS\Info\Controller\TranslationStatusController::class,
+];
diff --git a/typo3/sysext/info/Migrations/Code/LegacyClassesForIde.php b/typo3/sysext/info/Migrations/Code/LegacyClassesForIde.php
new file mode 100644 (file)
index 0000000..5e476fb
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+namespace {
+    die('Access denied');
+}
+
+namespace TYPO3\CMS\Frontend\Controller {
+    class PageInformationController extends \TYPO3\CMS\Info\Controller\PageInformationController
+    {
+    }
+    class TranslationStatusController extends \TYPO3\CMS\Info\Controller\TranslationStatusController
+    {
+    }
+}
diff --git a/typo3/sysext/info/Resources/Private/Language/locallang_csh_webinfo.xlf b/typo3/sysext/info/Resources/Private/Language/locallang_csh_webinfo.xlf
new file mode 100644 (file)
index 0000000..0ea122b
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
+       <file t3:id="1415814788" source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:32Z" product-name="cms">
+               <header/>
+               <body>
+                       <trans-unit id="func_0.alttitle">
+                               <source>Basic Settings</source>
+                       </trans-unit>
+                       <trans-unit id="func_0.description">
+                               <source>Displays a selection of fields from page records which are regarded as foundational settings for pages. That includes aliases, start- and stop times, access restriction information etc.</source>
+                       </trans-unit>
+                       <trans-unit id="func_0.details" xml:space="preserve">
+                               <source>The Basic Settings view resembles the Cache and Age view quite a lot. They are different only by the selection of fields they show.
+
+&lt;b&gt;Batch editing page fields&lt;/b&gt;
+You will find multiple edit-icons around the interface. All edit icons in head lines will bring you to an editing dialog where you can change exactly that field for all listed tables! Very useful for batch-editing of say all "Start" times.
+If you click the edit icon at the ID numbers of pages you will get straight to the regular editing of a whole page record.</source>
+                       </trans-unit>
+                       <trans-unit id="_func_0.seeAlso" xml:space="preserve">
+                               <source>xMOD_csh_corebe:list_module,
+_MOD_web_info:func_2,
+_MOD_web_info:pagetree_overview</source>
+                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
+                       </trans-unit>
+                       <trans-unit id="_func_0.image" xml:space="preserve">
+                               <source>EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_4.png,
+EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_8.png,
+EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_9.png</source>
+                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
+                       </trans-unit>
+                       <trans-unit id="func_0.image_descr" xml:space="preserve">
+                               <source>The Basic Settings view offers a very convenient overview of page aliases, start times and access restriction settings in the tree branch.
+If you click an edit-icon in the header you will be able to edit that field for all listed pages.</source>
+                       </trans-unit>
+                       <trans-unit id="func_1.alttitle">
+                               <source>Record Overview</source>
+                       </trans-unit>
+                       <trans-unit id="func_1.description">
+                               <source>Record overview gives you an indispensable overview of the distribution of records in the page tree. Each database table in the system is represented with a column and for each page you can see the number of records from that table located on the page.</source>
+                       </trans-unit>
+                       <trans-unit id="func_1.details" xml:space="preserve">
+                               <source>&lt;b&gt;Notice:&lt;/b&gt; Be careful with the level-setting. A high level-setting may cause the module to respond very slowly if there are many pages and many records in the database as well!
+
+&lt;b&gt;Tree stop?&lt;/b&gt;
+Notice the red "+" next to a page in the page tree? This is due to a setting for that page record which means that the page tree will not expand for this page. Typically this is set for protection when there are a large amount of subpages underneath (hundreds of pages typically). If you click the icon/title the overview will jump to make this page the new root of the overview.</source>
+                       </trans-unit>
+                       <trans-unit id="_func_1.seeAlso" xml:space="preserve">
+                               <source>_MOD_web_info:pagetree_overview,
+pages:php_tree_stop</source>
+                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
+                       </trans-unit>
+                       <trans-unit id="_func_1.image">
+                               <source>EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_6.png</source>
+                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
+                       </trans-unit>
+                       <trans-unit id="func_1.image_descr">
+                               <source>You can easily see the distribution of Content Elements on a page. You can also see where Template Records - and basically any record! - are located in the page tree!</source>
+                       </trans-unit>
+                       <trans-unit id="func_2.alttitle">
+                               <source>Cache and Age</source>
+                       </trans-unit>
+                       <trans-unit id="func_2.description">
+                               <source>Displays a selection of fields from page records related to page caching and time settings.</source>
+                       </trans-unit>
+                       <trans-unit id="_func_2.seeAlso" xml:space="preserve">
+                               <source>_MOD_web_info:func_0,
+_MOD_web_info:pagetree_overview,
+pages:TSconfig</source>
+                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
+                       </trans-unit>
+                       <trans-unit id="_func_2.image" xml:space="preserve">
+                               <source>EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_5.png,
+EXT:frontend/Resources/Public/Images/cshimages/pagetree_overview_7.png</source>
+                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
+                       </trans-unit>
+                       <trans-unit id="func_2.image_descr" xml:space="preserve">
+                               <source>The "Cache and Age" view.
+Here you see the "TSconfig" column. The overview exposes that these two pages include some Page TSconfig code!</source>
+                       </trans-unit>
+
+                       <trans-unit id="lang.details" xml:space="preserve">
+                               <source>The overview uses colors to signal the availability and fall back situation for a given page. Here is a description for each color code:
+&lt;b&gt;Green background:&lt;/b&gt; Page is translated and viewable in this language. For translations it means that an active page overlay record is present.
+&lt;b&gt;Red background:&lt;/b&gt; Page &lt;em&gt;cannot&lt;/em&gt; be viewed in this language and you will see an error message if you try. Menus should automatically filter out links to pages with this translation.
+&lt;b&gt;Gray background (not available for default language):&lt;/b&gt; Page will fall back to the specified fallback mode for content. Depends on configuration. (sys_language_mode = content_fallback is recommended for most flexible fallback, sys_language_mode = strict will prevent this and issue an error instead!)
+
+&lt;b&gt;The pages "Localization settings:"&lt;/b&gt;
+It is the "Localization settings" of the page record that determines the modes above. In the column of the default translation each of these settings are represented by a "N" (Hide page if no translation for current language exists) or a "D" (Hide default translation of page).
+As you can see the page "Startpage" has the N flag set and therefore any access to the german version of that page will be blocked with an error message because there is no translation in german. By default "german access" to a non-translated page will just show the english content.
+There is also a page with the D flag ("[Dummy]"). The D flag means that the page is only available in one of the translations, in this case Danish. So any attempt to access the page in the default language or german will show an error message.
+
+So, when the "Localization settings" checkboxes for a page are used, you will get an error message when you try to request a page which has been blocked. This is a feature. The trick is not to create links to those pages.
+
+Menus generated from HMENU objects will always take "sys_language" into account and display only pages which can be accessed for that language. But combined with the "localization settings" of pages which may block page access this becomes a problem with pages which are &lt;em&gt;not&lt;/em&gt; translated (has gray background); You might get menu items which links to non-accessible pages.
+The problem basically is that "&amp;L=xx" is different from internal "sys_language". You would like to avoid that and to do so you should configure "sys_language_mode" to "content_fallback". If you do that sys_language will &lt;em&gt;always&lt;/em&gt; follow what "&amp;L=" instructs it to and your menus will be right. At the same time you will get the default content displayed if no translation exists (because content selection falls back).
+
+Finally, the number found in each column tells you how many content elements are found in the specified language.</source>
+                       </trans-unit>
+                       <trans-unit id="_lang.image" xml:space="preserve">
+                               <source>EXT:frontend/Resources/Public/Images/cshimages/localizationoverview.png,
+EXT:frontend/Resources/Public/Images/cshimages/localizationoverview1.png</source>
+                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
+                       </trans-unit>
+                       <trans-unit id="lang.image_descr" xml:space="preserve">
+                               <source>Localization overview in the Web&gt;Info module. Use the buttons to edit, view and create new page translation headers. Use the regular page module to put localized content on the pages.
+The "Localization settings" that affect availability of pages in the various languages.</source>
+                       </trans-unit>
+                       <trans-unit id="lang.alttitle">
+                               <source>Localization overview</source>
+                       </trans-unit>
+                       <trans-unit id="lang.description">
+                               <source>Gives an overview of which pages in the page tree are translated to the system languages installed.</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
diff --git a/typo3/sysext/info/Resources/Private/Language/locallang_webinfo.xlf b/typo3/sysext/info/Resources/Private/Language/locallang_webinfo.xlf
new file mode 100644 (file)
index 0000000..abe3e99
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
+       <file t3:id="1415814792" source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:32Z" product-name="cms">
+               <header/>
+               <body>
+                       <trans-unit id="page_title">
+                               <source>Pagetree overview</source>
+                       </trans-unit>
+                       <trans-unit id="page_sysnote">
+                               <source>Internal notes</source>
+                       </trans-unit>
+                       <trans-unit id="pageInformation">
+                               <source>Page information</source>
+                       </trans-unit>
+                       <trans-unit id="pages_0">
+                               <source>Basic settings</source>
+                       </trans-unit>
+                       <trans-unit id="pages_2">
+                               <source>Cache and Age</source>
+                       </trans-unit>
+                       <trans-unit id="pages_1">
+                               <source>Record overview</source>
+                       </trans-unit>
+                       <trans-unit id="stat_type_0">
+                               <source>Page hits</source>
+                       </trans-unit>
+                       <trans-unit id="stat_type_1">
+                               <source>Total hits</source>
+                       </trans-unit>
+                       <trans-unit id="stat_type_2">
+                               <source>Hits in main sections</source>
+                       </trans-unit>
+                       <trans-unit id="stat_period">
+                               <source>Statistics in the period %s back to %s</source>
+                       </trans-unit>
+                       <trans-unit id="pI_crUser">
+                               <source>Created by</source>
+                       </trans-unit>
+                       <trans-unit id="pI_crDate">
+                               <source>Created date</source>
+                       </trans-unit>
+                       <trans-unit id="pI_lastChange">
+                               <source>Last change</source>
+                       </trans-unit>
+                       <trans-unit id="pI_lastChangeContent">
+                               <source>Last change, content</source>
+                       </trans-unit>
+                       <trans-unit id="hits_title">
+                               <source>Hit Statistics</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_viewPage">
+                               <source>View page</source>
+                       </trans-unit>
+                       <trans-unit id="lang_title">
+                               <source>Localization overview</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_editDefaultLanguagePage">
+                               <source>Edit default language page properties</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_editLangOverlays">
+                               <source>Edit all language overlay records</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_editPageProperties">
+                               <source>Edit all page properties</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_editPage">
+                               <source>Edit page</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_editPageLang">
+                               <source>Edit page translation</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_badThingThereAre">
+                               <source>ERROR: there are two or more page overlay records for this language! Only one is allowed!</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_editLanguageOverlayRecord">
+                               <source>Edit language overlay record</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_page">
+                               <source>Page</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_default">
+                               <source>Default</source>
+                       </trans-unit>
+                       <trans-unit id="lang_getlangsta_createNewTranslationHeaders">
+                               <source>Create new translation headers</source>
+                       </trans-unit>
+                       <trans-unit id="lang_renderl10n_CEcount">
+                               <source>Content Element Count</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
index 73022fd..5bbb52e 100644 (file)
                                "partOfFactoryDefault": true
                        },
                        "extension-key": "info"
+               },
+               "typo3/class-alias-loader": {
+                       "always-add-alias-loader": true,
+                       "class-alias-maps": [
+                               "Migrations/Code/ClassAliasMap.php"
+                       ]
                }
        },
        "autoload": {
index 541f586..9296b23 100644 (file)
@@ -16,4 +16,17 @@ if (TYPO3_MODE === 'BE') {
         ]
     );
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_web_info', 'EXT:info/Resources/Private/Language/locallang_csh_web_info.xlf');
+
+    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
+        'web_info',
+        \TYPO3\CMS\Info\Controller\PageInformationController::class,
+        null,
+        'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:mod_tx_cms_webinfo_page'
+    );
+    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
+        'web_info',
+        \TYPO3\CMS\Info\Controller\TranslationStatusController::class,
+        null,
+        'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:mod_tx_cms_webinfo_lang'
+    );
 }
index 3551c07..9e242c8 100644 (file)
@@ -23,10 +23,10 @@ class InfoModuleHook
      * Add sys_notes as additional content to the footer of the info module
      *
      * @param array $params
-     * @param \TYPO3\CMS\Frontend\Controller\PageInformationController $parentObject
+     * @param \TYPO3\CMS\Info\Controller\PageInformationController $parentObject
      * @return string
      */
-    public function render(array $params = [], \TYPO3\CMS\Frontend\Controller\PageInformationController $parentObject)
+    public function render(array $params = [], \TYPO3\CMS\Info\Controller\PageInformationController $parentObject)
     {
         /** @var $noteBootstrap \TYPO3\CMS\SysNote\Core\Bootstrap */
         $noteBootstrap = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\SysNote\Core\Bootstrap::class);