00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 require ('init.php');
00054 require ('template.php');
00055 require_once ('class.alt_menu_functions.inc');
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 class SC_alt_menu {
00079
00080
00081 var $_clearCacheFiles;
00082
00083
00084
00085
00086
00087
00088 var $alt_menuObj;
00089
00090
00091
00092
00093
00094
00095
00096 function init() {
00097 global $TBE_MODULES, $TBE_TEMPLATE;
00098
00099
00100 $this->_clearCacheFiles = t3lib_div::_GP('_clearCacheFiles');
00101
00102
00103 $this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
00104 $this->loadModules->observeWorkspaces = TRUE;
00105 $this->loadModules->load($TBE_MODULES);
00106
00107
00108 $this->alt_menuObj = t3lib_div::makeInstance('alt_menu_functions');
00109
00110 $TBE_TEMPLATE->JScodeArray[] = $this->alt_menuObj->generateMenuJScode($this->loadModules->modules);
00111 }
00112
00113
00114
00115
00116
00117
00118 function main() {
00119 global $BE_USER,$TYPO3_CONF_VARS,$TBE_TEMPLATE;
00120
00121 $TBE_TEMPLATE->divClass='vertical-menu';
00122 $TBE_TEMPLATE->bodyTagAdditions = 'onload="top.restoreHighlightedModuleMenuItem()"';
00123
00124 $this->content.=$TBE_TEMPLATE->startPage('Vertical Backend Menu');
00125 $backPath = $GLOBALS['BACK_PATH'];
00126
00127
00128 $alt_menuObj = t3lib_div::makeInstance('alt_menu_functions');
00129 $this->content.= $alt_menuObj->topMenu($this->loadModules->modules);
00130
00131
00132 if($GLOBALS['BE_USER']->isAdmin()
00133 || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.pages')
00134 || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.all')) {
00135 $functionsArray = $alt_menuObj->adminFunctions($backPath);
00136
00137 $this->content.='
00138
00139 <!--
00140 Menu with admin functions: Clearing cache:
00141 -->
00142 <div id="typo3-alt-menu-php-adminFunc">';
00143
00144
00145
00146 $this->content.='
00147 <table border="0" cellpadding="0" cellspacing="1" width="100%" id="typo3-adminmenu">';
00148
00149
00150 $this->content.='
00151 <tr class="c-mainitem">
00152 <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>
00153 </tr>';
00154
00155 $rows=array();
00156 foreach($functionsArray as $functionsArraySetup) {
00157 if(($functionsArraySetup['id'] == 'all' && ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.all')))
00158 || ($functionsArraySetup['id'] == 'temp_CACHED' && $GLOBALS['BE_USER']->isAdmin())) {
00159 $rows[]='
00160 <tr class="c-subitem">
00161 <td valign="top" align="center" class="icon">'.$functionsArraySetup['icon'].'</td>
00162 <td><a href="'.htmlspecialchars($functionsArraySetup['href']).'">'.htmlspecialchars($functionsArraySetup['title']).'</a></td>
00163 </tr>';
00164 }
00165 }
00166
00167
00168 $this->content.=implode('
00169 <tr>
00170 <td colspan="2"><img'.t3lib_iconWorks::skinImg($backPath,'gfx/altmenuline.gif','width="105" height="3"').' alt="" /></td>
00171 </tr>',$rows);
00172
00173 $this->content.='
00174 </table>';
00175 $this->content.=t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'menu_adminFunction', $GLOBALS['BACK_PATH']);
00176 $this->content.='
00177 </div>
00178 ';
00179 }
00180
00181
00182 if($BE_USER->user['ses_backuserid']) {
00183 $username = '<p id="username" class="typo3-red-background">[' .
00184 $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xml:switchtousershort') . ' ' .
00185 htmlspecialchars($BE_USER->user['username']) . ']</p>';
00186 } else {
00187 $username = '<p id="username">[' . htmlspecialchars($BE_USER->user['username']) . ']</p>';
00188 }
00189
00190 $this->content.='
00191
00192
00193 <!--
00194 Logout button / username
00195 -->
00196 <div id="typo3-alt-menu-php-logininfo">'.$alt_menuObj->topButtons().$username.'
00197 </div>';
00198
00199
00200 $this->content.=$TBE_TEMPLATE->endPage();
00201 }
00202
00203
00204
00205
00206
00207
00208 function printContent() {
00209 echo $this->content;
00210 }
00211 }
00212
00213
00214 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_menu.php']) {
00215 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_menu.php']);
00216 }
00217
00218
00219
00220
00221 $SOBE = t3lib_div::makeInstance('SC_alt_menu');
00222 $SOBE->init();
00223 $SOBE->main();
00224 $SOBE->printContent();
00225
00226 ?>