<?php
  include_once '../doc-typo3-funcs.php';
  $doxygen_vars = array(	"title" => "TYPO3 4.0.1: typo3_src-4.0.1/typo3/alt_menu.php Source File",
				"datetime" => "Sat Dec 2 19:22:20 2006",
				"date" => "2 Dec 2006",
				"doxygenversion" => "1.4.6",
				"projectname" => "TYPO3 4.0.1",
				"projectnumber" => "4.0.1"
			);
  get_header($doxygen_vars);
?>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="classes.html"><span>Classes</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="dirs.html"><span>Directories</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    <li><a href="examples.html"><span>Examples</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
  </ul></div>
<div class="nav">
<a class="el" href="dir_c8daf1ad746050abf985cc546c89e248.html">typo3_src-4.0.1</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_18071ae4545d8b3e0364d30c0659c74a.html">typo3</a></div>
<h1>alt_menu.php</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00002"></a>00002 <span class="comment">/***************************************************************</span>
<a name="l00003"></a>00003 <span class="comment">*  Copyright notice</span>
<a name="l00004"></a>00004 <span class="comment">*</span>
<a name="l00005"></a>00005 <span class="comment">*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)</span>
<a name="l00006"></a>00006 <span class="comment">*  All rights reserved</span>
<a name="l00007"></a>00007 <span class="comment">*</span>
<a name="l00008"></a>00008 <span class="comment">*  This script is part of the TYPO3 project. The TYPO3 project is</span>
<a name="l00009"></a>00009 <span class="comment">*  free software; you can redistribute it and/or modify</span>
<a name="l00010"></a>00010 <span class="comment">*  it under the terms of the GNU General Public License as published by</span>
<a name="l00011"></a>00011 <span class="comment">*  the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00012"></a>00012 <span class="comment">*  (at your option) any later version.</span>
<a name="l00013"></a>00013 <span class="comment">*</span>
<a name="l00014"></a>00014 <span class="comment">*  The GNU General Public License can be found at</span>
<a name="l00015"></a>00015 <span class="comment">*  http://www.gnu.org/copyleft/gpl.html.</span>
<a name="l00016"></a>00016 <span class="comment">*  A copy is found in the textfile GPL.txt and important notices to the license</span>
<a name="l00017"></a>00017 <span class="comment">*  from the author is found in LICENSE.txt distributed with these scripts.</span>
<a name="l00018"></a>00018 <span class="comment">*</span>
<a name="l00019"></a>00019 <span class="comment">*</span>
<a name="l00020"></a>00020 <span class="comment">*  This script is distributed in the hope that it will be useful,</span>
<a name="l00021"></a>00021 <span class="comment">*  but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00022"></a>00022 <span class="comment">*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00023"></a>00023 <span class="comment">*  GNU General Public License for more details.</span>
<a name="l00024"></a>00024 <span class="comment">*</span>
<a name="l00025"></a>00025 <span class="comment">*  This copyright notice MUST APPEAR in all copies of the script!</span>
<a name="l00026"></a>00026 <span class="comment">***************************************************************/</span>
<a name="l00053"></a>00053 require ('init.php');
<a name="l00054"></a>00054 require ('<span class="keyword">template</span>.php');
<a name="l00055"></a>00055 require_once (PATH_t3lib.'<span class="keyword">class</span>.t3lib_loadmodules.php');
<a name="l00056"></a>00056 require_once (PATH_t3lib.'<span class="keyword">class</span>.t3lib_basicfilefunc.php');
<a name="l00057"></a>00057 require_once ('<span class="keyword">class</span>.<a class="code" href="classalt__menu__functions.html">alt_menu_functions</a>.inc');
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 
<a name="l00063"></a>00063 
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 
<a name="l00066"></a>00066 
<a name="l00067"></a>00067 
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 
<a name="l00080"></a><a class="code" href="classSC__alt__menu.html">00080</a> <span class="keyword">class </span><a class="code" href="classSC__alt__menu.html">SC_alt_menu</a> {
<a name="l00081"></a>00081 
<a name="l00082"></a>00082                 <span class="comment">// Internal, Static: GPvar</span>
<a name="l00083"></a><a class="code" href="classSC__alt__menu.html#e6963f76a34cdccac87a940014547e21">00083</a>         var <a class="code" href="classSC__alt__menu.html#e6963f76a34cdccac87a940014547e21">$_clearCacheFiles</a>;
<a name="l00084"></a>00084 
<a name="l00091"></a><a class="code" href="classSC__alt__menu.html#050195a8bf45a51713510edf37ab9017">00091</a>         function <a class="code" href="classSC__alt__menu.html#050195a8bf45a51713510edf37ab9017">init</a>() {
<a name="l00092"></a>00092                 global $TBE_MODULES;
<a name="l00093"></a>00093 
<a name="l00094"></a>00094                         <span class="comment">// Setting GPvars:</span>
<a name="l00095"></a>00095                 $this-&gt;_clearCacheFiles = <a class="code" href="classt3lib__div.html#016d2190758279b2dbb953826c690118">t3lib_div::_GP</a>('_clearCacheFiles');
<a name="l00096"></a>00096 
<a name="l00097"></a>00097                         <span class="comment">// Loads the backend modules available for the logged in user.</span>
<a name="l00098"></a>00098                 $this-&gt;loadModules = <a class="code" href="classt3lib__div.html#b47f8a8e8be44b79a0b8064dcd427bc1">t3lib_div::makeInstance</a>('<a class="code" href="classt3lib__loadModules.html">t3lib_loadModules</a>');
<a name="l00099"></a>00099                 $this-&gt;loadModules-&gt;observeWorkspaces = TRUE;
<a name="l00100"></a>00100                 $this-&gt;loadModules-&gt;load($TBE_MODULES);
<a name="l00101"></a>00101         }
<a name="l00102"></a>00102 
<a name="l00108"></a><a class="code" href="classSC__alt__menu.html#c8b2a31e57219fcd33ef11e60f15300b">00108</a>         function <a class="code" href="classSC__alt__menu.html#c8b2a31e57219fcd33ef11e60f15300b">main</a>() {
<a name="l00109"></a>00109                 global $BE_USER,$TYPO3_CONF_VARS,$TBE_TEMPLATE;
<a name="l00110"></a>00110 
<a name="l00111"></a>00111                 $TBE_TEMPLATE-&gt;docType='xhtml_trans';
<a name="l00112"></a>00112                 $TBE_TEMPLATE-&gt;divClass='vertical-menu';
<a name="l00113"></a>00113                 $TBE_TEMPLATE-&gt;bodyTagAdditions = 'onload=<span class="stringliteral">"top.restoreHighlightedModuleMenuItem()"</span>';
<a name="l00114"></a>00114                 $this-&gt;content.=$TBE_TEMPLATE-&gt;startPage('Vertical Backend Menu');
<a name="l00115"></a>00115                 $backPath = $GLOBALS['BACK_PATH'];
<a name="l00116"></a>00116 
<a name="l00117"></a>00117                         <span class="comment">// Printing the menu</span>
<a name="l00118"></a>00118                 $alt_menuObj = <a class="code" href="classt3lib__div.html#b47f8a8e8be44b79a0b8064dcd427bc1">t3lib_div::makeInstance</a>('<a class="code" href="classalt__menu__functions.html">alt_menu_functions</a>');
<a name="l00119"></a>00119                 $this-&gt;content.= $alt_menuObj-&gt;topMenu($this-&gt;loadModules-&gt;modules);
<a name="l00120"></a>00120 
<a name="l00121"></a>00121                         <span class="comment">// clear cache commands for Admins</span>
<a name="l00122"></a>00122                 <span class="keywordflow">if</span>($BE_USER-&gt;isAdmin()) {       <span class="comment">//  &amp;&amp; $BE_USER-&gt;workspace===0 NOT used anyway because under a workspace developers might still like to clear cache!</span>
<a name="l00123"></a>00123                         $functionsArray = $alt_menuObj-&gt;adminFunctions($backPath);
<a name="l00124"></a>00124 
<a name="l00125"></a>00125                         $this-&gt;content.='
<a name="l00126"></a>00126 
<a name="l00127"></a>00127 &lt;!--
<a name="l00128"></a>00128   Menu with admin functions: Clearing cache:
<a name="l00129"></a>00129 --&gt;
<a name="l00130"></a>00130 &lt;div <span class="keywordtype">id</span>=<span class="stringliteral">"typo3-alt-menu-php-adminFunc"</span>&gt;';
<a name="l00131"></a>00131 
<a name="l00132"></a>00132 
<a name="l00133"></a>00133                                 <span class="comment">// Table with those admin functions</span>
<a name="l00134"></a>00134                         $this-&gt;content.='
<a name="l00135"></a>00135                                 &lt;table border=<span class="stringliteral">"0"</span> cellpadding=<span class="stringliteral">"0"</span> cellspacing=<span class="stringliteral">"1"</span> width=<span class="stringliteral">"100%"</span> <span class="keywordtype">id</span>=<span class="stringliteral">"typo3-adminmenu"</span>&gt;';
<a name="l00136"></a>00136 
<a name="l00137"></a>00137                                 <span class="comment">// Header: Admin functions</span>
<a name="l00138"></a>00138                         $this-&gt;content.='
<a name="l00139"></a>00139                                         &lt;tr <span class="keyword">class</span>=<span class="stringliteral">"c-mainitem"</span>&gt;
<a name="l00140"></a>00140                                                 &lt;td colspan=<span class="stringliteral">"2"</span>&gt;&lt;span <span class="keyword">class</span>=<span class="stringliteral">"c-label"</span>&gt;&lt;b&gt;'.$GLOBALS['LANG']-&gt;sL('LLL:EXT:lang/locallang_core.php:rm.adminFunctions',1).'&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span <span class="keyword">class</span>=<span class="stringliteral">"c-iconCollapse"</span>&gt;&lt;/span&gt;&lt;/td&gt;
<a name="l00141"></a>00141                                         &lt;/tr&gt;';
<a name="l00142"></a>00142 
<a name="l00143"></a>00143                         $rows=array();
<a name="l00144"></a>00144                         foreach($functionsArray as $functionsArraySetup)        {
<a name="l00145"></a>00145                                 $rows[]='
<a name="l00146"></a>00146                                         &lt;tr <span class="keyword">class</span>=<span class="stringliteral">"c-subitem"</span>&gt;
<a name="l00147"></a>00147                                                 &lt;td valign=<span class="stringliteral">"top"</span> align=<span class="stringliteral">"center"</span> <span class="keyword">class</span>=<span class="stringliteral">"icon"</span>&gt;'.$functionsArraySetup['icon'].'&lt;/td&gt;
<a name="l00148"></a>00148                                                 &lt;td&gt;&lt;a href=<span class="stringliteral">"'.htmlspecialchars($functionsArraySetup['href']).'"</span>&gt;'.htmlspecialchars($functionsArraySetup['title']).'&lt;/a&gt;&lt;/td&gt;
<a name="l00149"></a>00149                                         &lt;/tr&gt;';
<a name="l00150"></a>00150                         }
<a name="l00151"></a>00151 
<a name="l00152"></a>00152                                 <span class="comment">// Imploding around the divider table row:</span>
<a name="l00153"></a>00153                         $this-&gt;content.=implode('
<a name="l00154"></a>00154                                         &lt;tr&gt;
<a name="l00155"></a>00155                                                 &lt;td colspan=<span class="stringliteral">"2"</span>&gt;&lt;img'.<a class="code" href="classt3lib__iconWorks.html#8885a3d8ebbdd02ccd05a708b2c3f53b">t3lib_iconWorks::skinImg</a>($backPath,'gfx/altmenuline.gif<span class="charliteral">','</span>width=<span class="stringliteral">"105"</span> height=<span class="stringliteral">"3"</span>').' alt=<span class="stringliteral">""</span> /&gt;&lt;/td&gt;
<a name="l00156"></a>00156                                         &lt;/tr&gt;',$rows);
<a name="l00157"></a>00157 
<a name="l00158"></a>00158                         $this-&gt;content.='
<a name="l00159"></a>00159                                 &lt;/table&gt;';
<a name="l00160"></a>00160                         $this-&gt;content.=<a class="code" href="classt3lib__BEfunc.html#a235b246dec429e439742b1fc76c9d97">t3lib_BEfunc::cshItem</a>('xMOD_csh_corebe', 'menu_adminFunction', $GLOBALS['BACK_PATH']);
<a name="l00161"></a>00161                         $this-&gt;content.='
<a name="l00162"></a>00162 &lt;/div&gt;
<a name="l00163"></a>00163 ';
<a name="l00164"></a>00164                 }
<a name="l00165"></a>00165 
<a name="l00166"></a>00166                         <span class="comment">// superuser mode</span>
<a name="l00167"></a>00167                 <span class="keywordflow">if</span>($BE_USER-&gt;user['ses_backuserid']) {
<a name="l00168"></a>00168                         $username = '&lt;p <span class="keywordtype">id</span>=<span class="stringliteral">"username"</span> <span class="keyword">class</span>=<span class="stringliteral">"typo3-red-background"</span>&gt;[SU: '.htmlspecialchars($BE_USER-&gt;user['username']).']&lt;/p&gt;';
<a name="l00169"></a>00169                 } <span class="keywordflow">else</span> {
<a name="l00170"></a>00170                         $username = '&lt;p <span class="keywordtype">id</span>=<span class="stringliteral">"username"</span>&gt;['.htmlspecialchars($BE_USER-&gt;user['username']).']&lt;/p&gt;';
<a name="l00171"></a>00171                 }
<a name="l00172"></a>00172                         <span class="comment">// Printing bottons (logout button)</span>
<a name="l00173"></a>00173                 $this-&gt;content.='
<a name="l00174"></a>00174 
<a name="l00175"></a>00175 
<a name="l00176"></a>00176 &lt;!--
<a name="l00177"></a>00177   Logout button / username
<a name="l00178"></a>00178 --&gt;
<a name="l00179"></a>00179 &lt;div <span class="keywordtype">id</span>=<span class="stringliteral">"typo3-alt-menu-php-logininfo"</span>&gt;'.$alt_menuObj-&gt;topButtons().$username.'
<a name="l00180"></a>00180 &lt;/div&gt;';
<a name="l00181"></a>00181 
<a name="l00182"></a>00182                         <span class="comment">// End page:</span>
<a name="l00183"></a>00183                 $this-&gt;content.=$TBE_TEMPLATE-&gt;endPage();
<a name="l00184"></a>00184         }
<a name="l00185"></a>00185 
<a name="l00191"></a><a class="code" href="classSC__alt__menu.html#c041baf779da49a7bfbfb57168fbdb31">00191</a>         function <a class="code" href="classSC__alt__menu.html#c041baf779da49a7bfbfb57168fbdb31">printContent</a>() {
<a name="l00192"></a>00192                 echo $this-&gt;content;
<a name="l00193"></a>00193         }
<a name="l00194"></a>00194 }
<a name="l00195"></a>00195 
<a name="l00196"></a>00196 <span class="comment">// Include extension?</span>
<a name="l00197"></a>00197 <span class="keywordflow">if</span> (defined('TYPO3_MODE') &amp;&amp; $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_menu.php'])      {
<a name="l00198"></a>00198         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_menu.php']);
<a name="l00199"></a>00199 }
<a name="l00200"></a>00200 
<a name="l00201"></a>00201 
<a name="l00202"></a>00202 
<a name="l00203"></a>00203 
<a name="l00204"></a>00204 
<a name="l00205"></a>00205 
<a name="l00206"></a>00206 
<a name="l00207"></a>00207 
<a name="l00208"></a>00208 
<a name="l00209"></a>00209 
<a name="l00210"></a>00210 
<a name="l00211"></a>00211 
<a name="l00212"></a>00212 <span class="comment">// Make instance:</span>
<a name="l00213"></a>00213 $SOBE = <a class="code" href="classt3lib__div.html#b47f8a8e8be44b79a0b8064dcd427bc1">t3lib_div::makeInstance</a>('<a class="code" href="classSC__alt__menu.html">SC_alt_menu</a>');
<a name="l00214"></a>00214 $SOBE-&gt;init();
<a name="l00215"></a>00215 $SOBE-&gt;main();
<a name="l00216"></a>00216 $SOBE-&gt;printContent();
<a name="l00217"></a>00217 ?&gt;
</pre></div><?php
  include_once '../doc-typo3-funcs.php';
  get_footer();
?>