PHP Classes
elePHPant
Icontem

Automatic Drop Down Menu: Generate an hierarchic drop down menus of links

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   Screenshots Screenshots   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2007-07-09 (8 years ago) RSS 2.0 feedStarStarStar 54%Total: 1,454 This week: 2All time: 2,549 This week: 578Up
Version License PHP version Categories  
addme 1Freeware3.0HTML
Description Author  

This class can be used to generate hierarchic drop down menus of HTML links.

It can build an hierarchy of menus, sub-menus and items with given link names, URLs and icon images.

The class generates HTML with CSS style definitions and Javascript to make the menus and sub-menus open as drop down menus.

Picture of Die Mitchell
Name: Die Mitchell <contact>
Classes: 1 package by
Country: Argentina Argentina
Age: 50
All time rank: 175421 in Argentina Argentina
Week rank: 550 Up6 in Argentina Argentina Up

Details provided by the author  
This class works with mysql so in order to see well the frames, the mysql requirements (like tables and columns) must be set.
The top frame and right frame were not added, so you can use your own COMPANY DESCRIPTION (top frame) and your own right frame that could be your BASKET frame
You can change the background standardmenu.jpg image used as the background image of the menu bar image. This image must be located in the images/ subdirectory



You have to create in this example the following tables in order to work properly: 


CREATE TABLE `categoria` (`CodigoCA` int(3) NOT NULL auto_increment,`NombreCA` varchar(40) collate latin1_spanish_ci NOT NULL, PRIMARY KEY  (`CodigoCA`), UNIQUE KEY `NombreCA` (`NombreCA`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci

CREATE TABLE `subcategorias` (`CodigoCA` int(3) NOT NULL,`CodigoSC` int(3) NOT NULL,`NombreSC` varchar(30) collate latin1_spanish_ci NOT NULL, PRIMARY KEY  (`CodigoCA`,`CodigoSC`), UNIQUE KEY `CodigoCA` (`CodigoCA`,`NombreSC`), KEY `CodigoSC` (`CodigoSC`), KEY `NombreSC` (`NombreSC`), CONSTRAINT `subcategorias_ibfk_1` FOREIGN KEY (`CodigoCA`) REFERENCES `categoria` (`CodigoCA`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci

CREATE TABLE `marcas` (`CodigoM` int(3) NOT NULL auto_increment,`Marca` varchar(30) collate latin1_spanish_ci NOT NULL, PRIMARY KEY  (`CodigoM`), UNIQUE KEY `Marca` (`Marca`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci

CREATE TABLE `modelos` (`CodigoM` int(3) NOT NULL, `CodigoMO` int(5) NOT NULL, `ModeloN` varchar(35) collate latin1_spanish_ci NOT NULL, `DescripcionM` varchar(40) collate latin1_spanish_ci default NULL, PRIMARY KEY  (`CodigoM`,`CodigoMO`), KEY `CodigoMO` (`CodigoMO`),  KEY `ModeloN` (`ModeloN`), CONSTRAINT `modelos_ibfk_1` FOREIGN KEY (`CodigoM`) REFERENCES `marcas` (`CodigoM`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci

CREATE TABLE `modcatsub` (`CodigoM` int(3) NOT NULL,`CodigoMO` int(5) NOT NULL, `CodigoCA` int(3) NOT NULL,`CodigoSC` int(3) NOT NULL default '0', `Visiblenet` enum('N','S') collate latin1_spanish_ci NOT NULL, PRIMARY KEY  (`CodigoM`,`CodigoMO`,`CodigoCA`,`CodigoSC`), KEY `CodigoCA` (`CodigoCA`,`CodigoSC`), KEY `CodigoSC` (`CodigoSC`), KEY `CodigoMO` (`CodigoMO`), CONSTRAINT `modcatsub_ibfk_8` FOREIGN KEY (`CodigoSC`) REFERENCES `subcategorias` (`CodigoSC`), CONSTRAINT `modcatsub_ibfk_5` FOREIGN KEY (`CodigoM`) REFERENCES `marcas` (`CodigoM`), CONSTRAINT `modcatsub_ibfk_6` FOREIGN KEY (`CodigoMO`) REFERENCES `modelos` (`CodigoMO`), CONSTRAINT `modcatsub_ibfk_7` FOREIGN KEY (`CodigoCA`) REFERENCES `categoria` (`CodigoCA`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci

The field `DescripcionM` is created in the table `modelos`, in order to set a description of the model. Remember that if you want to show these descriptions then you have to add the column in the query1.
The field `Visiblenet` is created in the table `modcatsub`, in order to set if the model is going to be shown in internet or not. Remember that if you want to use this option you must add a "where Visiblenet = "S" " clause in the query1.


I have added two menu bar options (contactos and principal), to let you see how you can add menu bar options that dont depend on the mysql results.
Screenshots  
  • imagesite2.jpg
  • Imagensite
  Files folder image Files  
File Role Description
Plain text file class_MENU.php Class Where the menu is build
Plain text file global.inc.php Class File requiered
Plain text file housecenterframe.php Example Frame where the products are going to be shown
Plain text file houseleftframe.php Example Frame with the automatic menu bar
Plain text file imagen3.php Aux. To set the menu bar image settings
Plain text file productpage.html Data FRAMES PAGE
Plain text file readme.txt Doc. Some words
Image file standardmenu.jpg Output Background image

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,454All time:2,549
 This week:2This week:578Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:58%StarStarStar
Documentation:50%StarStarStar
Examples:66%StarStarStarStar
Tests:-
Videos:-
Overall:54%StarStarStar
Rank:1310