Login   Register  
PHP Classes

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Anthony Rogers  >  XMLnav  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Simple shorter example
Class: XMLnav
Creates a menu bar from a definition in XML
Author: By
Last change: Changes to version numbering
Date: 6 years ago
Size: 2,123 bytes


Class file image Download

 * Copyright (C) 2004-2005 Anthony K Rogers roggyadres@hotmail.com            * 
 *                                            * 
 * This file is part of XMLmenu. It gives a quick example of how it is implemented    * 
 *                                            * 
 * version 1.0                                        * 
 * copyright 2004                                    * 

//Generate the menu...
$QueryVars $_GET;
$XMLmenu = new XMLmenu("test.xml"$QueryVars);

//Yes I know these are default values, its just here as an example
//You don't need to include all of them
//If you only want to change the email link image, just include that one
$XMLmenu->menuIMG(2720);        //the image dimensions (Width, Height)
$XMLmenu->fileIMG("images/file.gif");    //a file image
$XMLmenu->folderIMG("images/folder.gif""images/folder.open.gif"); //closed and open folder image
$XMLmenu->linkIMG("images/link.gif");    //external link image
$XMLmenu->emailIMG("images/email.gif");    //email link image


//Following is an example of how you would check which page was being looked at at the time.
if( isset($_GET["menuname"]) ) $menuname $_GET["menuname"];
if( isset(
$_GET["item"]) ) $item $_GET["item"];

if(! isset(
$menuname) ) $loc "Home";
if( isset(
$menuname) ){ //IF 1
if( isset($_GET[$menuname]) ) $menuitem $_GET[$menuname];

$menuname){ //SWITCH 2
case "home"$loc "Home"; break;
"about"$loc "About"; break;
"how"$loc "How to Use"; break;
"future"$loc "Future Developments"; break;

if( isset($menuitem) ){ //IF 3
if( $menuname == "how" ){ //IF 4
switch($menuitem){ //SWITCH 5
case "1"$loc .= " > Step 1"; break;
"2"$loc .= " > Step 2"; break;
"3"$loc .= " > Step 3"; break;
"4"$loc .= " > Step 4"; break;
//IF 4
//IF 3
//IF 1

print $loc;