|
TYPO3 API
SVNRelease
|
00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 1999-2011 Kasper Skårhøj (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 ***************************************************************/ 00027 /** 00028 * Displays the vertical menu in the left most frame of TYPO3s backend 00029 * 00030 * $Id: alt_menu.php 10295 2011-01-25 09:33:06Z baschny $ 00031 * Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj 00032 * XHTML-trans compliant 00033 * 00034 * @author Kasper Skårhøj <kasperYYYY@typo3.com> 00035 * @co-author Sebastian Kurfürst <sebastian@garbage-group.de> 00036 */ 00037 /** 00038 * [CLASS/FUNCTION INDEX of SCRIPT] 00039 * 00040 * 00041 * 00042 * 80: class SC_alt_menu 00043 * 91: function init() 00044 * 108: function main() 00045 * 190: function printContent() 00046 * 00047 * TOTAL FUNCTIONS: 3 00048 * (This index is automatically created/updated by the extension "extdeveval") 00049 * 00050 * @deprecated since TYPO3 4.5, this file will be removed in TYPO3 4.7. The TYPO3 backend is using typo3/backend.php with less frames, which makes this file obsolete. 00051 */ 00052 00053 00054 require ('init.php'); 00055 require ('template.php'); 00056 require_once ('class.alt_menu_functions.inc'); 00057 00058 00059 t3lib_div::deprecationLog('alt_palette.php is deprecated since TYPO3 4.5, this file will be removed in TYPO3 4.7. The TYPO3 backend is using typo3/backend.php with less frames, which makes this file obsolete.'); 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 /** 00073 * Script Class for rendering the vertical menu in the left side of the backend frameset 00074 * 00075 * @author Kasper Skårhøj <kasperYYYY@typo3.com> 00076 * @co-author Sebastian Kurfürst <sebastian@garbage-group.de> 00077 * @package TYPO3 00078 * @subpackage core 00079 */ 00080 class SC_alt_menu { 00081 00082 // Internal, Static: GPvar 00083 var $_clearCacheFiles; 00084 00085 /** 00086 * Menu functions object 00087 * 00088 * @var alt_menu_functions 00089 */ 00090 var $alt_menuObj; 00091 00092 /** 00093 * Initialize 00094 * Loads the backend modules available for the logged in user. 00095 * 00096 * @return void 00097 */ 00098 function init() { 00099 global $TBE_MODULES, $TBE_TEMPLATE; 00100 00101 // Setting GPvars: 00102 $this->_clearCacheFiles = t3lib_div::_GP('_clearCacheFiles'); 00103 00104 // Loads the backend modules available for the logged in user. 00105 $this->loadModules = t3lib_div::makeInstance('t3lib_loadModules'); 00106 $this->loadModules->observeWorkspaces = TRUE; 00107 $this->loadModules->load($TBE_MODULES); 00108 00109 // Instantiates the menu object which will generate some JavaScript for the goToModule() JS function in this frame. 00110 $this->alt_menuObj = t3lib_div::makeInstance('alt_menu_functions'); 00111 00112 $TBE_TEMPLATE->JScodeArray[] = $this->alt_menuObj->generateMenuJScode($this->loadModules->modules); 00113 } 00114 00115 /** 00116 * Main content generated 00117 * 00118 * @return void 00119 */ 00120 function main() { 00121 global $BE_USER,$TYPO3_CONF_VARS,$TBE_TEMPLATE; 00122 00123 $TBE_TEMPLATE->divClass='vertical-menu'; 00124 $TBE_TEMPLATE->bodyTagAdditions = 'onload="top.restoreHighlightedModuleMenuItem()"'; 00125 00126 $this->content.=$TBE_TEMPLATE->startPage('Vertical Backend Menu'); 00127 $backPath = $GLOBALS['BACK_PATH']; 00128 00129 // Printing the menu 00130 $alt_menuObj = t3lib_div::makeInstance('alt_menu_functions'); 00131 $this->content.= $alt_menuObj->topMenu($this->loadModules->modules); 00132 00133 // clear cache commands for Admins and allowed users 00134 if($GLOBALS['BE_USER']->isAdmin() 00135 || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.pages') 00136 || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.all')) { // && $BE_USER->workspace===0 NOT used anyway because under a workspace developers might still like to clear cache! 00137 $functionsArray = $alt_menuObj->adminFunctions($backPath); 00138 00139 $this->content.=' 00140 00141 <!-- 00142 Menu with admin functions: Clearing cache: 00143 --> 00144 <div id="typo3-alt-menu-php-adminFunc">'; 00145 00146 00147 // Table with those admin functions 00148 $this->content.=' 00149 <table border="0" cellpadding="0" cellspacing="1" width="100%" id="typo3-adminmenu">'; 00150 00151 // Header: Admin functions 00152 $this->content.=' 00153 <tr class="c-mainitem"> 00154 <td colspan="2"><span class="c-label"><strong>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.adminFunctions',1).'</strong> </span><span class="c-iconCollapse"></span></td> 00155 </tr>'; 00156 00157 $rows=array(); 00158 foreach($functionsArray as $functionsArraySetup) { 00159 if(($functionsArraySetup['id'] == 'all' && ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.all'))) 00160 || ($functionsArraySetup['id'] == 'temp_CACHED' && $GLOBALS['BE_USER']->isAdmin())) { 00161 $rows[]=' 00162 <tr class="c-subitem"> 00163 <td valign="top" align="center" class="icon">'.$functionsArraySetup['icon'].'</td> 00164 <td><a href="'.htmlspecialchars($functionsArraySetup['href']).'">'.htmlspecialchars($functionsArraySetup['title']).'</a></td> 00165 </tr>'; 00166 } 00167 } 00168 00169 // Imploding around the divider table row: 00170 $this->content.=implode(' 00171 <tr> 00172 <td colspan="2"><img'.t3lib_iconWorks::skinImg($backPath,'gfx/altmenuline.gif','width="105" height="3"').' alt="" /></td> 00173 </tr>',$rows); 00174 00175 $this->content.=' 00176 </table>'; 00177 $this->content.=t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'menu_adminFunction', $GLOBALS['BACK_PATH']); 00178 $this->content.=' 00179 </div> 00180 '; 00181 } 00182 00183 // superuser mode 00184 if($BE_USER->user['ses_backuserid']) { 00185 $username = '<p id="username" class="typo3-red-background">[' . 00186 $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xml:switchtousershort') . ' ' . 00187 htmlspecialchars($BE_USER->user['username']) . ']</p>'; 00188 } else { 00189 $username = '<p id="username">[' . htmlspecialchars($BE_USER->user['username']) . ']</p>'; 00190 } 00191 // Printing buttons (logout button) 00192 $this->content.=' 00193 00194 00195 <!-- 00196 Logout button / username 00197 --> 00198 <div id="typo3-alt-menu-php-logininfo">'.$alt_menuObj->topButtons().$username.' 00199 </div>'; 00200 00201 // End page: 00202 $this->content.=$TBE_TEMPLATE->endPage(); 00203 } 00204 00205 /** 00206 * Outputting the accumulated content to screen 00207 * 00208 * @return void 00209 */ 00210 function printContent() { 00211 echo $this->content; 00212 } 00213 } 00214 00215 00216 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/alt_menu.php'])) { 00217 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/alt_menu.php']); 00218 } 00219 00220 00221 00222 // Make instance: 00223 $SOBE = t3lib_div::makeInstance('SC_alt_menu'); 00224 $SOBE->init(); 00225 $SOBE->main(); 00226 $SOBE->printContent(); 00227 00228 ?>
1.8.0