com.lokorin.dfcrafters.lib
[ class tree: com.lokorin.dfcrafters.lib ] [ index: com.lokorin.dfcrafters.lib ] [ all elements ]

Class: MenuItem

Source Location: /_includes/lib_menu.php

Class Overview

TableEntry
   |
   --MenuItem

Describes an item in a menu. An menu item has a name and are ordered in a tree where all nodes except the root are menu items. An menu item may have any number of children.


Author(s):

  • Andreas Launila

Variables

Methods


Inherited Variables

Inherited Methods

Class: TableEntry

TableEntry::__construct()
Constructor for TableEntry.
TableEntry::getId()
Gets the unique identifier for the table entry.
TableEntry::readRow()
Processes the contents of a retrieved row that describes the entry.

Class Details

[line 116]
Describes an item in a menu. An menu item has a name and are ordered in a tree where all nodes except the root are menu items. An menu item may have any number of children.



Tags:

author:  Andreas Launila


[ Top ]


Class Variables

$depth =

[line 134]

The level of depth that the menu item is located at in the menu tree. A level of 0 means that the item is the root, 1 means that it is a child of the root, and so on.



Tags:

access:  private

Type:   integer


[ Top ]

$name =

[line 121]

The name that describes and is displayed for the menu item.



Tags:

access:  private

Type:   string


[ Top ]

$path =

[line 127]

An optional path that the menu item leads to. It's either an aboslute url or one relative to the root path.



Tags:

access:  private

Type:   string


[ Top ]



Class Methods


constructor __construct [line 142]

MenuItem __construct( integer $id, [integer $depth = 1])

Creator for MenuItem.



Tags:

access:  public


Overrides TableEntry::__construct() (Constructor for TableEntry.)

Parameters:

integer   $id   The unique identifier for the menu item.
integer   $depth   The number of menu items between the menu item that should be constructed and the root.

[ Top ]

method getAsHtml [line 184]

string getAsHtml( )

Gets the menu item as XHTML compliant code. This function also includes the children of the menu item (if there are any).



Tags:

return:  XHTML compliant code representing the menu item. The menu item is represented as a hypertext link in a list item containing a list with all children.
access:  public


[ Top ]

method getChildren [line 163]

array getChildren( )

Gets all children of the menu item in alphabetical order based on their names.



Tags:

return:  An array of MenuItem instance where each instance represents a child. The array may be empty if no children were found.
access:  public


[ Top ]

method getName [line 238]

string getName( )

Gets the name of the menu item.



Tags:

return:  A name that describes the menu item.
access:  public


[ Top ]

method readRow [line 151]

void readRow( mixed $row)



Tags:

access:  protected
see:  com.lokorin.dfcrafters.TableEntry.readRow($row)


Overrides TableEntry::readRow() (Processes the contents of a retrieved row that describes the entry.)

[ Top ]


Documentation generated on Tue, 10 Jan 2006 17:06:33 +0100 by phpDocumentor 1.3.0RC4