summaryrefslogtreecommitdiff
path: root/inc/funktion_menu.php
blob: e90e99b6fc991d9cb9b26077e9c017c8e36cfb14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?PHP

function ShowMenu( $Menu )
{
	if( !isset($Menu["Entry"]) ) return;
	
	global $MenueTableStart, $MenueTableEnd, $_SESSION, $DEBUG;
	
	echo $MenueTableStart;
	echo "<h4 class=\"menu\">". $Menu["Name"]. "</h4>";

	foreach( $Menu["Entry"] as $Entry )
	{
		//wenn File mit ../ beginnt wird "../" abgeschnitten und der Ordener weggelassen
		if( strstr( $Entry["File"], "../" ) != FALSE )
			$MenuFile = substr( $Entry["File"], strpos( $Entry["File"], "../" )+ 3)  ;
		else
			$MenuFile = $Menu["Path"]. $Entry["File"];
	
		if( $_SESSION['CVS'][$MenuFile] == "Y")
			echo "\t\t\t<li><a href=\"". $Entry["File"]. "\">". $Entry["Name"]. "</a></li>\n";
		
		echo $Entry["Line"];


		//DEBUG
		if( $DEBUG ) 
		{ 
		    if( !isset($_SESSION['CVS'][$MenuFile] ) )
			echo "ERROR CVS: '". $MenuFile. "' not set";
			
		    if( $_SESSION['CVS'][$MenuFile] != "Y")
		    	echo "\t\t\t<li>". $Entry["File"]. " (". $Entry["Name"]. ")</li>\n";
		} // DEBUG
	} //foreach

	echo $MenueTableEnd;
} //function ShowMenue


?>