[FEATURE] Trigger execution of a specific task from CLI
[Packages/TYPO3.CMS.git] / typo3 / sysext / func_wizards / class.tx_funcwizards_webfunc.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27
28 /**
29 * Contains a class for the Wizard function in the Web>Info module
30 *
31 * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
32 * XHTML compliant
33 *
34 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
35 */
36
37 /**
38 * The Wizard function in the Web>Info module
39 * Creates a framework for adding wizard sub-sub-modules under the Wizard function in Web>Info
40 *
41 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
42 * @package TYPO3
43 * @subpackage tx_funcwizardswebfunc
44 */
45 class tx_funcwizards_webfunc extends t3lib_extobjbase {
46 var $function_key = 'wiz';
47
48 /**
49 * Initialize.
50 * Calls parent init function and then the handleExternalFunctionValue() function from the parent class
51 *
52 * @param object $pObj A reference to the parent (calling) object (which is probably an instance of an extension class to t3lib_SCbase)
53 * @param array $conf The configuration set for this module - from global array TBE_MODULES_EXT
54 * @return void
55 * @see t3lib_extobjbase::handleExternalFunctionValue(), t3lib_extobjbase::init()
56 */
57 function init(&$pObj, $conf) {
58 // OK, handles ordinary init. This includes setting up the menu array with ->modMenu
59 parent::init($pObj, $conf);
60
61 // Making sure that any further external classes are added to the include_once array. Notice that inclusion happens twice in the main script because of this!!!
62 $this->handleExternalFunctionValue();
63 }
64
65 /**
66 * Modifies parent objects internal MOD_MENU array, adding items this module needs.
67 *
68 * @return array Items merged with the parent objects.
69 * @see t3lib_extobjbase::init()
70 */
71 function modMenu() {
72 global $LANG;
73
74 $modMenuAdd = array(
75 $this->function_key => array()
76 );
77
78 $modMenuAdd[$this->function_key] = $this->pObj->mergeExternalItems($this->pObj->MCONF['name'], $this->function_key, $modMenuAdd[$this->function_key]);
79 $modMenuAdd[$this->function_key] = t3lib_BEfunc::unsetMenuItems($this->pObj->modTSconfig['properties'], $modMenuAdd[$this->function_key], 'menu.'.$this->function_key);
80
81 return $modMenuAdd;
82 }
83
84 /**
85 * Creation of the main content. Calling extObjContent() to trigger content generation from the sub-sub modules
86 *
87 * @return string The content
88 * @see t3lib_extobjbase::extObjContent()
89 */
90 function main() {
91 global $SOBE,$LANG;
92
93 $menu = $LANG->getLL('wiz_lWizards', 1) . ': ' . t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[wiz]', $this->pObj->MOD_SETTINGS['wiz'], $this->pObj->MOD_MENU['wiz']);
94 $theOutput.=$this->pObj->doc->section('', '<span class="nobr">'.$menu.'</span>');
95
96 $content = '';
97 $content .= $theOutput;
98 $content .= $this->pObj->doc->spacer(20);
99 $content .= $this->extObjContent();
100
101 return $content;
102 }
103 }
104 ?>