You are here

function ds_field_ui_create_vertical_tabs in Display Suite 7

Same name and namespace in other branches
  1. 8.4 includes/field_ui.inc \ds_field_ui_create_vertical_tabs()
  2. 8.2 includes/field_ui.inc \ds_field_ui_create_vertical_tabs()
  3. 8.3 includes/field_ui.inc \ds_field_ui_create_vertical_tabs()
  4. 7.2 includes/ds.field_ui.inc \ds_field_ui_create_vertical_tabs()

Create vertical tabs.

1 call to ds_field_ui_create_vertical_tabs()
ds_field_ui_fields_layouts in ./ds.field_ui.inc
Adds the Display Suite fields and layouts to the form.

File

./ds.field_ui.inc, line 77
Field UI functions for Display Suite.

Code

function ds_field_ui_create_vertical_tabs(&$form) {

  // Add additional settings vertical tab.
  if (!isset($form['additional_settings'])) {
    $form['additional_settings'] = array(
      '#type' => 'vertical_tabs',
      '#theme_wrappers' => array(
        'vertical_tabs',
      ),
      '#prefix' => '<div>',
      '#suffix' => '</div>',
      '#tree' => TRUE,
    );
    $form['#attached']['js'][] = 'misc/form.js';
    $form['#attached']['js'][] = 'misc/collapse.js';
  }
  $view_mode_admin_access = user_access('admin_view_modes');
  if (isset($form['modes'])) {
    if ($view_mode_admin_access) {
      $form['modes']['view_modes_custom']['#description'] = l(t('Manage view modes'), 'admin/structure/ds/view_modes');
    }
    $form['additional_settings']['modes'] = $form['modes'];
    $form['additional_settings']['modes']['#weight'] = -10;
    unset($form['modes']);
  }
  else {
    if ($view_mode_admin_access) {
      $form['additional_settings']['modes']['view_modes_custom']['#description'] = l(t('Manage view modes'), 'admin/structure/ds/view_modes');
    }
  }
}