---------
Demo
---------

There is a demo here

------------------
Download
------------------

Download the Zip file

---------------
Introduction
---------------

This menu was devised to work a vertical menu system that self-expands and contracts like menus from CMS packages such as Mambo and Typo3. It is very simple and only requires two files - The menu.php and the menu.txt configuration file.

The menu.php script should included in your php pages where you want it to appear. Typically the page would be set out with a table which houses the header section (eg a banner), the menu, the content section and a footer section.
all that is needed is to put "<?php include("menu.php");?>" in the cell where you want the menu to appear.

-----------------
Configuration
-----------------
Next you will need to configure the menu. This is done by editing menu.txt

The format is very simple:
<Level> <Menu text> <Tab(s)> <Link>

Level:
For a top level menu item (that's ones that are always there) use one plus sign (+)
For a second level menu item (that's ones that open from a top level item and are only open sometimes) use two plus signs (++)
For a third level menu item (that's ones that open from a second level item and are only open sometimes) use three plus signs (+++)

Menu text:
The text you want to appear on the menu.
note you cannot use a '+' in the text (eg. +C++ would be interpreted as "C" on level three

Tab(s):
one or more tab characters

Links:
the URL you want the menu item to point to. These can be either absolute or relative

Example:
+Home index.php
+Library library.php
++Documents lib/documents.php
++Books lib/books.php
+++Hard Cover lib/hardcover.php
+Map map.php
+Search http://www.google.com

Next the look of the menu needs to be set up. Open menu.php and write the HTML for the menu

$opentag:
This the opening code for the table that houses the menu. Change this to whatever you wish or leave it as is if you don't know what you are doing. Using your own CSS is advisable. The default value is $opentag = '<table>';

$closetag:
This the closing code for the table that houses the menu. The default value is $opentag = '<table>';

$Level_1:
This contains the code needed to display the first level (menu items marked with a +)

$Level_2:
This contains the code needed to display the second level (menu items marked with a ++)

$Level_3:
This contains the code needed to display the third level (menu items marked with a +++)

for each of the $Level variables use $Link to refer to where the menu item should link to and $Text to refer to the text for the menu item (note it is case sensitive so don't use $text it won't work!). Again using CSS is advisable. You can use other image tags, javascript, or whatever you want!

Example:
$Level_1 = '<td class="L1" bgcolor="#000080"><a href="$Link">$Text</a></td>';
$Level_2 = '<td class="L2" bgcolor="#aaaa80"><a href="$Link">$Text</a></td>';
$Level_3 = '<td class="L3" bgcolor="#ffff80"><a href="$Link">$Text</a></td>';
$opentag = '<table>';
$closetag = '</table>';

That's all there is to it!

When you use your menu it detects from the URL what page your on, looks it up in the menu.txt file and renders the menu accordingly.

--------------
Licence
--------------
Simple Self-Expanding PHP Menu
created by Aaron Fulton 2006

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
they can be incorporated into the canonical version.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.