Helper.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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-2009 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /**
  22. * Interface for navigational helpers
  23. *
  24. * @category Zend
  25. * @package Zend_View
  26. * @subpackage Helper
  27. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  28. * @license http://framework.zend.com/license/new-bsd New BSD License
  29. */
  30. interface Zend_View_Helper_Navigation_Helper
  31. {
  32. /**
  33. * Sets navigation container the helper should operate on by default
  34. *
  35. * @param Zend_Navigation_Container $container [optional] container to
  36. * operate on. Default is
  37. * null, which indicates that
  38. * the container should be
  39. * reset.
  40. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  41. * self
  42. */
  43. public function setContainer(Zend_Navigation_Container $container = null);
  44. /**
  45. * Returns the navigation container the helper operates on by default
  46. *
  47. * @return Zend_Navigation_Container navigation container
  48. */
  49. public function getContainer();
  50. /**
  51. * Sets translator to use in helper
  52. *
  53. * @param mixed $translator [optional] translator.
  54. * Expects an object of type
  55. * {@link Zend_Translate_Adapter}
  56. * or {@link Zend_Translate},
  57. * or null. Default is null.
  58. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  59. * self
  60. */
  61. public function setTranslator($translator = null);
  62. /**
  63. * Returns translator used in helper
  64. *
  65. * @return Zend_Translate_Adapter|null translator or null
  66. */
  67. public function getTranslator();
  68. /**
  69. * Sets ACL to use when iterating pages
  70. *
  71. * @param Zend_Acl $acl [optional] ACL instance
  72. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  73. * self
  74. */
  75. public function setAcl(Zend_Acl $acl = null);
  76. /**
  77. * Returns ACL or null if it isn't set using {@link setAcl()} or
  78. * {@link setDefaultAcl()}
  79. *
  80. * @return Zend_Acl|null ACL object or null
  81. */
  82. public function getAcl();
  83. /**
  84. * Sets ACL role to use when iterating pages
  85. *
  86. * @param mixed $role [optional] role to set.
  87. * Expects a string, an
  88. * instance of type
  89. * {@link Zend_Acl_Role_Interface},
  90. * or null. Default is null.
  91. * @throws Zend_View_Exception if $role is invalid
  92. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  93. * self
  94. */
  95. public function setRole($role = null);
  96. /**
  97. * Returns ACL role to use when iterating pages, or null if it isn't set
  98. *
  99. * @return string|Zend_Acl_Role_Interface|null role or null
  100. */
  101. public function getRole();
  102. /**
  103. * Sets whether ACL should be used
  104. *
  105. * @param bool $useAcl [optional] whether ACL
  106. * should be used. Default is
  107. * true.
  108. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  109. * self
  110. */
  111. public function setUseAcl($useAcl = true);
  112. /**
  113. * Returns whether ACL should be used
  114. *
  115. * @return bool whether ACL should be used
  116. */
  117. public function getUseAcl();
  118. /**
  119. * Return renderInvisible flag
  120. *
  121. * @return bool
  122. */
  123. public function getRenderInvisible();
  124. /**
  125. * Render invisible items?
  126. *
  127. * @param bool $renderInvisible [optional] boolean flag
  128. * @return Zend_View_Helper_Navigation_HelperAbstract fluent interface
  129. * returns self
  130. */
  131. public function setRenderInvisible($renderInvisible = true);
  132. /**
  133. * Sets whether translator should be used
  134. *
  135. * @param bool $useTranslator [optional] whether
  136. * translator should be used.
  137. * Default is true.
  138. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  139. * self
  140. */
  141. public function setUseTranslator($useTranslator = true);
  142. /**
  143. * Returns whether translator should be used
  144. *
  145. * @return bool whether translator should be used
  146. */
  147. public function getUseTranslator();
  148. /**
  149. * Checks if the helper has a container
  150. *
  151. * @return bool whether the helper has a container or not
  152. */
  153. public function hasContainer();
  154. /**
  155. * Checks if the helper has an ACL instance
  156. *
  157. * @return bool whether the helper has a an ACL instance or not
  158. */
  159. public function hasAcl();
  160. /**
  161. * Checks if the helper has an ACL role
  162. *
  163. * @return bool whether the helper has a an ACL role or not
  164. */
  165. public function hasRole();
  166. /**
  167. * Checks if the helper has a translator
  168. *
  169. * @return bool whether the helper has a translator or not
  170. */
  171. public function hasTranslator();
  172. /**
  173. * Magic overload: Should proxy to {@link render()}.
  174. *
  175. * @return string
  176. */
  177. public function __toString();
  178. /**
  179. * Renders helper
  180. *
  181. * @param Zend_Navigation_Container $container [optional] container to
  182. * render. Default is null,
  183. * which indicates that the
  184. * helper should render the
  185. * container returned by
  186. * {@link getContainer()}.
  187. * @return string helper output
  188. * @throws Zend_View_Exception if unable to render
  189. */
  190. public function render(Zend_Navigation_Container $container = null);
  191. }