Jeff PHP framework  0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
menu_public.php
Go to the documentation of this file.
00001 <?php
00017 ?>
00018 <?php
00019 function printVoice($v, $selected_url, $i) {
00020 
00021         $class = $selected_url==$v['href'] ? " class=\"selected\"" : "";
00022         if(!count($v['sub'])) return "<li".$class."><a href=\"".$v['href']."\" target=\"".$v['target']."\"$class>".$v['label']."</a></li>\n";
00023         else {
00024                 $buffer = "<li".$class."><a href=\"".$v['href']."\" target=\"".$v['target']."\"$class>".$v['label']."</a><ul>\n";
00025                 foreach($v['sub'] as $sv) $buffer .= printVoice($sv);
00026                 $buffer .= "</ul></li>\n"; 
00027 
00028                 return $buffer;
00029         }
00030 }
00031 ?>
00032 <nav class="menu">
00033 <h1 class="hidden">Main menu</h1>
00034 <ul id="nav">
00035 <?php
00036         $i = 0;
00037         foreach($voices as $v) {
00038                 echo printVoice($v, $selected_url, $i);         
00039                 $i++;
00040         }
00041 ?>
00042 </ul>
00043 <script>
00044 window.addEvent('load', function() { var myMenu = new MenuMatic(); });
00045 </script>
00046 </nav>
00047