You are here

function og_menu_overview in Organic Groups Menu (OG Menu) 5

1 string reference to 'og_menu_overview'
og_menu_menu in ./og_menu.module
Implementation of hook_menu().

File

./og_menu.module, line 142
Modifies the menu module to support menus specific to organic groups.

Code

function og_menu_overview() {
  $groups = og_menu_generate_group_listing();
  if (count($groups) == 0 && !user_access('administer all menus')) {
    $message = t('No groups were found for user %user.', array(
      '%user' => $GLOBALS['user']->name,
    ));
    drupal_set_message($message, $type = 'error');
    $output = t('You currently do not belong to any organic groups. Please join an organic group.');
    return $output;
  }
  og_menu_create_menus();
  menu_rebuild();
  og_menu_check_block_status();
  if (user_access('administer all menus')) {
    return menu_overview_tree();
  }
  else {
    return og_menu_overview_tree();
  }
}