finishing the visibility updates

This commit is contained in:
Andy Miller
2015-08-14 14:28:24 -06:00
parent 7c8b3363b9
commit 059cab3504
2 changed files with 25 additions and 29 deletions

View File

@@ -538,7 +538,7 @@ class Admin
$header = ['title' => $data['title']];
if (isset($data['visible'])) {
if ($data['visible'] == '') {
if ($data['visible'] == '' || $data['visible']) {
// if auto (ie '')
$children = $page->parent()->children();
foreach ($children as $child) {
@@ -548,9 +548,6 @@ class Admin
break;
}
}
} else {
// else visible explicitly set
$header['visible'] = (bool) $data['visible'];
}
}
@@ -576,25 +573,6 @@ class Admin
return $page;
}
/**
* Guess the intended visibility status based on other sibling folders
*
* @param \Grav\Common\Page\Page $page
*
* @return bool
*/
public function guessVisibility(Page $page)
{
$children = $page->parent()->children();
foreach ($children as $child) {
if ($child->order()) {
return true;
}
}
return false;
}
/**
* Static helper method to return current route.
*