function ack_menu_overview_page in Access Control Kit 7
Menu page callback to list the realms wherein the user may manage menu links.
Return value
array A renderable array.
1 string reference to 'ack_menu_overview_page'
- ack_menu_menu in ack_menu/
ack_menu.module - Implements hook_menu().
File
- ack_menu/
ack_menu.pages.inc, line 46 - Page callbacks for managing menu links in assigned realms.
Code
function ack_menu_overview_page() {
$scheme_realms = _ack_menu_user_realms();
$number_of_user_schemes = count($scheme_realms);
$render = array();
foreach ($scheme_realms as $scheme_machine_name => $realms) {
if (!empty($realms)) {
$scheme = access_scheme_machine_name_load($scheme_machine_name);
$label = check_plain($scheme->name);
if ($number_of_user_schemes > 1) {
$render[$scheme_machine_name]['header'] = array(
'#type' => 'markup',
'#markup' => '<h2>' . $label . '</h2>',
);
}
$header = array(
$label,
array(
'data' => t('Operations'),
'colspan' => 2,
),
);
$rows = array();
foreach ($realms as $realm) {
$row = array();
$row[] = check_plain($scheme->realms[$realm]);
$row[] = array(
'data' => l(t('list links'), 'ack_menu/manage/' . $scheme_machine_name . '/' . $realm),
);
$row[] = array(
'data' => l(t('add link'), 'ack_menu/manage/' . $scheme_machine_name . '/' . $realm . '/add'),
);
$rows[] = $row;
}
$render[$scheme_machine_name]['table'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
);
}
}
if (empty($render)) {
if (ack_menu_admin_access()) {
$empty = t('No access schemes have been configured to manage menu links.');
if (user_access('administer access schemes')) {
$empty .= ' ' . t('To configure an access scheme to manage the menu, use the <a href="@url">access scheme administration page</a> to add a menu access handler to a scheme.', array(
'@url' => url('admin/structure/access'),
));
}
}
else {
$empty = t('You have not been granted access to any menu trees.');
}
$render['empty'] = array(
'#type' => 'markup',
'#markup' => $empty,
);
}
return $render;
}