Updated locallang-XML files with most recent translations.
[Packages/TYPO3.CMS.git] / typo3 / alt_menu.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
6 * All rights reserved
7 *
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.
13 *
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.
18 *
19 *
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.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Displays the vertical menu in the left most frame of TYPO3s backend
29 *
30 * $Id$
31 * Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
32 * XHTML-trans compliant
33 *
34 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
35 */
36 /**
37 * [CLASS/FUNCTION INDEX of SCRIPT]
38 *
39 *
40 *
41 * 78: class SC_alt_menu
42 * 89: function init()
43 * 105: function main()
44 * 182: function printContent()
45 *
46 * TOTAL FUNCTIONS: 3
47 * (This index is automatically created/updated by the extension "extdeveval")
48 *
49 */
50
51
52 require ('init.php');
53 require ('template.php');
54 require_once (PATH_t3lib.'class.t3lib_loadmodules.php');
55 require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
56 require_once ('class.alt_menu_functions.inc');
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71 /**
72 * Script Class for rendering the vertical menu in the left side of the backend frameset
73 *
74 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
75 * @package TYPO3
76 * @subpackage core
77 */
78 class SC_alt_menu {
79
80 // Internal, Static: GPvar
81 var $_clearCacheFiles;
82
83 /**
84 * Initialize
85 * Loads the backend modules available for the logged in user.
86 *
87 * @return void
88 */
89 function init() {
90 global $TBE_MODULES;
91
92 // Setting GPvars:
93 $this->_clearCacheFiles = t3lib_div::_GP('_clearCacheFiles');
94
95 // Loads the backend modules available for the logged in user.
96 $this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
97 $this->loadModules->load($TBE_MODULES);
98 }
99
100 /**
101 * Main content generated
102 *
103 * @return void
104 */
105 function main() {
106 global $BE_USER,$TYPO3_CONF_VARS,$TBE_TEMPLATE;
107
108 $TBE_TEMPLATE->docType='xhtml_trans';
109 $TBE_TEMPLATE->divClass='vertical-menu';
110 $this->content.=$TBE_TEMPLATE->startPage('Vertical Backend Menu');
111 $backPath = $GLOBALS['BACK_PATH'];
112
113 // Printing the menu
114 $alt_menuObj = t3lib_div::makeInstance('alt_menu_functions');
115 $this->content.= $alt_menuObj->topMenu($this->loadModules->modules);
116 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'menu_modules', $GLOBALS['BACK_PATH']);
117
118 // clear cache commands for Admins
119 if($BE_USER->isAdmin()) {
120 $functionsArray = $alt_menuObj->adminFunctions($backPath);
121
122 $this->content.='
123
124 <!--
125 Menu with admin functions: Clearing cache:
126 -->
127 <div id="typo3-alt-menu-php-adminFunc">';
128
129 // Header: Admin functions
130 $this->content.=
131 '<h2 class="bgColor5">'.
132 $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.adminFunctions',1).
133 '</h2>';
134
135 // Table with those admin functions
136 $this->content.='
137 <table border="0" cellpadding="0" cellspacing="1" width="100%">';
138
139 $rows=array();
140 foreach($functionsArray as $functionsArraySetup) {
141 $rows[]='
142 <tr>
143 <td valign="top" align="center">'.$functionsArraySetup['icon'].'</td>
144 <td><a href="'.htmlspecialchars($functionsArraySetup['href']).'">'.htmlspecialchars($functionsArraySetup['title']).'</a></td>
145 </tr>';
146 }
147
148 // Imploding around the divider table row:
149 $this->content.=implode('
150 <tr>
151 <td colspan="2"><img'.t3lib_iconWorks::skinImg($backPath,'gfx/altmenuline.gif','width="105" height="3"').' alt="" /></td>
152 </tr>',$rows);
153
154 $this->content.='
155 </table>';
156 $this->content.=t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'menu_adminFunction', $GLOBALS['BACK_PATH']);
157 $this->content.='
158 </div>
159 ';
160 }
161
162 // Printing bottons (logout button)
163 $this->content.='
164
165
166 <!--
167 Logout button / username
168 -->
169 <div id="typo3-alt-menu-php-logininfo">'.$alt_menuObj->topButtons().
170 '<p id="username">['.htmlspecialchars($BE_USER->user['username']).']</p>
171 </div>';
172
173 // End page:
174 $this->content.=$TBE_TEMPLATE->endPage();
175 }
176
177 /**
178 * Outputting the accumulated content to screen
179 *
180 * @return void
181 */
182 function printContent() {
183 echo $this->content;
184 }
185 }
186
187 // Include extension?
188 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_menu.php']) {
189 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_menu.php']);
190 }
191
192
193
194
195
196
197
198
199
200
201
202
203 // Make instance:
204 $SOBE = t3lib_div::makeInstance('SC_alt_menu');
205 $SOBE->init();
206 $SOBE->main();
207 $SOBE->printContent();
208 ?>