Cleanup: Updated copyright comments
[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 * Contains a class for the Wizard function in the Web>Info module
29 *
30 * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
31 * XHTML compliant
32 *
33 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
34 */
35 /**
36 * [CLASS/FUNCTION INDEX of SCRIPT]
37 *
38 *
39 *
40 * 66: class tx_funcwizards_webfunc extends t3lib_extobjbase
41 * 78: function init(&$pObj,$conf)
42 * 92: function modMenu()
43 * 111: function main()
44 *
45 * TOTAL FUNCTIONS: 3
46 * (This index is automatically created/updated by the extension "extdeveval")
47 *
48 */
49
50 /**
51 * The Wizard function in the Web>Info module
52 * Creates a framework for adding wizard sub-sub-modules under the Wizard function in Web>Info
53 *
54 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
55 * @package TYPO3
56 * @subpackage tx_funcwizardswebfunc
57 */
58 class tx_funcwizards_webfunc extends t3lib_extobjbase {
59 var $function_key = 'wiz';
60
61 /**
62 * Initialize.
63 * Calls parent init function and then the handleExternalFunctionValue() function from the parent class
64 *
65 * @param object A reference to the parent (calling) object (which is probably an instance of an extension class to t3lib_SCbase)
66 * @param array The configuration set for this module - from global array TBE_MODULES_EXT
67 * @return void
68 * @see t3lib_extobjbase::handleExternalFunctionValue(), t3lib_extobjbase::init()
69 */
70 function init(&$pObj,$conf) {
71 // OK, handles ordinary init. This includes setting up the menu array with ->modMenu
72 parent::init($pObj,$conf);
73
74 // 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!!!
75 $this->handleExternalFunctionValue();
76 }
77
78 /**
79 * Modifies parent objects internal MOD_MENU array, adding items this module needs.
80 *
81 * @return array Items merged with the parent objects.
82 * @see t3lib_extobjbase::init()
83 */
84 function modMenu() {
85 global $LANG;
86
87 $modMenuAdd = array(
88 $this->function_key => array()
89 );
90
91 $modMenuAdd[$this->function_key] = $this->pObj->mergeExternalItems($this->pObj->MCONF['name'],$this->function_key,$modMenuAdd[$this->function_key]);
92 $modMenuAdd[$this->function_key] = t3lib_BEfunc::unsetMenuItems($this->pObj->modTSconfig['properties'],$modMenuAdd[$this->function_key],'menu.'.$this->function_key);
93
94 return $modMenuAdd;
95 }
96
97 /**
98 * Creation of the main content. Calling extObjContent() to trigger content generation from the sub-sub modules
99 *
100 * @return string The content
101 * @see t3lib_extobjbase::extObjContent()
102 */
103 function main() {
104 global $SOBE,$LANG;
105
106 $menu= $LANG->getLL('wiz_lWizards',1).': '.t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[wiz]',$this->pObj->MOD_SETTINGS['wiz'],$this->pObj->MOD_MENU['wiz']);
107 $theOutput.=$this->pObj->doc->section('','<span class="nobr">'.$menu.'</span>');
108
109 $content = '';
110 $content.=$theOutput;
111 $content.=$this->pObj->doc->spacer(5);
112 $content.=$this->extObjContent();
113
114 return $content;
115 }
116 }
117
118 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/func_wizards/class.tx_funcwizards_webfunc.php'])) {
119 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/func_wizards/class.tx_funcwizards_webfunc.php']);
120 }
121 ?>