Added feature #7150: Add pageUnavailable_handling for system problems and maintenance
[Packages/TYPO3.CMS.git] / typo3 / alt_menu.php
index 2b3e959..7797561 100755 (executable)
@@ -32,7 +32,7 @@
  * XHTML-trans compliant
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @co-author Sebastian Kurfürst <sebastian@garbage-group.de>
+ * @co-author Sebastian Kurfuerst <sebastian@garbage-group.de>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
@@ -73,7 +73,7 @@ require_once ('class.alt_menu_functions.inc');
  * Script Class for rendering the vertical menu in the left side of the backend frameset
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @co-author Sebastian Kurfürst <sebastian@garbage-group.de>
+ * @co-author Sebastian Kurfuerst <sebastian@garbage-group.de>
  * @package TYPO3
  * @subpackage core
  */
@@ -83,13 +83,20 @@ class SC_alt_menu {
        var $_clearCacheFiles;
 
        /**
+        * Menu functions object
+        *
+        * @var alt_menu_functions
+        */
+       var $alt_menuObj;
+
+       /**
         * Initialize
         * Loads the backend modules available for the logged in user.
         *
         * @return      void
         */
        function init() {
-               global $TBE_MODULES;
+               global $TBE_MODULES, $TBE_TEMPLATE;
 
                        // Setting GPvars:
                $this->_clearCacheFiles = t3lib_div::_GP('_clearCacheFiles');
@@ -98,6 +105,11 @@ class SC_alt_menu {
                $this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
                $this->loadModules->observeWorkspaces = TRUE;
                $this->loadModules->load($TBE_MODULES);
+
+                       // Instantiates the menu object which will generate some JavaScript for the goToModule() JS function in this frame.
+               $this->alt_menuObj = t3lib_div::makeInstance('alt_menu_functions');
+
+               $TBE_TEMPLATE->JScodeArray[] = $this->alt_menuObj->generateMenuJScode($this->loadModules->modules);
        }
 
        /**
@@ -111,6 +123,7 @@ class SC_alt_menu {
                $TBE_TEMPLATE->docType='xhtml_trans';
                $TBE_TEMPLATE->divClass='vertical-menu';
                $TBE_TEMPLATE->bodyTagAdditions = 'onload="top.restoreHighlightedModuleMenuItem()"';
+
                $this->content.=$TBE_TEMPLATE->startPage('Vertical Backend Menu');
                $backPath = $GLOBALS['BACK_PATH'];