"TYPO3 4.0.1: typo3_src-4.0.1/typo3/sysext/taskcenter/task/index.php Source File", "datetime" => "Sat Dec 2 19:22:17 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?>

index.php

00001 <?php
00002         /***************************************************************
00003         *  Copyright notice
00004         *
00005         *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006         *  All rights reserved
00007         *
00008         *  This script is part of the TYPO3 project. The TYPO3 project is
00009         *  free software; you can redistribute it and/or modify
00010         *  it under the terms of the GNU General Public License as published by
00011         *  the Free Software Foundation; either version 2 of the License, or
00012         *  (at your option) any later version.
00013         *
00014         *  The GNU General Public License can be found at
00015         *  http://www.gnu.org/copyleft/gpl.html.
00016         *  A copy is found in the textfile GPL.txt and important notices to the license
00017         *  from the author is found in LICENSE.txt distributed with these scripts.
00018         *
00019         *
00020         *  This script is distributed in the hope that it will be useful,
00021         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023         *  GNU General Public License for more details.
00024         *
00025         *  This copyright notice MUST APPEAR in all copies of the script!
00026         ***************************************************************/
00036         unset($MCONF);
00037         require ('conf.php');
00038         require ($BACK_PATH.'init.php');
00039         require ($BACK_PATH.'template.php');
00040         $LANG->includeLLFile('EXT:taskcenter/task/locallang.php');
00041         require_once(PATH_t3lib.'class.t3lib_scbase.php');
00042         require_once('class.mod_user_task.php');
00043 
00044         $BE_USER->modAccess($MCONF, 1);
00045 
00046 
00047         // ***************************
00048         // Script Classes
00049         // ***************************
00050         class SC_mod_user_task_index extends t3lib_SCbase {
00051                 var $allExtClassConf = array();
00052                 var $backPath;
00053                 var $BE_USER;
00054 
00061                 function includeAllClasses() {
00062                         foreach($this->MOD_MENU['function'] as $key => $name) {
00063                                 $curExtClassConf = $this->getExternalItemConfig($this->MCONF['name'], 'function', $key);
00064                                 if (is_array($curExtClassConf) && $curExtClassConf['path']) {
00065                                         $this->allExtClassConf[] = $curExtClassConf;
00066                                         $this->include_once[] = $curExtClassConf['path'];
00067                                 }
00068                         }
00069                 }
00070 
00076                 function main() {
00077                         global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
00078 
00079 
00080                         /* Setup document template */
00081                         $this->doc = t3lib_div::makeInstance('noDoc');
00082                         $this->doc->docType = 'xhtml_trans';
00083                         $this->doc->divClass = '';
00084                         $this->doc->form = '<form action="index.php" method="POST" name="editform">';
00085                         $this->backPath = $this->doc->backPath = $BACK_PATH;
00086                         $this->doc->JScode = '  <script language="javascript" type="text/javascript">
00087                                 script_ended = 0;
00088                                 function jumpToUrl(URL) {
00089                                 window.location.href = URL;
00090                                 }
00091                                 '.(is_object($this->extObj)?$this->extObj->JScode():"").'
00092                                 </script>
00093                                 ';
00094                         $this->doc->JScode .= $this->doc->getDynTabMenuJScode();
00095                         $this->doc->JScode .= '  <script language="javascript" type="text/javascript">
00096                         function resizeIframe(frame,max) {
00097                         try {
00098                                         innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
00099                                                         if(max==0) {
00100                                                 frame.height = innerDoc.body.scrollHeight + 30;
00101                                                         } else {
00102                                                 frame.height = Math.max(innerDoc.body.scrollHeight + 30,document.body.scrollHeight);
00103                                                         }
00104                         }
00105                         catch (e) {
00106                         window.status = e.message;
00107                         }
00108 
00109                         }
00110  </script>';
00111 
00112                         /* call getMainContent first, because what happens here might affect leftContent */
00113                         $mainContent = $this->getMainContent();
00114 
00115                         /* content... */
00116                         $this->content = '';
00117                         $this->content .= $this->doc->startPage($this->MOD_MENU['function'][$this->MOD_SETTINGS['function']]);
00118                         $this->content .= '<table style="width: 98%;"><tr>';
00119                         $this->content .= '<td valign="top" style="width: 20%;">'.$this->getleftHeader().$this->getDynTabMenu().'</td>';
00120                         $this->content .= '<td valign="top" style="height:100%">'.$mainContent.'</td>';
00121                         $this->content .= '</tr></table>';
00122                 }
00123 
00129                 Function getDynTabMenu() {
00130                         //walk through registered submodules and generate configuration
00131                         //for tabmenu
00132                         $parts = Array();
00133                         foreach($this->allExtClassConf as $conf) {
00134                                 $extObj = t3lib_div::makeInstance($conf['name']);
00135                                 /* call init to make sure the LOCAL_LANG is included for all listed
00136                                 * extensions. If they OVERRIDE each other there is trouble! */
00137                                 $extObj->init($this, $conf);
00138                                 $extObj->backPath = $this->backPath;
00139                                 $extObj->mod_user_task_init($GLOBALS['BE_USER']);
00140                                 $part = $extObj->overview_main();
00141                                 if (is_array($part)) {
00142                                         $parts[] = $part;
00143                                 }
00144                         }
00145                         return $this->doc->getDynTabMenu($parts, 'tx_taskcenter', 1, true);
00146                 }
00147 
00153                 function getleftHeader() {
00154                         $name = $GLOBALS['BE_USER']->user['realName']?$GLOBALS['BE_USER']->user['realName']:
00155                         $GLOBALS['BE_USER']->user['username'];
00156                         return '<h1>TYPO3 taskcenter <br />'.$name.'</h1>';
00157 
00158                 }
00159 
00165                 function getMainContent() {
00166                         if (is_object($this->extObj)) {
00167                                 $this->extObj->backPath = $this->backPath;
00168                                 $this->extObj->mod_user_task_init($GLOBALS['BE_USER']);
00169                                 return $this->extObj->main();
00170                         }
00171                 }
00172 
00178                 function printContent() {
00179                         $this->content .= $this->doc->endPage();
00180                         echo $this->content;
00181                 }
00182 
00183         }
00184 
00185 
00186 
00187         // Include extension?
00188         if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/taskcenter/task/index.php']) {
00189                 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/taskcenter/task/index.php']);
00190         }
00191 
00192 
00193 
00194 
00195 
00196 
00197 
00198 
00199 
00200 
00201 
00202         // Make instance:
00203         $SOBE = t3lib_div::makeInstance('SC_mod_user_task_index');
00204         $SOBE->init();
00205         $SOBE->includeAllClasses();
00206 
00207         // Include files?
00208         foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
00209         $SOBE->checkExtObj(); // Checking for first level external objects
00210 
00211         $SOBE->main();
00212         $SOBE->printContent();
00213 ?>