You are here

function image_field_diff_options_form in Diff 7.3

Provide a form for setting the field comparison options.

File

includes/image.inc, line 94
Provide diff field functions for the image module.

Code

function image_field_diff_options_form($field_type, $settings) {
  $options_form = array();
  $options_form['show_id'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show image ID'),
    '#default_value' => $settings['show_id'],
  );
  $options_form['compare_alt_field'] = array(
    '#type' => 'checkbox',
    '#title' => t('Compare <em>Alt</em> field'),
    '#default_value' => $settings['compare_alt_field'],
    '#description' => t('This is only used if the "Enable <em>Alt</em> field" is checked in the instance settings.'),
  );
  $options_form['compare_title_field'] = array(
    '#type' => 'checkbox',
    '#title' => t('Compare <em>Title</em> field'),
    '#default_value' => $settings['compare_title_field'],
    '#description' => t('This is only used if the "Enable <em>Title</em> field" is checked in the instance settings.'),
  );
  $options_form['property_separator'] = array(
    '#type' => 'select',
    '#title' => t('Property separator'),
    '#default_value' => $settings['property_separator'],
    '#description' => t('Provides the ability to show properties inline or across multiple lines.'),
    '#options' => array(
      ', ' => t('Comma (,)'),
      '; ' => t('Semicolon (;)'),
      ' ' => t('Space'),
      'nl' => t('New line'),
    ),
  );

  // Allow users to set their own separator using variable_set().
  if (!isset($options_form['#options'][$settings['property_separator']])) {
    $options_form['#options'][$settings['property_separator']] = $settings['property_separator'];
  }
  return $options_form;
}