Fixed bug #14336: Merge modules "Cleanup and typo3temp/" of the Install Tool (thanks...
[Packages/TYPO3.CMS.git] / typo3 / class.alt_menu_functions.inc
old mode 100755 (executable)
new mode 100644 (file)
index fb47e00..1667aa7
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -96,7 +96,7 @@ class alt_menu_functions {
 
                        // By default module sections are collapsable, only if they are explicitly turned off via TSconfig, they are not:
                $tmpArr = $BE_USER->getTSConfig('options.moduleMenuCollapsable');
-               $collapsable = ($tmpArr['value'] ? 0 : 1);
+               $collapsable = (isset($tmpArr['value']) && $tmpArr['value']==0) ? 0 : 1;
                unset($tmpArr);
 
                        // Initialize vars:
@@ -113,11 +113,6 @@ class alt_menu_functions {
                $selectItems[] = '<option value="">[ '.$LANG->sL('LLL:EXT:lang/locallang_core.php:buttons.selMenu_modules',1).' ]</option>';
                $mC=0;
 
-                       // Remove the 'doc' module?
-               if ($BE_USER->getTSConfigVal('options.disableDocModuleInAB'))   {
-                       unset($theModules['doc']);
-               }
-
                        // Get collapsed configuration
                if ($collapsable == 1) {
                        $config = is_array ($BE_USER->uc['moduleData']['alt_menu.php']) ? $BE_USER->uc['moduleData']['alt_menu.php'] : array();
@@ -190,7 +185,7 @@ class alt_menu_functions {
                        $descr3_title = $LANG->moduleLabels['tabs'][$moduleKey].' ';
                        if ($image)     {
                                $Ifilename = $this->mIconFilename($LANG->moduleLabels['tabs_images'][$moduleKey],$backPath);
-                               $collection[$moduleKey]['icon'] = array($Ifilename, $image[3]); 
+                               $collection[$moduleKey]['icon'] = array($Ifilename, $image[3]);
                                $imageCode = '<img src="'.$Ifilename.'" '.$image[3].' alt="" />';
                                $descr3_imageCode = '<img src="'.$Ifilename.'" '.$image[3].' title="'.htmlspecialchars($descr3_title).'" alt="" />';
                        } else {
@@ -277,7 +272,7 @@ class alt_menu_functions {
                                        $descr3_title = $LANG->moduleLabels['tabs'][$subKey].': '.$LANG->moduleLabels['labels'][$subKey.'label'];
                                        if ($image)     {
                                                $Ifilename = $this->mIconFilename($LANG->moduleLabels['tabs_images'][$subKey],$backPath);
-                                               $collection[$moduleKey]['subitems'][$subKey]['icon'] = array($Ifilename, $image[3]); 
+                                               $collection[$moduleKey]['subitems'][$subKey]['icon'] = array($Ifilename, $image[3]);
                                                $imageCode = '<img src="'.$Ifilename.'" '.$image[3].' title="'.htmlspecialchars($LANG->moduleLabels['labels'][$subKey.'label']).'" alt="" />';
                                                $descr3_imageCode = '<img src="'.$Ifilename.'" '.$image[3].' title="'.htmlspecialchars($descr3_title).'" alt="" />';
                                        } else {
@@ -293,7 +288,7 @@ class alt_menu_functions {
 
                                                // Setting additional JavaScript if frameset script:
                                        $addJS = '';
-                                       if ($moduleInfo['navFrameScript'])      {$addJS="+'&id='+top.rawurlencode(top.fsMod.recentIds['".$moduleName."'])";}
+                                       if ($moduleInfo['navFrameScript'])      {$addJS = "+'&id='+top.rawurlencodeAndRemoveSiteUrl(top.fsMod.recentIds['" . $moduleName . "'])";}
 
                                                // If there is a script to link to (and linking is not disabled.
                                        if ($link && !$dontLink)        {
@@ -360,11 +355,24 @@ class alt_menu_functions {
                                                        </tr>';
 
                                                // For "About modules":
+                                       $moduleLabel = htmlspecialchars($LANG->moduleLabels['labels'][$subKey.'label']);
+                                       $moduleLabelHtml = !empty($moduleLabel) ? '<strong>' . $moduleLabel . '</strong><br />' : '';
+                                       $moduleDescription = $LANG->moduleLabels['labels'][$subKey.'descr'];
+
                                        $descrCode.='
                                                        <tr class="c-subitem-row">
                                                                <td align="center">'.$imageCode.'</td>
-                                                               <td>'.$flabel.'&nbsp;&nbsp;</td>
-                                                               <td><strong>'.htmlspecialchars($LANG->moduleLabels['labels'][$subKey.'label']).'</strong><br />'.$LANG->moduleLabels['labels'][$subKey.'descr'].'</td>
+                                                               <td>'.$flabel.'&nbsp;&nbsp;</td>';
+
+                                       if (!empty($moduleLabel) || !empty($moduleDescription)) {
+                                               $descrCode .= '
+                                                               <td>' . $moduleLabelHtml . $moduleDescription . '</td>';
+                                       } else {
+                                               $descrCode .= '
+                                                               <td>&nbsp;</td>';
+                                       }
+
+                                       $descrCode .= '
                                                        </tr>';
 
                                                // Possibly adding a divider line
@@ -621,7 +629,7 @@ class alt_menu_functions {
                        return $link.'?';
                } else return $link;
        }
-       
+
        /**
         * Generates some JavaScript code for the frame.
         *
@@ -629,7 +637,7 @@ class alt_menu_functions {
         */
        function generateMenuJScode($loadedModules, $menuType = 4)      {
                global $TBE_TEMPLATE;
-               
+
                $goToModuleSwitch = $this->topMenu($loadedModules, 0, '', $menuType);
 
                $jsCode = '
@@ -649,7 +657,7 @@ class alt_menu_functions {
                switch(modName) {'.$goToModuleSwitch.'
                }
        }';
-               
+
                return $jsCode;
        }
 }