function hosting_menu_alter in Hosting 7.3
Same name and namespace in other branches
- 6.2 hosting.module \hosting_menu_alter()
- 7.4 hosting.module \hosting_menu_alter()
Implements hook_menu_alter().
File
- ./
hosting.module, line 205 - 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;
}