EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions | Data Fields | Protected Member Functions
ArtMenu Class Reference
Inheritance diagram for ArtMenu:

Public Member Functions

 init ()
 
 run ()
 

Data Fields

 $items =array()
 
 $itemTemplate
 
 $encodeLabel =true
 
 $activeCssClass ='active'
 
 $activateItems =true
 
 $activateParents =false
 
 $hideEmptyItems =true
 
 $htmlOptions =array()
 
 $submenuHtmlOptions =array()
 
 $firstItemCssClass
 
 $lastItemCssClass
 
 $cls
 
 $prelinklabel
 
 $postlinklabel
 

Protected Member Functions

 renderMenu ($items)
 
 renderMenuRecursive ($items)
 
 renderMenuItem ($item)
 
 normalizeItems ($items, $route, &$active)
 
 isItemActive ($item, $route)
 

Detailed Description

ArtMenu class file.

Author
Byron Lee artme.nosp@m.nu@b.nosp@m.glee..nosp@m.myfa.nosp@m.stmai.nosp@m.l.co.nosp@m.m Copyright © 2011 http://www.yiiframework.com/license/ ArtMenu is a drop in replacement for CMenu with minor changes to support Artisteer 2.4.x based themes. The original version extended the CMenu class from 1.1.4, but was broken by later releases. ArtMenu (a minor modification of CMenu by Jonah Turnquist and Qiang Xue) displays a multi-level menu using nested HTML lists. The main property of ArtMenu is items}, which specifies the possible items in the menu. A menu item has three main properties: visible, active and items. The "visible" property specifies whether the menu item is currently visible. The "active" property specifies whether the menu item is currently selected. And the "items" property specifies the child menu items. The following example shows how to use ArtMenu: $this->widget('application.components.ArtMenu',array( 'cls'=>'art-menu', 'prelinklabel'=>'', 'postlinklabel'=>'', 'items'=>array( // Important: you need to specify url as 'controller/action', // not just as 'controller' even if default acion is used. array('label'=>'Home', 'url'=>array('site/index')), array('label'=>'Products', 'url'=>array('product/index'), 'items'=>array( array('label'=>'New Arrivals', 'url'=>array('product/new', 'tag'=>'new')), array('label'=>'Most Popular', 'url'=>array('product/index', 'tag'=>'popular')), )), array('label'=>'Login', 'url'=>array('site/login'), 'visible'=>Yii::app()->user->isGuest), ), ));

Definition at line 43 of file ArtMenu.php.

Member Function Documentation

init ( )

Initializes the menu widget. This method mainly normalizes the items property. If this method is overridden, make sure the parent implementation is invoked.

Definition at line 164 of file ArtMenu.php.

isItemActive (   $item,
  $route 
)
protected

Checks whether a menu item is active. This is done by checking if the currently requested URL is generated by the 'url' option of the menu item. Note that the GET parameters not specified in the 'url' option will be ignored.

Parameters
array$itemthe menu item to be checked
string$routethe route of the current request
Returns
boolean whether the menu item is active

Definition at line 320 of file ArtMenu.php.

normalizeItems (   $items,
  $route,
$active 
)
protected

Normalizes the items property so that the 'active' state is properly identified for every menu item.

Parameters
array$itemsthe items to be normalized.
string$routethe route of the current request.
boolean$activewhether there is an active child menu item.
Returns
array the normalized menu items

Definition at line 279 of file ArtMenu.php.

renderMenu (   $items)
protected

Renders the menu items.

Parameters
array$itemsmenu items. Each menu item will be an array with at least two elements: 'label' and 'active'. It may have three other optional elements: 'items', 'linkOptions' and 'itemOptions'.

Definition at line 187 of file ArtMenu.php.

renderMenuItem (   $item)
protected

Renders the content of a menu item. Note that the container and the sub-menus are not rendered here.

Parameters
array$itemthe menu item to be rendered. Please see items on what data might be in the item.
Since
1.1.6

Definition at line 253 of file ArtMenu.php.

renderMenuRecursive (   $items)
protected

Recursively renders the menu items.

Parameters
array$itemsthe menu items to be rendered recursively

Definition at line 201 of file ArtMenu.php.

run ( )

Calls renderMenu to render the menu.

Definition at line 177 of file ArtMenu.php.

Field Documentation

$activateItems =true

Definition at line 93 of file ArtMenu.php.

$activateParents =false

Definition at line 99 of file ArtMenu.php.

$activeCssClass ='active'

Definition at line 87 of file ArtMenu.php.

$cls

Definition at line 143 of file ArtMenu.php.

$encodeLabel =true

Definition at line 82 of file ArtMenu.php.

$firstItemCssClass

Definition at line 127 of file ArtMenu.php.

$hideEmptyItems =true

Definition at line 104 of file ArtMenu.php.

$htmlOptions =array()

Definition at line 108 of file ArtMenu.php.

$items =array()

Definition at line 70 of file ArtMenu.php.

$itemTemplate

Definition at line 78 of file ArtMenu.php.

$lastItemCssClass

Definition at line 133 of file ArtMenu.php.

$postlinklabel

Definition at line 157 of file ArtMenu.php.

$prelinklabel

Definition at line 150 of file ArtMenu.php.

$submenuHtmlOptions =array()

Definition at line 112 of file ArtMenu.php.


The documentation for this class was generated from the following file: