Class menu

Description

A menu, which is a container for menu items. This class encapsulates what is essentially a list of links which can be displayed as a 'menu'. Orientation can be VERTICAL or HORIZONTAL. A 'wrap threshold' can be defined. If it's a vertical menu, this represents the max no.

of items down the page. Extra columns are generated to the right to accomodate the items list. In the horizontal case, the threshold represents the max no. of items across the page. Extra rows are generated to hold the menu items list.

Located in /menu-defs.php (line 212)

RenderableObject
   |
   --StylableObject
      |
      --menu
Direct descendents
Class Description
 class sitemenu Site Menu class - a database-enabled extension of the menu class.
Variable Summary
 mixed $items
 mixed $item_count
 mixed $name
 mixed $orientation
 mixed $separator
 mixed $title
 mixed $title_font
Method Summary
 menu menu (string $name, [string $title = ""], [string $orientation = VERTICAL], integer $wrap_threshold)
 void additem (string $label, string $url, [string $linkover_text = ""], [bool $highlighted = false], integer $parent_id, integer $menu_level)
 void add_menuitem (object $item)
 string html ()
 void set_itemfont (string $font)
 void set_titlefont (string $font)
 string wml ()
 string wmlup ()
 void wml_morelink (integer $page, string &$pagepos, string &$nextlabel, string &$nexthref)
Variables
mixed $highlightclass = "" (line 223)

Stylesheet class to use for highlighting

mixed $items (line 228)

Array of items in this menu

mixed $item_count = 0 (line 231)

Number of items in the menu

mixed $name = "" (line 215)

Name of the menu

mixed $orientation = VERTICAL (line 219)

Menu orientation: HORIZONTAL or VERTICAL

mixed $separator = SEP_SPACE (line 221)

Separator character between items

mixed $title = "" (line 217)

Title/banner for this menu

mixed $title_font = "" (line 234)

Font settings for the title/banner

mixed $wrap_threshold = 0 (line 237)

Max. number of menu items before wrapping the menu

Inherited Variables

Inherited from StylableObject

StylableObject::$class
StylableObject::$id
StylableObject::$style
Methods
Constructor menu (line 247)

Constructor Creates the menu object.

menu menu (string $name, [string $title = ""], [string $orientation = VERTICAL], integer $wrap_threshold)
  • string $name: Name of the menu
  • string $title: Title/benner for the menu
  • string $orientation: HORIZONTAL or VERTICAL
  • integer $wrap_threshold: Max. number of menu items before menu wraps
additem (line 284)

Create new menu item Makes a new menuitem from a given label and URL and adds it to the menu.

void additem (string $label, string $url, [string $linkover_text = ""], [bool $highlighted = false], integer $parent_id, integer $menu_level)
  • string $label: Label to display
  • string $url: URl for the menu item link
  • string $linkover_text: Text to display in status bar when mouseover
  • bool $highlighted: True if menu item should be highlighted
  • integer $parent_id: Parent ID of this new item
  • integer $menu_level: menu level of this new item
add_menuitem (line 267)

Add menu item Adds a ready-made menuitem to the menu.

void add_menuitem (object $item)
  • object $item: The menu item to add to the menu
html (line 460)

This renders the field as HTML.

  • return: The field as HTML.
string html ()

Redefinition of:
RenderableObject::html()
Return output suitable for normal HTML-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to web browsers.
set_itemfont (line 298)

Set the font of all menu items

void set_itemfont (string $font)
  • string $font: Font settings to apply to all menu items
set_titlefont (line 310)

Set the menu tite font

void set_titlefont (string $font)
  • string $font: Font settings for menu title
wml (line 374)

This renders the field as WML.

  • return: The field as WML.
string wml ()

Redefinition of:
RenderableObject::wml()
Return output suitable for normal wap-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to wap devices.
wmlup (line 322)

This renders the menu as WML (w/Phone.com extns) in a paged mode with a number of menuitems/page defined by $wrap_threshold.

WAP phone with Phone.com extensions. We always create vertical menus using a jump-menu in this particular case.

  • return: The menu as WML.
string wmlup ()

Redefinition of:
RenderableObject::wmlup()
Return output suitable for normal wap-capable device which has Phone.com extensions. This method must be over-ridden by a method of the same name in the descendant class which renders output to wap devices.
wml_morelink (line 423)

Given a page number of the current page, this method returns the appropriate label and link HREF for the next page link.

void wml_morelink (integer $page, string &$pagepos, string &$nextlabel, string &$nexthref)
  • integer $page: Page number of current page
  • string $pagepos: Reference to string to contain current page pos
  • string $nextlabel: Reference to string to contain next page link
  • string $nexthref: Reference to string to contain HREF to next page

Inherited Methods

Inherited From StylableObject

 StylableObject::StylableObject()
 StylableObject::clearstyle()
 StylableObject::setclass()
 StylableObject::setcss()
 StylableObject::setid()
 StylableObject::setstyle()

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3