当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Navigation_Page::isVisible方法代码示例

本文整理汇总了PHP中Zend_Navigation_Page::isVisible方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Navigation_Page::isVisible方法的具体用法?PHP Zend_Navigation_Page::isVisible怎么用?PHP Zend_Navigation_Page::isVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Navigation_Page的用法示例。


在下文中一共展示了Zend_Navigation_Page::isVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: accept

 /**
  * 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
  * - If helper has ACL and role:
  *  - Page is accepted if it has no resource or privilege
  *  - Page is accepted if ACL allows page's 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.
  *
  * @param  Zend_Navigation_Page $page      page to check
  * @param  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.
  * @return bool                            whether page should be accepted
  */
 public function accept(Zend_Navigation_Page $page, $recursive = true)
 {
     // accept by default
     $accept = true;
     if (!$page->isVisible(false) && !$this->getRenderInvisible()) {
         // don't accept invisible pages
         $accept = false;
     } elseif ($this->getUseAcl() && !$this->_acceptAcl($page)) {
         // acl is not amused
         $accept = false;
     }
     if ($accept && $recursive) {
         $parent = $page->getParent();
         if ($parent instanceof Zend_Navigation_Page) {
             $accept = $this->accept($parent, true);
         }
     }
     return $accept;
 }
开发者ID:ankitsapient,项目名称:testgithubankit,代码行数:40,代码来源:HelperAbstract.php

示例2: _getPageHiddenInfo

 /**
  * Returns JSON with the hidden info for a navigation page link. 
  *
  * @param Zend_Navigation_Page $page The navigation page
  * @return String JSON with the hidden info for a navigation page link. 
  */
 protected function _getPageHiddenInfo(Zend_Navigation_Page $page)
 {
     $hiddenInfo = array('can_delete' => (bool) $page->can_delete, 'uri' => $page->getHref(), 'label' => $page->getLabel(), 'visible' => $page->isVisible());
     return json_encode($hiddenInfo);
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:11,代码来源:Navigation.php


注:本文中的Zend_Navigation_Page::isVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。