2 /***************************************************************
5 * (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
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.
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.
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.
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
30 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
31 * @author Christian Jul Jensen <christian(at)jul(dot)net>
32 * Revision for TYPO3 3.8.0 / Native Workflow System
37 require ($BACK_PATH.'init.php');
38 require ($BACK_PATH.'template.php');
39 $LANG->includeLLFile('EXT:taskcenter/task/locallang.php');
40 require_once(PATH_t3lib
.'class.t3lib_scbase.php');
41 require_once('class.mod_user_task.php');
43 $BE_USER->modAccess($MCONF, 1);
46 // ***************************
48 // ***************************
49 class SC_mod_user_task_index
extends t3lib_SCbase
{
50 var $allExtClassConf = array();
56 * @var t3lib_beUserAuth
61 * document template object
68 * This makes sure that all classes of task-center related extensions are included
69 * Further it registers the classes in the variable $this->allExtClassConf
73 function includeAllClasses() {
74 foreach($this->MOD_MENU
['function'] as $key => $name) {
75 $curExtClassConf = $this->getExternalItemConfig($this->MCONF
['name'], 'function', $key);
76 if (is_array($curExtClassConf) && $curExtClassConf['path']) {
77 $this->allExtClassConf
[] = $curExtClassConf;
78 $this->include_once[] = $curExtClassConf['path'];
84 * This is the main function called by the TYPO3 framework
86 * @return string The conntent of the module (HTML)
89 global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
91 /* Setup document template */
92 $this->doc
= t3lib_div
::makeInstance('noDoc');
93 $this->doc
->docType
= 'xhtml_trans';
94 $this->doc
->divClass
= '';
95 $this->doc
->form
= '<form action="index.php" method="POST" name="editform">';
96 $this->backPath
= $this->doc
->backPath
= $BACK_PATH;
97 $this->doc
->JScode
= ' <script language="javascript" type="text/javascript">
99 function jumpToUrl(URL) {
100 window.location.href = URL;
102 '.(is_object($this->extObj
)?
$this->extObj
->JScode():"").'
105 $this->doc
->JScode
.= $this->doc
->getDynTabMenuJScode();
106 $this->doc
->JScode
.= '<script language="javascript" type="text/javascript">
107 function resizeIframe(frame,max) {
109 innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
111 frame.height = innerDoc.body.scrollHeight + 30;
113 frame.height = Math.max(innerDoc.body.scrollHeight + 30,document.body.scrollHeight);
117 window.status = e.message;
122 /* call getMainContent first, because what happens here might affect leftContent */
123 $mainContent = $this->getMainContent();
127 $this->content
.= $this->doc
->startPage($this->MOD_MENU
['function'][$this->MOD_SETTINGS
['function']]);
128 $this->content
.= '<table style="width: 98%;"><tr>';
129 $this->content
.= '<td valign="top" style="width: 20%;">'.$this->getleftHeader().$this->getDynTabMenu().'</td>';
130 $this->content
.= '<td valign="top" style="height:100%">'.$mainContent.'</td>';
131 $this->content
.= '</tr></table>';
134 /** Generate the dynamic tab menu in the left side by iterating
135 * over all submodules and creating configurations.
137 * @return string the code for the dynamic tab menu (HTML)
139 function getDynTabMenu() {
140 //walk through registered submodules and generate configuration
143 foreach($this->allExtClassConf
as $conf) {
144 $extObj = t3lib_div
::makeInstance($conf['name']);
145 /* call init to make sure the LOCAL_LANG is included for all listed
146 * extensions. If they OVERRIDE each other there is trouble! */
147 $extObj->init($this, $conf);
148 $extObj->backPath
= $this->backPath
;
149 $extObj->mod_user_task_init($GLOBALS['BE_USER']);
150 $part = $extObj->overview_main();
151 if (is_array($part)) {
155 return $this->doc
->getDynTabMenu($parts, 'tx_taskcenter', 1, true);
159 * Generate the header of the left column
161 * @return string header in the left side (HTML)
163 function getleftHeader() {
164 $name = $GLOBALS['BE_USER']->user
['realName']?
$GLOBALS['BE_USER']->user
['realName']:
165 $GLOBALS['BE_USER']->user
['username'];
166 return '<h1>TYPO3 taskcenter <br />'.$name.'</h1>';
170 * Get the main content for the module by initiating the external object (if any) and calling it's main function.
172 * @return string main content (HTML)
174 function getMainContent() {
175 if (is_object($this->extObj
)) {
176 $this->extObj
->backPath
= $this->backPath
;
177 $this->extObj
->mod_user_task_init($GLOBALS['BE_USER']);
178 return $this->extObj
->main();
183 * Output the content of the object to the browser
187 function printContent() {
188 $this->content
.= $this->doc
->endPage();
196 // Include extension?
197 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['ext/taskcenter/task/index.php']) {
198 include_once($TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['ext/taskcenter/task/index.php']);
204 $SOBE = t3lib_div
::makeInstance('SC_mod_user_task_index');
206 $SOBE->includeAllClasses();
209 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
210 $SOBE->checkExtObj(); // Checking for first level external objects
213 $SOBE->printContent();