web/lib/Zend/View/Helper/Navigation/Helper.php
changeset 64 162c1de6545a
parent 19 1c2f13fd785c
child 68 ecaf28ffe26e
equal deleted inserted replaced
63:5b37998e522e 64:162c1de6545a
       
     1 <?php
       
     2 /**
       
     3  * Zend Framework
       
     4  *
       
     5  * LICENSE
       
     6  *
       
     7  * This source file is subject to the new BSD license that is bundled
       
     8  * with this package in the file LICENSE.txt.
       
     9  * It is also available through the world-wide-web at this URL:
       
    10  * http://framework.zend.com/license/new-bsd
       
    11  * If you did not receive a copy of the license and are unable to
       
    12  * obtain it through the world-wide-web, please send an email
       
    13  * to license@zend.com so we can send you a copy immediately.
       
    14  *
       
    15  * @category   Zend
       
    16  * @package    Zend_View
       
    17  * @subpackage Helper
       
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    20  * @version    $Id: Helper.php 20096 2010-01-06 02:05:09Z bkarwin $
       
    21  */
       
    22 
       
    23 /**
       
    24  * Interface for navigational helpers
       
    25  *
       
    26  * @category   Zend
       
    27  * @package    Zend_View
       
    28  * @subpackage Helper
       
    29  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    30  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    31  */
       
    32 interface Zend_View_Helper_Navigation_Helper
       
    33 {
       
    34     /**
       
    35      * Sets navigation container the helper should operate on by default
       
    36      *
       
    37      * @param  Zend_Navigation_Container $container  [optional] container to
       
    38      *                                               operate on. Default is
       
    39      *                                               null, which indicates that
       
    40      *                                               the container should be
       
    41      *                                               reset.
       
    42      * @return Zend_View_Helper_Navigation_Helper    fluent interface, returns
       
    43      *                                               self
       
    44      */
       
    45     public function setContainer(Zend_Navigation_Container $container = null);
       
    46 
       
    47     /**
       
    48      * Returns the navigation container the helper operates on by default
       
    49      *
       
    50      * @return Zend_Navigation_Container  navigation container
       
    51      */
       
    52     public function getContainer();
       
    53 
       
    54     /**
       
    55      * Sets translator to use in helper
       
    56      *
       
    57      * @param  mixed $translator                   [optional] translator.
       
    58      *                                             Expects an object of type
       
    59      *                                             {@link Zend_Translate_Adapter}
       
    60      *                                             or {@link Zend_Translate},
       
    61      *                                             or null. Default is null.
       
    62      * @return Zend_View_Helper_Navigation_Helper  fluent interface, returns
       
    63      *                                             self
       
    64      */
       
    65     public function setTranslator($translator = null);
       
    66 
       
    67     /**
       
    68      * Returns translator used in helper
       
    69      *
       
    70      * @return Zend_Translate_Adapter|null  translator or null
       
    71      */
       
    72     public function getTranslator();
       
    73 
       
    74     /**
       
    75      * Sets ACL to use when iterating pages
       
    76      *
       
    77      * @param  Zend_Acl $acl                       [optional] ACL instance
       
    78      * @return Zend_View_Helper_Navigation_Helper  fluent interface, returns
       
    79      *                                             self
       
    80      */
       
    81     public function setAcl(Zend_Acl $acl = null);
       
    82 
       
    83     /**
       
    84      * Returns ACL or null if it isn't set using {@link setAcl()} or
       
    85      * {@link setDefaultAcl()}
       
    86      *
       
    87      * @return Zend_Acl|null  ACL object or null
       
    88      */
       
    89     public function getAcl();
       
    90 
       
    91     /**
       
    92      * Sets ACL role to use when iterating pages
       
    93      *
       
    94      * @param  mixed $role                         [optional] role to set.
       
    95      *                                             Expects a string, an
       
    96      *                                             instance of type
       
    97      *                                             {@link Zend_Acl_Role_Interface},
       
    98      *                                             or null. Default is null.
       
    99      * @throws Zend_View_Exception                 if $role is invalid
       
   100      * @return Zend_View_Helper_Navigation_Helper  fluent interface, returns
       
   101      *                                             self
       
   102      */
       
   103     public function setRole($role = null);
       
   104 
       
   105     /**
       
   106      * Returns ACL role to use when iterating pages, or null if it isn't set
       
   107      *
       
   108      * @return string|Zend_Acl_Role_Interface|null  role or null
       
   109      */
       
   110     public function getRole();
       
   111 
       
   112     /**
       
   113      * Sets whether ACL should be used
       
   114      *
       
   115      * @param  bool $useAcl                        [optional] whether ACL
       
   116      *                                             should be used. Default is
       
   117      *                                             true.
       
   118      * @return Zend_View_Helper_Navigation_Helper  fluent interface, returns
       
   119      *                                             self
       
   120      */
       
   121     public function setUseAcl($useAcl = true);
       
   122 
       
   123     /**
       
   124      * Returns whether ACL should be used
       
   125      *
       
   126      * @return bool  whether ACL should be used
       
   127      */
       
   128     public function getUseAcl();
       
   129 
       
   130     /**
       
   131      * Return renderInvisible flag
       
   132      *
       
   133      * @return bool
       
   134      */
       
   135     public function getRenderInvisible();
       
   136 
       
   137     /**
       
   138      * Render invisible items?
       
   139      *
       
   140      * @param  bool $renderInvisible                       [optional] boolean flag
       
   141      * @return Zend_View_Helper_Navigation_HelperAbstract  fluent interface
       
   142      *                                                     returns self
       
   143      */
       
   144     public function setRenderInvisible($renderInvisible = true);
       
   145 
       
   146     /**
       
   147      * Sets whether translator should be used
       
   148      *
       
   149      * @param  bool $useTranslator                 [optional] whether
       
   150      *                                             translator should be used.
       
   151      *                                             Default is true.
       
   152      * @return Zend_View_Helper_Navigation_Helper  fluent interface, returns
       
   153      *                                             self
       
   154      */
       
   155     public function setUseTranslator($useTranslator = true);
       
   156 
       
   157     /**
       
   158      * Returns whether translator should be used
       
   159      *
       
   160      * @return bool  whether translator should be used
       
   161      */
       
   162     public function getUseTranslator();
       
   163 
       
   164     /**
       
   165      * Checks if the helper has a container
       
   166      *
       
   167      * @return bool  whether the helper has a container or not
       
   168      */
       
   169     public function hasContainer();
       
   170 
       
   171     /**
       
   172      * Checks if the helper has an ACL instance
       
   173      *
       
   174      * @return bool  whether the helper has a an ACL instance or not
       
   175      */
       
   176     public function hasAcl();
       
   177 
       
   178     /**
       
   179      * Checks if the helper has an ACL role
       
   180      *
       
   181      * @return bool  whether the helper has a an ACL role or not
       
   182      */
       
   183     public function hasRole();
       
   184 
       
   185     /**
       
   186      * Checks if the helper has a translator
       
   187      *
       
   188      * @return bool  whether the helper has a translator or not
       
   189      */
       
   190     public function hasTranslator();
       
   191 
       
   192     /**
       
   193      * Magic overload: Should proxy to {@link render()}.
       
   194      *
       
   195      * @return string
       
   196      */
       
   197     public function __toString();
       
   198 
       
   199     /**
       
   200      * Renders helper
       
   201      *
       
   202      * @param  Zend_Navigation_Container $container  [optional] container to
       
   203      *                                               render. Default is null,
       
   204      *                                               which indicates that the
       
   205      *                                               helper should render the
       
   206      *                                               container returned by
       
   207      *                                               {@link getContainer()}.
       
   208      * @return string                                helper output
       
   209      * @throws Zend_View_Exception                   if unable to render
       
   210      */
       
   211     public function render(Zend_Navigation_Container $container = null);
       
   212 }