[TASK] Remove documentTemplate sections at WebFunctionWizardsBaseController
[Packages/TYPO3.CMS.git] / typo3 / sysext / compatibility6 / Classes / Controller / WebFunctionWizardsBaseController.php
1 <?php
2 namespace TYPO3\CMS\Compatibility6\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\Module\BaseScriptClass;
18
19 /**
20 * The Wizard function in the Web>Info module
21 * Creates a framework for adding wizard sub-sub-modules under the Wizard function in Web>Info
22 */
23 class WebFunctionWizardsBaseController extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule
24 {
25 /**
26 * @var string
27 */
28 public $function_key = 'wiz';
29
30 /**
31 * Initialize.
32 * Calls parent init function and then the handleExternalFunctionValue() function from the parent class
33 *
34 * @param BaseScriptClass $pObj A reference to the parent (calling) object (which is probably an instance of an extension class to \TYPO3\CMS\Backend\Module\BaseScriptClass)
35 * @param array $conf The configuration set for this module - from global array TBE_MODULES_EXT
36 * @return void
37 */
38 public function init(&$pObj, $conf)
39 {
40 // OK, handles ordinary init. This includes setting up the menu array with ->modMenu
41 parent::init($pObj, $conf);
42 $this->handleExternalFunctionValue();
43 }
44
45 /**
46 * Modifies parent objects internal MOD_MENU array, adding items this module needs.
47 *
48 * @return array Items merged with the parent objects.
49 */
50 public function modMenu()
51 {
52 $GLOBALS['LANG']->includeLLFile('EXT:func_wizards/locallang.xlf');
53 $modMenuAdd = array(
54 $this->function_key => array()
55 );
56 $modMenuAdd[$this->function_key] = $this->pObj->mergeExternalItems($this->pObj->MCONF['name'], $this->function_key, $modMenuAdd[$this->function_key]);
57 $modMenuAdd[$this->function_key] = \TYPO3\CMS\Backend\Utility\BackendUtility::unsetMenuItems(
58 $this->pObj->modTSconfig['properties'],
59 $modMenuAdd[$this->function_key],
60 'menu.' . $this->function_key
61 );
62 return $modMenuAdd;
63 }
64
65 /**
66 * Creation of the main content. Calling extObjContent() to trigger content generation from the sub-sub modules
67 *
68 * @return string The content
69 */
70 public function main()
71 {
72 $menu = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
73 $this->pObj->id,
74 'SET[wiz]',
75 $this->pObj->MOD_SETTINGS['wiz'],
76 $this->pObj->MOD_MENU['wiz']
77 );
78
79 $content = '';
80 if (!empty($menu)) {
81 $menu = $GLOBALS['LANG']->getLL('wiz_lWizards', true) . ': ' . $menu;
82 $content = '<div>';
83 $content .= '<span class="text-nowrap">' . $menu . '</span>';
84 $content .= '</div>';
85 $content .= '<div style="padding-top: 20px;"></div>';
86 }
87
88 $content .= $this->extObjContent();
89 return $content;
90 }
91 }