Bug #21227 » hide-empty-menu.diff

Administrator Admin, 2009-10-16 19:49

View differences:

typo3/classes/class.modulemenu.php (Arbeitskopie)
139 139
		$rawModuleData = $this->getRawModuleData();
140 140

  
141 141
		foreach($rawModuleData as $moduleKey => $moduleData) {
142
			$menuState   = $GLOBALS['BE_USER']->uc['moduleData']['menuState'][$moduleKey];
143
			$moduleLabel = $moduleData['title'];
144

  
145
			if($moduleData['link'] && $this->linkModules) {
146
				$moduleLabel = '<a href="#" onclick="top.goToModule(\''.$moduleData['name'].'\');'.$onBlur.'return false;">'.$moduleLabel.'</a>';
147
			}
148

  
149
			$menu .= '<li id="modmenu_' . $moduleData['name'] . '" '.
150
				($collapsable ? 'class="menuSection"' : '') .
151
				' title="' . $moduleData['description'] . '">
152
				<div class="' . ($menuState ? 'collapsed' : 'expanded') . '">' .
153
				$moduleData['icon']['html'] . ' ' . $moduleLabel . '</div>';
154

  
155
				// traverse submodules
156 142
			if(is_array($moduleData['subitems'])) {
143
				$menuState   = $GLOBALS['BE_USER']->uc['moduleData']['menuState'][$moduleKey];
144
				$moduleLabel = $moduleData['title'];
145
	
146
				if($moduleData['link'] && $this->linkModules) {
147
					$moduleLabel = '<a href="#" onclick="top.goToModule(\'' . $moduleData['name'] . '\');'.$onBlur . 'return false;">' . $moduleLabel . '</a>';
148
				}
149
	
150
				$menu .= '<li id="modmenu_' . $moduleData['name'] . '" '.
151
					($collapsable ? 'class="menuSection"' : '') .
152
					' title="' . $moduleData['description'] . '">
153
					<div class="' . ($menuState ? 'collapsed' : 'expanded') . '">' .
154
					$moduleData['icon']['html'] . ' ' . $moduleLabel . '</div>';
155
	
156
					// traverse submodules
157 157
				$menu .= $this->renderSubModules($moduleData['subitems'], $menuState);
158

  
159
				$menu .= '</li>' . "\n";
158 160
			}
159

  
160
			$menu .= '</li>'."\n";
161 161
		}
162 162

  
163
		return ($wrapInUl ? '<ul id="typo3-menu">'."\n".$menu.'</ul>'."\n" : $menu);
163
		return ($wrapInUl ? '<ul id="typo3-menu">' . "\n".$menu.'</ul>' . "\n" : $menu);
164 164
	}
165 165

  
166 166
	/**
(1-1/2)