/src/typo3_src-4.2.0alpha1/typo3/sysext/taskcenter/task/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 ***************************************************************/
00035 unset($MCONF);
00036 require ('conf.php');
00037 require ($BACK_PATH.'init.php');
00038 require ($BACK_PATH.'template.php');
00039 $LANG->includeLLFile('EXT:taskcenter/task/locallang.php');
00040 require_once(PATH_t3lib.'class.t3lib_scbase.php');
00041 require_once('class.mod_user_task.php');
00042 
00043 $BE_USER->modAccess($MCONF, 1);
00044 
00045 
00046 // ***************************
00047 // Script Classes
00048 // ***************************
00049 class SC_mod_user_task_index extends t3lib_SCbase {
00050         var $allExtClassConf = array();
00051         var $backPath;
00052 
00058         var $BE_USER;
00059 
00065         var $doc;
00066 
00073         function includeAllClasses() {
00074                 foreach($this->MOD_MENU['function'] as $key => $name) {
00075                         $curExtClassConf = $this->getExternalItemConfig($this->MCONF['name'], 'function', $key);
00076                         if (is_array($curExtClassConf) && $curExtClassConf['path']) {
00077                                 $this->allExtClassConf[] = $curExtClassConf;
00078                                 $this->include_once[] = $curExtClassConf['path'];
00079                         }
00080                 }
00081         }
00082 
00088         function main() {
00089                 global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
00090 
00091                 /* Setup document template */
00092                 $this->doc = t3lib_div::makeInstance('noDoc');
00093                 $this->doc->docType = 'xhtml_trans';
00094                 $this->doc->divClass = '';
00095                 $this->doc->form = '<form action="index.php" method="POST" name="editform">';
00096                 $this->backPath = $this->doc->backPath = $BACK_PATH;
00097                 $this->doc->JScode = '  <script language="javascript" type="text/javascript">
00098                         script_ended = 0;
00099                         function jumpToUrl(URL) {
00100                                 window.location.href = URL;
00101                         }
00102                         '.(is_object($this->extObj)?$this->extObj->JScode():"").'
00103                         </script>
00104                         ';
00105                 $this->doc->JScode .= $this->doc->getDynTabMenuJScode();
00106                 $this->doc->JScode .= '<script language="javascript" type="text/javascript">
00107                 function resizeIframe(frame,max) {
00108                         try {
00109                                 innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
00110                                 if(max==0) {
00111                                         frame.height = innerDoc.body.scrollHeight + 30;
00112                                 } else {
00113                                         frame.height = Math.max(innerDoc.body.scrollHeight + 30,document.body.scrollHeight);
00114                                 }
00115                         }
00116                         catch (e) {
00117                                 window.status = e.message;
00118                         }
00119                 }
00120 </script>';
00121 
00122                 /* call getMainContent first, because what happens here might affect leftContent */
00123                 $mainContent = $this->getMainContent();
00124 
00125                 /* content... */
00126                 $this->content = '';
00127                 $this->content .= $this->doc->startPage($this->MOD_MENU['function'][$this->MOD_SETTINGS['function']]);
00128                 $this->content .= '<table style="width: 98%;"><tr>';
00129                 $this->content .= '<td valign="top" style="width: 20%;">'.$this->getleftHeader().$this->getDynTabMenu().'</td>';
00130                 $this->content .= '<td valign="top" style="height:100%">'.$mainContent.'</td>';
00131                 $this->content .= '</tr></table>';
00132         }
00133 
00139         function getDynTabMenu() {
00140                 //walk through registered submodules and generate configuration
00141                 //for tabmenu
00142                 $parts = Array();
00143                 foreach($this->allExtClassConf as $conf) {
00144                         $extObj = t3lib_div::makeInstance($conf['name']);
00145                         /* call init to make sure the LOCAL_LANG is included for all listed
00146                         * extensions. If they OVERRIDE each other there is trouble! */
00147                         $extObj->init($this, $conf);
00148                         $extObj->backPath = $this->backPath;
00149                         $extObj->mod_user_task_init($GLOBALS['BE_USER']);
00150                         $part = $extObj->overview_main();
00151                         if (is_array($part)) {
00152                                 $parts[] = $part;
00153                         }
00154                 }
00155                 return $this->doc->getDynTabMenu($parts, 'tx_taskcenter', 1, true);
00156         }
00157 
00163         function getleftHeader() {
00164                 $name = $GLOBALS['BE_USER']->user['realName']?$GLOBALS['BE_USER']->user['realName']:
00165                 $GLOBALS['BE_USER']->user['username'];
00166                 return '<h1>TYPO3 taskcenter <br />'.$name.'</h1>';
00167         }
00168 
00174         function getMainContent() {
00175                 if (is_object($this->extObj)) {
00176                         $this->extObj->backPath = $this->backPath;
00177                         $this->extObj->mod_user_task_init($GLOBALS['BE_USER']);
00178                         return $this->extObj->main();
00179                 }
00180         }
00181 
00187         function printContent() {
00188                 $this->content .= $this->doc->endPage();
00189                 echo $this->content;
00190         }
00191 
00192 }
00193 
00194 
00195 
00196 // Include extension?
00197 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/taskcenter/task/index.php']) {
00198         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/taskcenter/task/index.php']);
00199 }
00200 
00201 
00202 
00203 // Make instance:
00204 $SOBE = t3lib_div::makeInstance('SC_mod_user_task_index');
00205 $SOBE->init();
00206 $SOBE->includeAllClasses();
00207 
00208 // Include files?
00209 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
00210 $SOBE->checkExtObj(); // Checking for first level external objects
00211 
00212 $SOBE->main();
00213 $SOBE->printContent();
00214 
00215 ?>

This documentation has been generated automatically from TYPO3 source code using Doxygen and is provided as is by Cast Iron Coding as a courtesy to other TYPO3 developers and users. Please consider Cast Iron Coding — a full-service web development agency in Portland, Oregon specializing in TYPO3 extension development — for all of your TYPO3 development and consulting needs!