You are here

function nd_rules_disable_fields_form in Display Suite 6.3

Rules action callback form.

The administration form. Select which DS/ND field you want to omit from display. Does not take build modes into account.

Parameters

$settings: The settings array

$form: The form array

File

modules/nd/nd.rules.inc, line 45

Code

function nd_rules_disable_fields_form($settings, &$form) {
  $fields = array();
  $build_modes = ds_get_build_modes('nd');
  $types = node_get_types();
  foreach (array_keys($types) as $type) {
    foreach (array_keys($build_modes) as $build_mode) {
      $ds_fields = ds_get_fields('nd', $type, $build_mode);
      $values = array_keys($ds_fields);
      $fields[$type] = array_combine($values, $values);
    }
  }
  $settings += array(
    'disable_this_field' => array(),
  );
  $form['settings']['disable_this_field'] = array(
    '#type' => 'select',
    '#title' => t('Disable this field'),
    '#options' => $fields,
    '#default_value' => $settings['disable_this_field'],
  );
}