domain_nav_menu()Implement hook_menu()
domain_nav/domain_nav.module, line 33
<?php
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' => $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;
}
?>