You are here

function features_menu in Features 7

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

Implements hook_menu().

File

./features.module, line 69
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/structure/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/structure/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/structure/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/structure/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/structure/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,
    ),
    'load arguments' => array(
      3,
      TRUE,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer features',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'features.admin.inc',
  );
  $items['admin/structure/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/structure/features/%feature/recreate'] = array(
    'title' => 'Recreate',
    'description' => 'Recreate an existing feature.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'features_export_form',
      3,
    ),
    'load arguments' => array(
      3,
      TRUE,
    ),
    '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/structure/features/%feature/diff'] = array(
      'title' => 'Review overrides',
      'description' => 'Compare default and current feature.',
      'page callback' => 'features_feature_diff',
      'page arguments' => array(
        3,
        5,
      ),
      'load arguments' => array(
        3,
        TRUE,
      ),
      'access callback' => 'features_access_override_actions',
      'access arguments' => array(
        3,
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'features.admin.inc',
    );
  }
  $items['admin/structure/features/%feature/status'] = array(
    'title' => 'Status',
    'description' => 'Javascript status call back.',
    'page callback' => 'features_feature_status',
    'page arguments' => array(
      3,
    ),
    'load arguments' => array(
      3,
      TRUE,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer features',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'features.admin.inc',
  );
  $items['features/autocomplete/packages'] = array(
    'page callback' => 'features_autocomplete_packages',
    '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;
}