Logo ZenEngine Logo SourceForge.net ZenEngine
the lightweight CMS framework

ZenMenuItem

package : ZenEngine/Core
Author : Bruno Desthuilliers
Version : 0.0.5

public class ZenMenuItem

A menu entry, either a Document or Category (no associated document)
A menu item is mainly a data object... But it's a very important one, because it gets carried all over the code, and is used by many components...

Functions

public void ZenMenuItem

Assign the values to member data

Parameters :
string $key
string $caption
string $level
string $templatePage : null if it's a category
string $docType : null if it's a category
string $docQueryData : null if it's a category

Return : (void)

public string getKey

Return the key

Return : (string)

public string getCaption

Return the caption

Return : (string)

public integer getLevel

Return the level

Return : (integer)

public string getTemplatePage

Return the template page

Return : (string)

public mixed getDocType

Return the doc type code used by the contentManager to call the appropriate docMaker

Return : (mixed)

public string getDocQueryData

Return the data used by the docMaker to retrieve the document

Return : (string)

public boolean isDoc

Return true if this entry is a document, false if it's a category

Return : (boolean)

public string getHRef

Return the href for the associated document
The href has the form : $templatePage?key=$key no href for category items.

Return : (string)

variables

private string $_key

the key for this item (yes, it's repeated in the menu item itself)

private string $_caption

The caption used when displaying the menu item

private string $_templatePage

The 'template' php page to use for the associated document

private mixed $_docType

The doc type code used by the content manager to call the appropriate docMaker
The code is up to the MenuMaker and the site config. The ZenFS package uses the files (or directory) extension as docType

private mixed $_docQueryData

Data used by the docMaker to retrieve the document.
Note that the content of this is left at the discretion of the implementors of the MenuMaker and the DocMaker - so you'd better have a docMaker and a menuMaker designed to work together.

private integer $_level

Nesting level of this menu item