You are here

function ds_menu in Display Suite 7

Same name and namespace in other branches
  1. 7.2 ds.module \ds_menu()

Implements hook_menu().

File

./ds.module, line 59
Display Suite core functions.

Code

function ds_menu() {
  $items = array();

  // Start page of Display Suite.
  $items['admin/structure/ds'] = array(
    'title' => 'Display suite',
    'description' => 'Manage configuration for Display suite like fields, view modes etc.',
    'page callback' => 'system_admin_menu_block_page',
    'access arguments' => array(
      'admin_display_suite',
    ),
    'file' => 'system.admin.inc',
    'file path' => drupal_get_path('module', 'system'),
  );

  // Emergency page
  $items['admin/structure/ds/emergency'] = array(
    'title' => 'Emergency',
    'description' => 'In case you have errors via Display suite, visit this page.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_emergency',
    ),
    'access arguments' => array(
      'admin_display_suite',
    ),
    'file' => 'ds.layout.inc',
    'weight' => 100,
  );

  // Custom styles.
  $items['admin/structure/ds/styles'] = array(
    'title' => 'Styles',
    'description' => 'Define classes which you can use as classes on regions and fields (if available).',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_styles_form',
    ),
    'file' => 'ds.styles.inc',
    'access arguments' => array(
      'admin_display_suite',
    ),
  );

  // Layout overview.
  $items['admin/structure/ds/layout'] = array(
    'title' => 'Layout',
    'description' => 'Displays a list of content which can be styled.',
    'page callback' => 'ds_layout_list',
    'file' => 'ds.layout.inc',
    'access arguments' => array(
      'admin_display_suite',
    ),
  );

  // Change layout.
  $items['admin/structure/ds/change-layout'] = array(
    'title' => 'Change layout',
    'description' => 'Act on layout change to move fields elsewhere',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_field_ui_layout_change',
    ),
    'access arguments' => array(
      'admin_display_suite',
    ),
    'file' => 'ds.field_ui.inc',
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
  );

  // Revert layout.
  $items['admin/structure/ds/revert-layout'] = array(
    'title' => 'Revert layout',
    'description' => 'Revert layout and field settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_revert_layout_field_settings_form',
    ),
    'file' => 'ds.field_ui.inc',
    'access arguments' => array(
      'admin_display_suite',
    ),
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
  );

  // View modes.
  $items['admin/structure/ds/view_modes'] = array(
    'title' => 'View modes',
    'description' => 'Manage view modes for all content.',
    'page callback' => 'ds_view_modes_list',
    'file' => 'ds.view_modes.inc',
    'access arguments' => array(
      'admin_view_modes',
    ),
  );
  $items['admin/structure/ds/view_modes/manage'] = array(
    'title' => 'Add a view mode',
    'description' => 'Manage a view mode',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_edit_view_mode_form',
    ),
    'file' => 'ds.view_modes.inc',
    'access arguments' => array(
      'admin_view_modes',
    ),
    'type' => MENU_LOCAL_ACTION,
  );
  $items['admin/structure/ds/view_modes/delete'] = array(
    'title' => 'Delete a view mode',
    'description' => 'Delete a custom view mode.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_delete_view_mode_confirm',
    ),
    'file' => 'ds.view_modes.inc',
    'access arguments' => array(
      'admin_view_modes',
    ),
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
  );
  $items['admin/structure/ds/view_modes/revert'] = array(
    'title' => 'Revert a view mode',
    'description' => 'Revert a view mode.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_revert_view_mode_confirm',
    ),
    'file' => 'ds.view_modes.inc',
    'access arguments' => array(
      'admin_view_modes',
    ),
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
  );

  // Fields.
  $items['admin/structure/ds/fields'] = array(
    'title' => 'Fields',
    'description' => 'Manage fields for all content.',
    'page callback' => 'ds_custom_fields_list',
    'file' => 'ds.fields.inc',
    'access arguments' => array(
      'admin_fields',
    ),
  );
  $items['admin/structure/ds/fields/manage'] = array(
    'title' => 'Fields edit',
    'page callback' => 'ds_custom_manage',
    'file' => 'ds.fields.inc',
    'access arguments' => array(
      'admin_fields',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/structure/ds/fields/manage_custom'] = array(
    'title' => 'Add a code field',
    'description' => 'Manage a field',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_edit_custom_field_form',
    ),
    'file' => 'ds.fields.inc',
    'access arguments' => array(
      'admin_fields',
    ),
    'type' => MENU_LOCAL_ACTION,
    'weight' => 0,
  );
  $items['admin/structure/ds/fields/manage_ctools'] = array(
    'title' => 'Add a dynamic field',
    'description' => 'Manage a dynamic field',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_edit_ctools_field_form',
    ),
    'file' => 'ds.fields.inc',
    'access arguments' => array(
      'admin_fields',
    ),
    'type' => MENU_LOCAL_ACTION,
    'weight' => 1,
  );
  $items['admin/structure/ds/fields/manage_ctools/content'] = array(
    'title' => 'Ctools field content',
    'page callback' => 'ds_ctools_content',
    'file' => 'ds.field_ui.inc',
    'access arguments' => array(
      'admin_display_suite',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/structure/ds/fields/manage_preprocess'] = array(
    'title' => 'Add a preprocess field',
    'description' => 'Manage a preprocess field',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_edit_preprocess_field_form',
    ),
    'file' => 'ds.fields.inc',
    'access arguments' => array(
      'admin_fields',
    ),
    'type' => MENU_LOCAL_ACTION,
    'weight' => 3,
  );
  $items['admin/structure/ds/fields/delete'] = array(
    'title' => 'Delete a field',
    'description' => 'Delete a field.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_delete_field_confirm',
    ),
    'file' => 'ds.fields.inc',
    'access arguments' => array(
      'admin_fields',
    ),
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
  );
  $items['admin/structure/ds/fields/revert'] = array(
    'title' => 'Revert a custom field',
    'description' => 'Revert a custom field.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_revert_field_confirm',
    ),
    'file' => 'ds.fields.inc',
    'access arguments' => array(
      'admin_fields',
    ),
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
  );

  // Block can be disabled.
  if (module_exists('block')) {
    $items['admin/structure/ds/fields/manage_block'] = array(
      'title' => 'Add a block field',
      'description' => 'Manage a block field',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'ds_edit_block_field_form',
      ),
      'file' => 'ds.fields.inc',
      'access arguments' => array(
        'admin_fields',
      ),
      'type' => MENU_LOCAL_ACTION,
      'weight' => 2,
    );
  }

  // CTools Modal add field.
  $items['admin/structure/ds/%ctools_js/add_field/%'] = array(
    'title' => 'Add field',
    'page callback' => 'ds_ajax_add_field',
    'page arguments' => array(
      3,
      5,
    ),
    'access arguments' => array(
      'admin_fields',
    ),
    'file' => 'ds.field_ui.inc',
    'type' => MENU_CALLBACK,
  );
  return $items;
}