function domain_nav_menu in Domain Access 6.2
Same name and namespace in other branches
- 5 domain_nav/domain_nav.module \domain_nav_menu()
- 7.3 domain_nav/domain_nav.module \domain_nav_menu()
- 7.2 domain_nav/domain_nav.module \domain_nav_menu()
Implement hook_menu()
File
- domain_nav/
domain_nav.module, line 33 - Navigation block and menu options for Domain Access
Code
function domain_nav_menu() {
$items = array();
if (DOMAIN_NAV_MENU == TRUE) {
$root = domain_default();
$items['domain'] = array(
'title' => 'Domain',
'type' => MENU_SUGGESTED_ITEM,
'page callback' => 'drupal_goto',
'page arguments' => array(
$root['path'],
),
'access callback' => 'domain_nav_check',
'access arguments' => array(
TRUE,
),
'description' => 'Go to main site',
);
// Generate the list of active domains as menu items
$domains = domain_domains();
foreach ($domains as $domain) {
// If the domain is not valid, we disable it by default.
$type = MENU_NORMAL_ITEM;
if (empty($domain['valid'])) {
$type = MENU_SUGGESTED_ITEM;
}
$items['domain/' . filter_xss_admin($domain['subdomain'])] = array(
'title' => check_plain($domain['sitename']),
'type' => $type,
'page callback' => 'drupal_goto',
'page arguments' => array(
$domain['path'],
),
'access callback' => 'domain_nav_check',
'access arguments' => array(
TRUE,
),
'description' => 'Go to ' . filter_xss_admin($domain['subdomain']),
);
}
}
return $items;
}