[BUGFIX] Replace global use of MCONF['name']
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / Controller / PageInformationController.php
1 <?php
2 namespace TYPO3\CMS\Frontend\Controller;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Backend\Utility\BackendUtility;
18 use TYPO3\CMS\Backend\View\PageLayoutView;
19 use TYPO3\CMS\Core\Utility\GeneralUtility;
20
21 /**
22 * Class for displaying page information (records, page record properties)
23 */
24 class PageInformationController extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule {
25
26 /**
27 * Returns the menu array
28 *
29 * @return array
30 */
31 public function modMenu() {
32 return array(
33 'pages' => array(
34 0 => $GLOBALS['LANG']->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:pages_0'),
35 2 => $GLOBALS['LANG']->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:pages_2'),
36 1 => $GLOBALS['LANG']->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:pages_1')
37 ),
38 'depth' => array(
39 0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_0'),
40 1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_1'),
41 2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_2'),
42 3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_3'),
43 4 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_4'),
44 999 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_infi')
45 )
46 );
47 }
48
49 /**
50 * MAIN function for page information display
51 *
52 * @return string Output HTML for the module.
53 */
54 public function main() {
55 $theOutput = $this->pObj->doc->header($this->getLanguageService()->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:page_title'));
56 $dblist = GeneralUtility::makeInstance(PageLayoutView::class);
57 $dblist->descrTable = '_MOD_web_info';
58 $dblist->thumbs = 0;
59 $dblist->script = BackendUtility::getModuleUrl('web_info');
60 $dblist->showIcon = 0;
61 $dblist->setLMargin = 0;
62 $dblist->agePrefixes = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears');
63 $dblist->pI_showUser = 1;
64 // PAGES:
65 $this->pObj->MOD_SETTINGS['pages_levels'] = $this->pObj->MOD_SETTINGS['depth'];
66 // ONLY for the sake of dblist module which uses this value.
67 $h_func = BackendUtility::getDropdownMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']);
68 $h_func .= BackendUtility::getDropdownMenu($this->pObj->id, 'SET[pages]', $this->pObj->MOD_SETTINGS['pages'], $this->pObj->MOD_MENU['pages']);
69 $dblist->start($this->pObj->id, 'pages', 0);
70 $dblist->generateList();
71 // CSH
72 $theOutput .= $this->pObj->doc->section(
73 '',
74 BackendUtility::cshItem($dblist->descrTable, 'pagetree_overview', NULL, '|<br />')
75 . '<div class="form-inline form-inline-spaced">'
76 . $h_func
77 . '</div>'
78 . $dblist->HTMLcode,
79 0,
80 1
81 );
82 // Additional footer content
83 $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook'];
84 if (is_array($footerContentHook)) {
85 foreach ($footerContentHook as $hook) {
86 $params = array();
87 $theOutput .= GeneralUtility::callUserFunction($hook, $params, $this);
88 }
89 }
90 return $theOutput;
91 }
92 }