I'm building a menu navigation for a secure site, and i'd like to know the best way to develop the script, without being lost in a jungle of codes...
Here's the story:
After logged in, there are 5 different levels of rights on the site. According to the "userLevel" in the database, a user see a different menu to navigate through the site.
Till now everithing works fine and as soon as you go to the index.php you have a menu according to the rights given.
This is for the moment a "single line" menu, with no sub menu. This can be managed in the page itself. But if i want to include this sub menu in the PHP script how can i do it?
Now when you arrive to the page you have the include() fuinction that calls a script i did, where depending of the $UserLevel a menu is displayed (echo ''). Is a single line of html that looks like this:
Home | Technical Documents | Release notes | Issue Tracking | Manuals
Depending of the $UserLevel it can be (for instance) like:
Home | Technical Documents | Release notes
And this is ok for the moment.
If now i wanna add a second line of menu, like if for 'Technical document' there are 2 submenus, what can i do?
I'm thinking to create an hidden value in the page that should have a two menu line, and add to the script another menu on two lines called when (for instance)
Code: Select all
$userLevel == '2' && $title == "technical"
where '$title' is the hidden field in the page.
Is this the right logic?
Thanks to all of you... If is not clear, please tell me... I'm always in a rush !!!! :lol: [/code]