Abstract Class Zend_View_Helper_Navigation_HelperAbstract

Description

Implements interfaces:

Base class for navigational helpers

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • abstract:
  • license: New BSD License

Located in /View/Helper/Navigation/HelperAbstract.php (line 42)

Zend_View_Helper_Abstract
   |
   --Zend_View_Helper_HtmlElement
      |
      --Zend_View_Helper_Navigation_HelperAbstract
Direct descendents
Class Description
 class Zend_View_Helper_Navigation_Links Helper for printing <link> elements
 class Zend_View_Helper_Navigation_Sitemap Helper for printing sitemaps
 class Zend_View_Helper_Navigation_Menu Helper for rendering menus from navigation containers
 class Zend_View_Helper_Navigation_Breadcrumbs Helper for printing breadcrumbs
 class Zend_View_Helper_Navigation Proxy helper for retrieving navigational helpers and forwarding calls
Variable Summary
Method Summary
 static void setDefaultAcl ([ $acl = null])
 static void setDefaultRole ([midex $role = null])
 bool accept ( $page, [bool $recursive = true])
 array findActive ( $container, [int|null $minDepth = null], [ $maxDepth = -1])
 Zend_Acl|null getAcl ()
 string getIndent ()
 int|null getMaxDepth ()
 int|null getMinDepth ()
 bool getUseAcl ()
 bool hasAcl ()
 bool hasContainer ()
 bool hasRole ()
 bool hasTranslator ()
 string htmlify ( $page)
 bool _acceptAcl ( $page)
 string _getWhitespace (int|string $indent)
 string _htmlAttribs (array $attribs)
 string _normalizeId (string $value)
 mixed __call (string $method, [ $arguments = array()])
 string __toString ()
Variables
static Zend_Acl $_defaultAcl (line 122)

Default ACL to use when iterating pages if not explicitly set in the instance by calling setAcl()

  • access: protected
static string|Zend_Acl_Role_Interface $_defaultRole (line 130)

Default ACL role to use when iterating pages if not explicitly set in the instance by calling setRole()

  • access: protected
Zend_Acl $_acl (line 86)

ACL to use when iterating pages

  • access: protected
Zend_Navigation_Container $_container (line 51)

Container to operate on by default

  • access: protected
string $_indent = '' (line 72)

Indentation string

  • access: protected
int $_maxDepth (line 65)

The maximum depth a page can have to be included when rendering

  • access: protected
int $_minDepth (line 58)

The minimum depth a page must have to be included when rendering

  • access: protected

Redefined in descendants as:
bool $_renderInvisible = false (line 93)

Wheter invisible items should be rendered by this helper

  • access: protected
string|Zend_Acl_Role_Interface $_role (line 100)

ACL role to use when iterating pages

  • access: protected
Zend_Translate_Adapter $_translator (line 79)

Translator

  • access: protected
bool $_useAcl = true (line 114)

Whether ACL should be used for filtering out pages

  • access: protected
bool $_useTranslator = true (line 107)

Whether translator should be used for page labels and titles

  • access: protected

Inherited Variables

Inherited from Zend_View_Helper_HtmlElement

Zend_View_Helper_HtmlElement::$_closingBracket

Inherited from Zend_View_Helper_Abstract

Zend_View_Helper_Abstract::$view
Methods
static setDefaultAcl (line 825)

Sets default ACL to use if another ACL is not explicitly set

  • access: public
static void setDefaultAcl ([ $acl = null])
  • Zend_Acl $acl: [optional] ACL object. Default is null, which sets no ACL object.
static setDefaultRole (line 842)

Sets default ACL role(s) to use when iterating pages if not explicitly set later with setRole()

  • throws: Zend_View_Exception if role is invalid
  • access: public
static void setDefaultRole ([midex $role = null])
  • midex $role: [optional] role to set. Expects null, string, or an instance of Zend_Acl_Role_Interface. Default is null, which sets no default role.
accept (line 708)

Determines whether a page should be accepted when iterating

Rules:

  • If a page is not visible it is not accepted, unless RenderInvisible has been set to true.
  • If helper has no ACL, page is accepted
  • If helper has ACL, but no role, page is not accepted
  • Page is accepted if it has no resource or privilege
  • If page is accepted by the rules above and $recursive is true, the page will not be accepted if it is the descendant of a non-accepted page.

  • return: whether page should be accepted
  • access: public
bool accept ( $page, [bool $recursive = true])
  • Zend_Navigation_Page $page: page to check
  • bool $recursive: [optional] if true, page will not be accepted if it is the descendant of a page that is not accepted. Default is true.
findActive (line 550)

Finds the deepest active page in the given container

  • return: an associative array with the values 'depth' and 'page', or an empty array if not found
  • access: public
array findActive ( $container, [int|null $minDepth = null], [ $maxDepth = -1])
  • Zend_Navigation_Container $container: container to search
  • int|null $minDepth: [optional] maximum depth a page can have to be valid. Default is to use getMaxDepth(). A null value means no maximum depth required.
  • $maxDepth
getAcl (line 347)

Returns ACL or null if it isn't set using setAcl() or setDefaultAcl()

Implements Zend_View_Helper_Navigation_Helper::getAcl().

  • return: ACL object or null
  • access: public
Zend_Acl|null getAcl ()

Implementation of:
Zend_View_Helper_Navigation_Helper::getAcl()
Returns ACL or null if it isn't set using setAcl() or setDefaultAcl()
getContainer (line 168)

Returns the navigation container helper operates on by default

Implements Zend_View_Helper_Navigation_Interface::getContainer().

If a helper is not explicitly set in this helper instance by calling setContainer() or by passing it through the helper entry point, this method will look in Zend_Registry for a container by using the key 'Zend_Navigation'.

If no container is set, and nothing is found in Zend_Registry, a new container will be instantiated and stored in the helper.

  • return: navigation container
  • access: public
Zend_Navigation_Container getContainer ()

Implementation of:
Zend_View_Helper_Navigation_Helper::getContainer()
Returns the navigation container the helper operates on by default
getIndent (line 271)

Returns indentation

  • access: public
string getIndent ()
getMaxDepth (line 246)

Returns maximum depth a page can have to be included when rendering

  • return: maximum depth or null
  • access: public
int|null getMaxDepth ()
getMinDepth (line 213)

Returns minimum depth a page must have to be included when rendering

  • return: minimum depth or null
  • access: public
int|null getMinDepth ()
getRenderInvisible (line 442)

Return renderInvisible flag

  • access: public
bool getRenderInvisible ()

Implementation of:
Zend_View_Helper_Navigation_Helper::getRenderInvisible()
Return renderInvisible flag
getRole (line 399)

Returns ACL role to use when iterating pages, or null if it isn't set using setRole() or setDefaultRole()

Implements Zend_View_Helper_Navigation_Helper::getRole().

  • return: role or null
  • access: public
string|Zend_Acl_Role_Interface|null getRole ()

Implementation of:
Zend_View_Helper_Navigation_Helper::getRole()
Returns ACL role to use when iterating pages, or null if it isn't set
getTranslator (line 311)

Returns translator used in helper

Implements Zend_View_Helper_Navigation_Helper::getTranslator().

  • return: translator or null
  • access: public
Zend_Translate_Adapter|null getTranslator ()

Implementation of:
Zend_View_Helper_Navigation_Helper::getTranslator()
Returns translator used in helper
getUseAcl (line 432)

Returns whether ACL should be used

Implements Zend_View_Helper_Navigation_Helper::getUseAcl().

  • return: whether ACL should be used
  • access: public
bool getUseAcl ()

Implementation of:
Zend_View_Helper_Navigation_Helper::getUseAcl()
Returns whether ACL should be used
getUseTranslator (line 484)

Returns whether translator should be used

Implements Zend_View_Helper_Navigation_Helper::getUseTranslator().

  • return: whether translator should be used
  • access: public
bool getUseTranslator ()

Implementation of:
Zend_View_Helper_Navigation_Helper::getUseTranslator()
Returns whether translator should be used
hasAcl (line 621)

Checks if the helper has an ACL instance

Implements Zend_View_Helper_Navigation_Helper::hasAcl().

  • return: whether the helper has a an ACL instance or not
  • access: public
bool hasAcl ()

Implementation of:
Zend_View_Helper_Navigation_Helper::hasAcl()
Checks if the helper has an ACL instance
hasContainer (line 609)

Checks if the helper has a container

Implements Zend_View_Helper_Navigation_Helper::hasContainer().

  • return: whether the helper has a container or not
  • access: public
bool hasContainer ()

Implementation of:
Zend_View_Helper_Navigation_Helper::hasContainer()
Checks if the helper has a container
hasRole (line 633)

Checks if the helper has an ACL role

Implements Zend_View_Helper_Navigation_Helper::hasRole().

  • return: whether the helper has a an ACL role or not
  • access: public
bool hasRole ()

Implementation of:
Zend_View_Helper_Navigation_Helper::hasRole()
Checks if the helper has an ACL role
hasTranslator (line 645)

Checks if the helper has a translator

Implements Zend_View_Helper_Navigation_Helper::hasTranslator().

  • return: whether the helper has a translator or not
  • access: public
bool hasTranslator ()

Implementation of:
Zend_View_Helper_Navigation_Helper::hasTranslator()
Checks if the helper has a translator
htmlify (line 656)

Returns an HTML string containing an 'a' element for the given page

  • return: HTML string for the given page
  • access: public
string htmlify ( $page)

Redefined in descendants as:
setAcl (line 333)

Sets ACL to use when iterating pages

Implements Zend_View_Helper_Navigation_Helper::setAcl().

  • return: fluent interface, returns self
  • access: public
  • Zend_Acl $acl: [optional] ACL object. Default is null.

Implementation of:
Zend_View_Helper_Navigation_Helper::setAcl()
Sets ACL to use when iterating pages
setContainer (line 147)

Sets navigation container the helper operates on by default

Implements Zend_View_Helper_Navigation_Interface::setContainer().

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_HelperAbstract setContainer ([ $container = null])
  • Zend_Navigation_Container $container: [optional] container to operate on. Default is null, meaning container will be reset.

Implementation of:
Zend_View_Helper_Navigation_Helper::setContainer()
Sets navigation container the helper should operate on by default
setIndent (line 260)

Set the indentation string for using in render(), optionally a number of spaces to indent with

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_HelperAbstract setIndent (string|int $indent)
  • string|int $indent: indentation string or number of spaces
setMaxDepth (line 231)

Sets the maximum depth a page can have to be included when rendering

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_HelperAbstract setMaxDepth ([int $maxDepth = null])
  • int $maxDepth: [optional] maximum depth. Default is null, which sets no maximum depth.
setMinDepth (line 198)

Sets the minimum depth a page must have to be included when rendering

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_HelperAbstract setMinDepth ([int $minDepth = null])
  • int $minDepth: [optional] minimum depth. Default is null, which sets no minimum depth.
setRenderInvisible (line 454)

Render invisible items?

  • return: fluent interface returns self
  • access: public
Zend_View_Helper_Navigation_HelperAbstract setRenderInvisible ([bool $renderInvisible = true])
  • bool $renderInvisible: [optional] boolean flag

Implementation of:
Zend_View_Helper_Navigation_Helper::setRenderInvisible()
Render invisible items?
setRole (line 372)

Sets ACL role(s) to use when iterating pages

Implements Zend_View_Helper_Navigation_Helper::setRole().

  • return: fluent interface, returns self
  • throws: Zend_View_Exception if $role is invalid
  • access: public
Zend_View_Helper_Navigation_HelperAbstract setRole ([mixed $role = null])
  • mixed $role: [optional] role to set. Expects a string, an instance of type Zend_Acl_Role_Interface, or null. Default is null, which will set no role.

Implementation of:
Zend_View_Helper_Navigation_Helper::setRole()
Sets ACL role to use when iterating pages
setTranslator (line 292)

Sets translator to use in helper

Implements Zend_View_Helper_Navigation_Helper::setTranslator().

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_HelperAbstract setTranslator ([mixed $translator = null])

Implementation of:
Zend_View_Helper_Navigation_Helper::setTranslator()
Sets translator to use in helper
setUseAcl (line 419)

Sets whether ACL should be used

Implements Zend_View_Helper_Navigation_Helper::setUseAcl().

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_HelperAbstract setUseAcl ([bool $useAcl = true])
  • bool $useAcl: [optional] whether ACL should be used. Default is true.

Implementation of:
Zend_View_Helper_Navigation_Helper::setUseAcl()
Sets whether ACL should be used
setUseTranslator (line 471)

Sets whether translator should be used

Implements Zend_View_Helper_Navigation_Helper::setUseTranslator().

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_HelperAbstract setUseTranslator ([bool $useTranslator = true])
  • bool $useTranslator: [optional] whether translator should be used. Default is true.

Implementation of:
Zend_View_Helper_Navigation_Helper::setUseTranslator()
Sets whether translator should be used
_acceptAcl (line 743)

Determines whether a page should be accepted by ACL when iterating

Rules:

  • If helper has no ACL, page is accepted
  • If page has a resource or privilege defined, page is accepted if the ACL allows access to it using the helper's role
  • If page has no resource or privilege, page is accepted

  • return: whether page is accepted by ACL
  • access: protected
bool _acceptAcl ( $page)
_getWhitespace (line 770)

Retrieve whitespace representation of $indent

  • access: protected
string _getWhitespace (int|string $indent)
  • int|string $indent
_htmlAttribs (line 788)

Converts an associative array to a string of tag attributes.

Overloads Zend_View_Helper_HtmlElement::_htmlAttribs().

  • return: an attribute string
  • access: protected
string _htmlAttribs (array $attribs)
  • array $attribs: an array where each key-value pair is converted to an attribute name and value

Redefinition of:
Zend_View_Helper_HtmlElement::_htmlAttribs()
Converts an associative array to a string of tag attributes.
_normalizeId (line 808)

Normalize an ID

Overrides Zend_View_Helper_HtmlElement::_normalizeId().

  • access: protected
string _normalizeId (string $value)
  • string $value

Redefinition of:
Zend_View_Helper_HtmlElement::_normalizeId()
Normalize an ID
__call (line 499)

Magic overload: Proxy calls to the navigation container

  • return: returns what the container returns
  • throws: Zend_Navigation_Exception if method does not exist in container
  • access: public
mixed __call (string $method, [ $arguments = array()])
  • string $method: method name in container
  • array $arguments: [optional] arguments to pass

Redefined in descendants as:
__toString (line 516)

Magic overload: Proxy to render().

This method will trigger an E_USER_ERROR if rendering the helper causes an exception to be thrown.

Implements Zend_View_Helper_Navigation_Helper::__toString().

  • access: public
string __toString ()

Implementation of:
Zend_View_Helper_Navigation_Helper::__toString()
Magic overload: Should proxy to render().

Inherited Methods

Inherited From Zend_View_Helper_HtmlElement

 Zend_View_Helper_HtmlElement::getClosingBracket()
 Zend_View_Helper_HtmlElement::_htmlAttribs()
 Zend_View_Helper_HtmlElement::_isXhtml()
 Zend_View_Helper_HtmlElement::_normalizeId()

Inherited From Zend_View_Helper_Abstract

 Zend_View_Helper_Abstract::direct()
 Zend_View_Helper_Abstract::setView()
Class Constants

Documentation generated on Mon, 21 Jun 2010 15:26:28 -0400 by phpDocumentor 1.4.3