Skip to content

Instantly share code, notes, and snippets.

@jeremyboggs
Forked from kimisgold/submenu-check.php
Last active December 31, 2015 21:08
Show Gist options
  • Save jeremyboggs/8044441 to your computer and use it in GitHub Desktop.
Save jeremyboggs/8044441 to your computer and use it in GitHub Desktop.
<?php
function public_nav_has_subpages() {
$view = get_view();
$nav = new Omeka_Navigation;
$nav->loadAsOption(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME);
$nav->addPagesFromFilter(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_FILTER_NAME);
$pages = get_view()->navigation()->menu($nav)->getPages();
foreach($pages as $page) {
if($page->hasPages()) {
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment