Hide sub menus if all pages in the sub menu is hidden. #5803

Closed
wants to merge 2 commits into
from

2 participants

@riceri

Based on ysors pull request #2925 now with tests.

@samsonasik samsonasik commented on an outdated diff Feb 9, 2014
library/Zend/Navigation/AbstractContainer.php
{
- return count($this->index) > 0;
+ if ($onlyVisible) {
+ foreach ($this->pages as $page) {
+ if ($page->isVisible()) {
+ return true;
+ }
+ }
+ // no visible pages found
+ return false;
+ } else {
+ return count($this->index) > 0;
+ }
@samsonasik
samsonasik added a line comment Feb 9, 2014

no need else, just return count($this->index) > 0; directly after closing bracket because already return early.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@riceri

That should fix it

@weierophinney weierophinney added this to the 2.3.0 milestone Mar 3, 2014
@weierophinney
Zend Framework member

Scheduling for 2.3 as this is technically new functionality.

@weierophinney weierophinney self-assigned this Mar 5, 2014
@weierophinney weierophinney added a commit that referenced this pull request Mar 5, 2014
@weierophinney weierophinney [#5803] Added note to README.md 28f4071
@weierophinney weierophinney added a commit that referenced this pull request Mar 5, 2014
@weierophinney weierophinney Merge branch 'feature/5803' into develop
Close #5803
Fixes #2925
29ab1f2
@weierophinney
Zend Framework member

Merged to develop for release with 2.3.0.

@weierophinney weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zendframework#5803 from riceri/master
Hide sub menus if all pages in the sub menu is hidden.
eda288e
@weierophinney weierophinney added a commit to zendframework/zend-navigation that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zendframework#5803 from riceri/master
Hide sub menus if all pages in the sub menu is hidden.
334847d
@weierophinney weierophinney added a commit to zendframework/zend-navigation that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'feature/5803' into develop 0acbbad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment