You are here

function diff_global_settings_form in Diff 7.3

Helper function to initiate any global form elements.

1 call to diff_global_settings_form()
diff_admin_global_field_settings in ./diff.admin.inc
Menu form callback for the field settings.

File

./diff.diff.inc, line 251
Includes the hooks defined by diff_hook_info().

Code

function diff_global_settings_form(&$subform, $form_state, $type, $settings) {
  $subform['show_header'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show field title'),
    '#default_value' => $settings['show_header'],
    '#weight' => -5,
  );
  $subform['markdown'] = array(
    '#type' => 'select',
    '#title' => t('Markdown callback'),
    '#default_value' => $settings['markdown'],
    '#options' => array(
      'drupal_html_to_text' => t('Drupal HTML to Text'),
      'filter_xss' => t('Filter XSS (some tags)'),
      'diff_filter_xss' => t('Filter XSS (all tags)'),
    ),
    '#description' => t('These provide ways to clean markup tags to make comparisons easier to read.'),
    '#empty_option' => t('- Do not process -'),
  );
  $subform['line_counter'] = array(
    '#type' => 'radios',
    '#title' => t('Line counter'),
    '#default_value' => $settings['line_counter'],
    '#description' => t('This outputs the (approximate) line numbers as a heading before every change.'),
    '#options' => array(
      '' => t('None. Counter ignore and not incremented.'),
      'hidden' => t('Count lines but do not show line headers.'),
      'line' => t('Count and show lines, restarting counter at 0.'),
      'line_continuous' => t('Count and show lines, incrementing counter from last item.'),
    ),
  );
}