function hosting_menu_alter in Hostmaster (Aegir) 6
Implementation of hook_menu_alter().
File
- modules/
hosting/ hosting.module, line 127 - Hosting module.
Code
function hosting_menu_alter(&$items) {
$items['node/add']['page callback'] = '_hosting_node_add';
$types = hosting_feature_node_types(TRUE);
foreach ($types as $feature => $type) {
$path = sprintf('node/add/%s', str_replace('_', '-', $type));
$items[$path]['access callback'] = 'hosting_menu_access';
$items[$path]['access arguments'] = array(
str_replace('_', ' ', $type),
$feature,
);
}
// These node types should remain hidden, and provide no user interface.
$items['node/add/package']['page callback'] = 'drupal_access_denied';
$items['node/add/task']['page callback'] = 'drupal_access_denied';
$items['node/add/package']['type'] = MENU_CALLBACK;
$items['node/add/task']['type'] = MENU_CALLBACK;
}