You are here

function hosting_menu_alter in Hosting 7.4

Same name and namespace in other branches
  1. 6.2 hosting.module \hosting_menu_alter()
  2. 7.3 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;

  // Make drupal node pages more user-friendly.
  $items['node/%node/view']['title callback'] = 'hosting_node_tab_title';
  $items['node/%node/view']['title arguments'] = array(
    'View',
    1,
  );
  $items['node/%node/view']['weight'] = -100;
  $items['node/%node/edit']['title callback'] = 'hosting_node_tab_title';
  $items['node/%node/edit']['title arguments'] = array(
    'Edit',
    1,
  );
  $items['node/%node/edit']['weight'] = -99;
}