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