Class MenuItemLink

Description

The

  1. MenuItemLink
class is an extension of the
  1. MenuItem
interface adding support for attaching extra data like URL, target window, an access key (shortcut), a toolTip, etc.



  1. MenuItem
is an extension of
  1. Component
;
  1. MenuItems
have display names and the ability to be added to
  1. Menu
objects.

  • version: $Id: MenuItemLink.class.php,v 1.10 2007/09/04 20:25:22 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/GUIManager/Components/MenuItemLink.class.php (line 18)

ComponentInterface
   |
   --Component
      |
      --MenuItemLink
Direct descendents
Class Description
MenuItemLinkWithAdditionalHtml The
  1. MenuItemLink
class is an extension of the
  1. MenuItem
interface adding support for attaching extra data like URL, target window, an access key (shortcut), a toolTip, etc.
Variable Summary
string $_accessKey
array $_attributes
string $_displayName
boolean $_selected
string $_target
string $_toolTip
string $_url
Method Summary
MenuItemLink MenuItemLink (string $displayName, string $url, boolean $selected, integer $index, [string $target = null], [string $accessKey = null], [string $toolTip = null])
void addAttribute (string $attribute, string $value)
string getAccessKey ()
string getDisplayName ()
string getTarget ()
string getToolTip ()
string getURL ()
boolean isSelected ()
void render (ref $theme, [string $tabs = ""])
void setAccessKey (string $accessKey)
void setDisplayName (string $displayName)
void setSelected (boolean $selected)
void setTarget (string $target)
void setToolTip (string $toolTip)
void setURL (string $url)
Variables
string $_accessKey (line 53)

The access key (shortcut) for this menut item.

  • var: _accessKey
  • access: private
array $_attributes (line 69)

An associative array of additional HTML attributes to be included with the

  1. a href
tag. The key is the attribute, and the element is the value.

  • var: _attributes
  • access: private
string $_displayName (line 32)

The display name of this menu item.

  • var: _displayName
  • access: private
boolean $_selected (line 39)

The selected state of this menu item.

  • var: _selected
  • access: private
string $_target (line 46)

The target window of this menu item.

  • var: _target
  • access: private
string $_toolTip (line 60)

The toolTip for this menu item.

  • var: _toolTip
  • access: private
string $_url (line 25)

The url of this menu item.

  • var: _url
  • access: private

Inherited Variables

Inherited from Component

Component::$_content
Component::$_id
Component::$_index
Component::$_postHTML
Component::$_preHTML
Component::$_styleCollections
Component::$_type
Methods
Constructor MenuItemLink (line 87)

The constructor.

  • access: public
MenuItemLink MenuItemLink (string $displayName, string $url, boolean $selected, integer $index, [string $target = null], [string $accessKey = null], [string $toolTip = null])
  • string $displayName: displayName The display name of this menu item.
  • string $url: url The url of this menu item.
  • boolean $selected: selected The selected state of this menu item.
  • integer $index: index The index of this component. The index has no semantic meaning: you can think of the index as 'level' of the component. Alternatively, the index could serve as means of distinguishing between components with the same type. Most often one would use the index in conjunction with the
    1. getStylesForComponentType()
    and
    1. addStyleForComponentType()
    methods.
  • string $target: target The target window of this menu item.
  • string $accessKey: accessKey The access key (shortcut) of this menu item.
  • string $toolTip: toolTip The toolTip of this menu item.
addAttribute (line 292)

Add an additional attribute to the

  1. a href
HTML tag. For example, this could be a javascript event or simply any additional functionality not available through the standard get/set methods. Repeated attributes are not permitted.

  • access: public
void addAttribute (string $attribute, string $value)
  • string $attribute: attribute The name of the attribute, for example: "tabindex".
  • string $value: value The value of the attribute, for example: "3".
getAccessKey (line 244)

Returns the access key character (shortcut) for this menu item.

  • return: The access key character (shortcut) for this menu item.
  • access: public
string getAccessKey ()
getDisplayName (line 173)

Returns the display name of this menu item.

  • return: The display name of this menu item.
  • access: public
string getDisplayName ()
getTarget (line 222)

Returns the target window for this menu item.

  • return: The target window.
  • access: public
string getTarget ()
getToolTip (line 266)

Returns the toolTip text for this menu item.

  • return: The toolTip.
  • access: public
string getToolTip ()
getURL (line 151)

Returns the URL of this menu item.

  • return: url The URL of this menu item.
  • access: public
string getURL ()
isSelected (line 196)

Returns whether the menu item is currently selected.

  • return:
    1. TRUE
    if the menu item is selected;
    1. FALSE
    otherwise.
  • access: public
boolean isSelected ()
render (line 121)

Renders the component on the screen.

  • access: public
void render (ref $theme, [string $tabs = ""])
  • ref $theme: object theme The Theme object to use in producing the result of this method.
  • string $tabs: tabs This is a string (normally a bunch of tabs) that will be prepended to each text line. This argument is optional but its usage is highly recommended in order to produce a nicely formatted HTML output.

Redefinition of:
Component::render()
Renders the component on the screen.

Redefined in descendants as:
setAccessKey (line 253)

Sets the access key character (shortcut) for this menu item.

  • access: public
void setAccessKey (string $accessKey)
  • string $accessKey: accessKey The new access key character (shortcut) for this menu item.
setDisplayName (line 182)

Sets the display name of this menu item.

  • access: public
void setDisplayName (string $displayName)
  • string $displayName: displayName The new display name.
setSelected (line 206)

Sets the selected state of this menu item.

  • access: public
void setSelected (boolean $selected)
  • boolean $selected: selected
    1. TRUE
    means selected;
    1. FALSE
    is unselected.
setTarget (line 231)

Sets the target window for this menu item.

  • access: public
void setTarget (string $target)
  • string $target: target The target window.
setToolTip (line 275)

Sets the toolTip text for this menu item.

  • access: public
void setToolTip (string $toolTip)
  • string $toolTip: tooltip The new toolTip.
setURL (line 160)

Sets the URL of this menu item.

  • access: public
void setURL (string $url)
  • string $url: The URL to set.

Inherited Methods

Inherited From Component

Component::Component()
Component::addStyle()
Component::getId()
Component::getIndex()
Component::getPostHTML()
Component::getPreHTML()
Component::getStyle()
Component::getStyles()
Component::getType()
Component::removeStyle()
Component::render()
Component::setId()
Component::setPostHTML()
Component::setPreHTML()

Inherited From ComponentInterface

ComponentInterface::addStyle()
ComponentInterface::getIndex()
ComponentInterface::getPostHTML()
ComponentInterface::getPreHTML()
ComponentInterface::getStyle()
ComponentInterface::getStyles()
ComponentInterface::getType()
ComponentInterface::removeStyle()
ComponentInterface::render()
ComponentInterface::setPostHTML()
ComponentInterface::setPreHTML()

Documentation generated on Wed, 19 Sep 2007 10:25:02 -0400 by phpDocumentor 1.3.0RC3