Recommend this page to a friend! |
Download .zip |
Info | View files (8) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2006-11-05 (9 years ago) | 50% | Total: 5,750 | All time: 389 This week: 1,113 |
Version | License | Categories | ||||
dhtmltreemenu 1.0 | GNU General Publi... | HTML |
Description | Author | ||||||||||||||
This class generates a DHTML javascript driven TreeMenu from data stored in a small XML file. Supports any level of indentation and works for any browser supporting innerHTML (IE 5.5+ & NS 6+) |
|
===== BASIC DOCUMENTATION FOR TREEMENU CLASS ===== 0.- INTRODUCTION This class is designed as an easy to manage DHTML TreeMenu object. It is crossbrowser on JavaScript Object Model including innerHTML (IE 5.5+ & NS 6+) and feeds on XML data based in menu.dtd (also included in the package). This class is distributed on GNU GPL based license (see LICENSE) 1.- INTERFACE The public interface for the class is formed by: TreeMenu($file="menu.xml") CONSTRUCTOR: Initialize the object $file -> name for the xml file holding the menu definition NOTES: The object is automatically created as $menu due to needing the object prior to XML parsing. By default it points to menu.xml in the same directori but this file settings can be changed with SetFile method. SetFile($file) SETTING THE SOURCE FILE: Changes the file settings to $file $file -> new source file for the object Generate() JAVASCRIPT INITIALIZATION: Include JS libraries and generate JavaScript src NOTES; This method must be called within the HEAD section of the page and it will automatically inlcude browser.js and TreeMenu.js libraries. It will then generate all Javascript needed to initialize data in the DHTML JavaScript TreeMenu object. PrintMenu() SHOWS THE MENU: It will show the menu in that point 2.- XML MENU FILES A menu file is a small xml file conforming with MENU.DTD. Each file must include at least a MENU element and an OPTION element. MENU ELEMENT: Root element <menu width="<W>" nodewidth="NW" style="S" target="T" indent="I"></menu> W : Total width for the table containing the TreeMenu NW : Width for the node cells (normally that of the node graphics) S : Style to use on the menu texts T : Window/Frame name target to the menu links I : MAX Indentation (number of nested menus) OPTION ELEMENT: Defines menu entries <option length="<L>" url="<U>" value="<V>"></option> L : Number of options in this entry (this node expands to L options) U : Destination Link for the option (can be an expandable node or not) V : Entry text to show in the menu NOTES: Options can be nested, so multiple level menus can be achived (see MENU ELEMENT indent details) 3.- Considerations This class is an hybrid on JavaScript and PHP OOP and can be quite tricky to understand (specially the JavaScript TreeMenu Object), so take it easy :) A base $menu object is created with the inclusion of the class file as it is required by the XML Parser auxiliary functions. The JavaScript object will warn on malformed menu data if more options than those specified with the length argument are set to a given option. This class looks for the js files in DOCUMENT_ROOT/js directory and looks for images in DOCUMENT_ROOT/images/menuicon directory (a set of base node/line graphics ships along the class). 4.- Future releases and WIP Some work will be done so the PHP object can check and validate MENU data (i.e. missing options), but the class is fully usable as is. 5.- Contact information Carlos Falo Hervás slainte@jet.es C/Manila 54-56 Esc. A Ent. 4ª 08034 Barcelona Spain Phone: +34 9 3 2063652 Fax: +34 9 3 2063689 |
Files |
File | Role | Description |
---|---|---|
browser.js | Appl. | Browser detecttion JS library |
LICENSE.txt | Lic. | GNU GPL License |
menu.dtd | Doc. | Document Type Definition for the menu files |
menu.xml | Data | Sample menu definition |
readme_en.txt | Doc. | Documentation (English) |
test.php | Example | Test script |
TreeMenu.class.php | Class | Base class |
TreeMenu.js | Appl. | TreeMenu DHTML object |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | ||||||||||||||||||||||||||||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
menuicon.zip Base node images for the class |