You are here

function ack_menu_admin_page in Access Control Kit 7

Menu page callback which shows an overview of all accessible menus.

See also

menu_overview_page()

1 string reference to 'ack_menu_admin_page'
ack_menu_menu_alter in ack_menu/ack_menu.module
Implements hook_menu_alter().

File

ack_menu/ack_menu.pages.inc, line 13
Page callbacks for managing menu links in assigned realms.

Code

function ack_menu_admin_page() {
  $result = db_query("SELECT * FROM {menu_custom} ORDER BY title", array(), array(
    'fetch' => PDO::FETCH_ASSOC,
  ));
  $header = array(
    t('Title'),
    array(
      'data' => t('Operations'),
      'colspan' => '3',
    ),
  );
  $rows = array();
  foreach ($result as $menu) {
    if (ack_menu_menu_access($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'), 'admin/structure/menu/manage/' . $menu['menu_name']),
      );
      $row[] = array(
        'data' => l(t('edit menu'), 'admin/structure/menu/manage/' . $menu['menu_name'] . '/edit'),
      );
      $row[] = array(
        'data' => l(t('add link'), 'admin/structure/menu/manage/' . $menu['menu_name'] . '/add'),
      );
      $rows[] = $row;
    }
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
}