[CLEANUP] Improve the @param/@return/@var PHPDoc
[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 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
24 */
25 class WebFunctionWizardsBaseController extends \TYPO3\CMS\Backend\Module\AbstractFunctionModule {
26
27 /**
28 * @var string
29 */
30 public $function_key = 'wiz';
31
32 /**
33 * Initialize.
34 * Calls parent init function and then the handleExternalFunctionValue() function from the parent class
35 *
36 * @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)
37 * @param array $conf The configuration set for this module - from global array TBE_MODULES_EXT
38 * @return void
39 */
40 public function init(&$pObj, $conf) {
41 // OK, handles ordinary init. This includes setting up the menu array with ->modMenu
42 parent::init($pObj, $conf);
43 $this->handleExternalFunctionValue();
44 }
45
46 /**
47 * Modifies parent objects internal MOD_MENU array, adding items this module needs.
48 *
49 * @return array Items merged with the parent objects.
50 */
51 public function modMenu() {
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 $menu = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(
72 $this->pObj->id,
73 'SET[wiz]',
74 $this->pObj->MOD_SETTINGS['wiz'],
75 $this->pObj->MOD_MENU['wiz']
76 );
77
78 $content = '';
79 if (!empty($menu)) {
80 $menu = $GLOBALS['LANG']->getLL('wiz_lWizards', TRUE) . ': ' . $menu;
81 $content = $this->pObj->doc->section('', '<span class="nobr">' . $menu . '</span>');
82 $content .= $this->pObj->doc->spacer(20);
83 }
84
85 $content .= $this->extObjContent();
86 return $content;
87 }
88
89 }