Abstract Class Zend_View_Helper_Navigation_HelperAbstract

Description

Implements interfaces:

Base class for navigational helpers

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

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

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 121)

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 129)

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

  • access: protected
Zend_Acl $_acl (line 85)

ACL to use when iterating pages

  • access: protected
Zend_Navigation_Container $_container (line 50)

Container to operate on by default

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

Indentation string

  • access: protected
int $_maxDepth (line 64)

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

  • access: protected
int $_minDepth (line 57)

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

  • access: protected

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

Wheter invisible items should be rendered by this helper

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

ACL role to use when iterating pages

  • access: protected
Zend_Translate_Adapter $_translator (line 78)

Translator

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

Whether ACL should be used for filtering out pages

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

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 821)

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 838)

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 704)

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 546)

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 346)

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 167)

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 270)

Returns indentation

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

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

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

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

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

Return renderInvisible flag

  • access: public
bool getRenderInvisible ()

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

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 310)

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 428)

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 480)

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 617)

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 605)

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 629)

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 641)

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 652)

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 332)

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 146)

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 259)

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 230)

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 197)

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 450)

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 371)

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 291)

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 415)

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 467)

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 739)

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 766)

Retrieve whitespace representation of $indent

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

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 804)

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 495)

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 512)

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 Fri, 08 Jan 2010 16:16:52 -0500 by phpDocumentor 1.4.3