You are here

function ds_extras_menu in Display Suite 7

Same name and namespace in other branches
  1. 7.2 modules/ds_extras/ds_extras.module \ds_extras_menu()

Implements hook_menu().

File

modules/ds_extras/ds_extras.module, line 11
Display Suite extras main functions.

Code

function ds_extras_menu() {
  $items = array();
  $items['admin/structure/ds/extras'] = array(
    'title' => 'Extras',
    'description' => 'Configure extra functionality for Display suite.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ds_extras_settings',
    ),
    'access arguments' => array(
      'admin_display_suite',
    ),
    'file' => 'ds_extras.admin.inc',
  );
  if (variable_get('ds_extras_switch_field')) {
    $items['ds-switch-view-mode'] = array(
      'title' => 'Switch view',
      'description' => 'Switches a view mode inline.',
      'page callback' => 'ds_switch_view_mode_inline',
      'access arguments' => array(
        'access content',
      ),
      'file' => 'ds_extras.pages.inc',
      'type' => MENU_CALLBACK,
    );
  }
  if (variable_get('ds_extras_vd', FALSE) && module_exists('field_ui') && module_exists('views')) {
    $items['admin/structure/ds/vd'] = array(
      'title' => 'Views displays',
      'description' => 'Manage your views templates.',
      'page callback' => 'ds_extras_vd_overview',
      'file' => 'ds_extras.vd.inc',
      'access arguments' => array(
        'admin_display_suite',
      ),
    );
    $items['admin/structure/ds/vd/manage'] = array(
      'title' => 'Manage layout',
      'description' => 'Manage your views templates.',
      'page callback' => 'ds_extras_vd_manage',
      'file' => 'ds_extras.vd.inc',
      'access arguments' => array(
        'admin_display_suite',
      ),
    );
  }
  if (variable_get('ds_extras_contextual', FALSE) && module_exists('contextual') && module_exists('field_ui')) {
    $items['node/%node/display'] = array(
      'title' => 'Manage display',
      'description' => 'Manage display of this content.',
      'page callback' => 'ds_extras_contextual_page_tab',
      'page arguments' => array(
        1,
        'node',
      ),
      'file' => 'ds_extras.pages.inc',
      'access arguments' => array(
        'administer content types',
      ),
      'type' => MENU_LOCAL_TASK,
    );
    $items['user/%user/display'] = array(
      'title' => 'Manage display',
      'description' => 'Manage display of this user profile.',
      'page callback' => 'ds_extras_contextual_page_tab',
      'page arguments' => array(
        1,
        'user',
      ),
      'file' => 'ds_extras.pages.inc',
      'access arguments' => array(
        'administer users',
      ),
      'type' => MENU_LOCAL_TASK,
    );
    if (module_exists('taxonomy')) {
      $items['taxonomy/term/%taxonomy_term/display'] = array(
        'title' => 'Manage display',
        'description' => 'Manage display of this term.',
        'page callback' => 'ds_extras_contextual_page_tab',
        'page arguments' => array(
          2,
          'taxonomy_term',
        ),
        'access arguments' => array(
          'administer taxonomy',
        ),
        'type' => MENU_LOCAL_TASK,
        'weight' => 11,
        'file' => 'ds_extras.pages.inc',
      );
    }
  }

  // Panel view modes.
  if (variable_get('ds_extras_panel_view_modes')) {
    $items['admin/structure/panels/settings/ds-panels'] = array(
      'title' => 'Panel view modes',
      'description' => 'Configure which content is available to add to panel view mode displays.',
      'access arguments' => array(
        'admin_display_suite',
      ),
      'page callback' => 'ds_panels_view_mode_settings',
      'file' => 'ds_extras.panels.inc',
      'type' => MENU_LOCAL_TASK,
    );
  }
  return $items;
}