You are here

function features_menu in Features 6

Same name and namespace in other branches
  1. 7.2 features.module \features_menu()
  2. 7 features.module \features_menu()

Implementation of hook_menu().

File

./features.module, line 62
Module file for the features module, which enables the capture and management of features in Drupal. A feature is a collection of Drupal entities which taken together statisfy a certain use-case.

Code

function features_menu() {
  $items = array();
  $items['admin/build/features'] = array(
    'title' => 'Features',
    'description' => 'Manage features.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'features_admin_form',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'features.admin.inc',
  );
  $items['admin/build/features/cleanup'] = array(
    'title' => 'Cleanup',
    'description' => 'Detect and disable any orphaned feature dependencies.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'features_cleanup_form',
      4,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'features.admin.inc',
    'weight' => 1,
  );
  $items['admin/build/features/manage'] = array(
    'title' => 'Manage',
    'description' => 'Enable and disable features.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'features_admin_form',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file' => 'features.admin.inc',
  );
  $items['admin/build/features/create'] = array(
    'title' => 'Create feature',
    'description' => 'Create a new feature.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'features_export_form',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer features',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => "features.admin.inc",
    'weight' => 10,
  );
  $items['admin/build/features/export/populate'] = array(
    'title' => 'Populate feature',
    'description' => 'AHAH callback to populate a feature from selected components.',
    'page callback' => 'features_export_build_form_populate',
    'page arguments' => array(),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer features',
    ),
    'type' => MENU_CALLBACK,
    'file' => "features.admin.inc",
  );
  $items['admin/build/features/%feature'] = array(
    'title callback' => 'features_get_feature_title',
    'title arguments' => array(
      3,
    ),
    'description' => 'Display components of a feature.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'features_admin_components',
      3,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer features',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'features.admin.inc',
  );
  $items['admin/build/features/%feature/view'] = array(
    'title' => 'View',
    'description' => 'Display components of a feature.',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer features',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/build/features/%feature/recreate'] = array(
    'title' => 'Recreate',
    'description' => 'Recreate an existing feature.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'features_export_form',
      3,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer features',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => "features.admin.inc",
    'weight' => 11,
  );
  if (module_exists('diff')) {
    $items['admin/build/features/%feature/diff'] = array(
      'title' => 'Review overrides',
      'description' => 'Compare default and current feature.',
      'page callback' => 'features_feature_diff',
      'page arguments' => array(
        3,
        5,
      ),
      'access callback' => 'features_access_override_actions',
      'access arguments' => array(
        3,
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'features.admin.inc',
    );
  }
  $items['admin/build/features/%feature/status'] = array(
    'title' => 'Status',
    'description' => 'Javascript status call back.',
    'page callback' => 'features_feature_status',
    'page arguments' => array(
      3,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer features',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'features.admin.inc',
  );
  foreach ($items as $path => $item) {
    if (!isset($item['access callback'])) {
      $items[$path]['access callback'] = 'user_access';
      $items[$path]['access arguments'] = array(
        'manage features',
      );
    }
  }
  return $items;
}