Sitellite Application Framework
Class Tree         Index         All Elements

Class: MenuItem

Source Location: Program_Root/GUI/MenuItem.php

Class Overview


MenuItem is the item class that compliments the Menu class and provides much of its recursive logic.


Author(s)

Version

  • 1.2, 2002-09-27, $Id: MenuItem.php,v 1.2 2005/07/06 15:30:56 lux Exp $

Copyright

  • Copyright (C) 2001-2003, Simian Systems Inc.

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 54]
MenuItem is the item class that compliments the Menu class and provides much of its recursive logic.

New in 1.2:

  • The $id property value now has no bearing on which template to use if an array of templates is provided. This was a problem when the template array keys and $id values were both numeric.

1 <?php
2
3 $foo = new MenuItem ('foo', 'Foo');
4
5 $bar =& $foo->addChild ('bar', 'Bar');
6
7 echo $foo->display ('html', '<a href="/index/##id##">##title##</a>');
8
9 ? >




Tags:

access:  public
version:  1.2, 2002-09-27, $Id: MenuItem.php,v 1.2 2005/07/06 15:30:56 lux Exp $
license:  http://www.sitellite.org/index/license
copyright:  Copyright (C) 2001-2003, Simian Systems Inc.
author:  John Luxford <mailto:lux@simian.ca>


[ Top ]


Class Variables

$children =

[line 86]

An array of child items.



Tags:

access:  public

Type:   mixed


[ Top ]

$colours =

[line 95]

An array of background colours for this item, which is the same as the $colours property of saf.GUI.Menu.



Tags:

access:  public

Type:   mixed


[ Top ]

$id =

[line 61]

The (usually) unique id of this item.



Tags:

access:  public

Type:   mixed


[ Top ]

$parent =

[line 78]

A reference to the parent of this item, or false if there is no parent.



Tags:

access:  public

Type:   mixed


[ Top ]

$title =

[line 69]

The title of this item.



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


constructor MenuItem [line 105]

MenuItem MenuItem( string $id, string $title)

Constructor method.



Tags:

access:  public


Parameters:

string   $id  
string   $title  

[ Top ]

method addChild [line 123]

object reference &addChild( string $id, string $title)

Creates a new child item below the current item.



Tags:

access:  public


Parameters:

string   $id  
string   $title  

[ Top ]

method display [line 163]

string display( [string $mode = 'html'], [mixed $tplt = ''], [boolean $recursive = 1])

Renders this item and those below it. $mode can be 'html' or 'collapsible'. $tplt can be a single template or an array of templates.

If $tplt is an associative array, the appropriate template will be chosen. If there aren't an equal number of templates in the array to the number of levels in the menu, the last template in the list will be used repeatedly for all subsequent levels. If $recursive is set to false, it will only render a single level of the tree.




Tags:

access:  public


Parameters:

string   $mode  
mixed   $tplt  
boolean   $recursive  

[ Top ]

method trail [line 135]

array trail( )

Creates a breadcrumb trail as an array of item objects.



Tags:

access:  public


[ Top ]


Copyright © 2007, SIMIAN systems Inc.
All rights reserved. Privacy policy
Documentation generated on Tue, 13 Feb 2007 17:18:11 -0600 by Sitellite AppDoc and phpDocumentor 1.2.2