You are here

function groupmenu_overview_page in Group Menu 7

Menu callback to list the menus for the group.

1 string reference to 'groupmenu_overview_page'
groupmenu_menu in ./groupmenu.module
Implements hook_menu().

File

./groupmenu.pages.inc, line 10
Page callbacks for groupmenu.

Code

function groupmenu_overview_page($gid) {

  // Set the title of the page.
  $group = group_load($gid);
  $entity_label = $group
    ->label() ? $group
    ->label() : $gid;
  drupal_set_title(t('List menus for %title', array(
    '%title' => $entity_label,
  )), PASS_THROUGH);
  $header = array(
    t('Title'),
    array(
      'data' => t('Operations'),
      'colspan' => '3',
    ),
  );
  $rows = array();
  foreach (groupmenu_get_menus($gid) as $menu) {
    $row = array(
      theme('menu_admin_overview', array(
        'title' => $menu->title,
        'name' => $menu->menu_name,
        'description' => $menu->description,
      )),
    );
    $row[] = array(
      'data' => l(t('list links'), 'group/' . $gid . '/menus/' . $menu->menu_name),
    );
    $row[] = array(
      'data' => l(t('edit menu'), 'group/' . $gid . '/menus/' . $menu->menu_name . '/edit'),
    );
    $row[] = array(
      'data' => l(t('add link'), 'group/' . $gid . '/menus/' . $menu->menu_name . '/add'),
    );
    $rows[] = $row;
  }
  if (empty($rows)) {
    return t('There are currently no menus.');
  }
  else {
    return theme('table', array(
      'header' => $header,
      'rows' => $rows,
    ));
  }
}