1 views_plugin_row_rss_fields.inc views_plugin_row_rss_fields::options_form(&$form, &$form_state)

Provide a form for setting options.

Overrides views_plugin_row::options_form

File

core/modules/views/plugins/views_plugin_row_rss_fields.inc, line 23
Contains an implementation of RSS items based on fields on a row plugin.

Class

views_plugin_row_rss_fields
Renders an RSS item based on fields.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);

  $initial_labels = array('' => t('- None -'));
  $view_fields_labels = $this->display->handler->get_field_labels();
  $view_fields_labels = array_merge($initial_labels, $view_fields_labels);

  $form['title_field'] = array(
    '#type' => 'select',
    '#title' => t('Title field'),
    '#description' => t('The field that is going to be used as the RSS item title for each row.'),
    '#options' => $view_fields_labels,
    '#default_value' => $this->options['title_field'],
    '#required' => TRUE,
  );
  $form['link_field'] = array(
    '#type' => 'select',
    '#title' => t('Link field'),
    '#description' => t('The field that is going to be used as the RSS item link for each row. This must be a Backdrop relative path.'),
    '#options' => $view_fields_labels,
    '#default_value' => $this->options['link_field'],
    '#required' => TRUE,
  );
  $form['description_field'] = array(
    '#type' => 'select',
    '#title' => t('Description field'),
    '#description' => t('The field that is going to be used as the RSS item description for each row.'),
    '#options' => $view_fields_labels,
    '#default_value' => $this->options['description_field'],
    '#required' => TRUE,
  );
  $form['creator_field'] = array(
    '#type' => 'select',
    '#title' => t('Creator field'),
    '#description' => t('The field that is going to be used as the RSS item creator for each row.'),
    '#options' => $view_fields_labels,
    '#default_value' => $this->options['creator_field'],
    '#required' => TRUE,
  );
  $form['date_field'] = array(
    '#type' => 'select',
    '#title' => t('Publication date field'),
    '#description' => t('The field that is going to be used as the RSS item pubDate for each row. It needs to be in RFC 2822 format.'),
    '#options' => $view_fields_labels,
    '#default_value' => $this->options['date_field'],
    '#required' => TRUE,
  );
  $form['guid_field_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('GUID settings'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  $form['guid_field_options']['guid_field'] = array(
    '#type' => 'select',
    '#title' => t('GUID field'),
    '#description' => t('The globally unique identifier of the RSS item.'),
    '#options' => $view_fields_labels,
    '#default_value' => $this->options['guid_field_options']['guid_field'],
    '#required' => TRUE,
  );
  $form['guid_field_options']['guid_field_is_permalink'] = array(
    '#type' => 'checkbox',
    '#title' => t('GUID is permalink'),
    '#description' => t('The RSS item GUID is a permalink.'),
    '#default_value' => $this->options['guid_field_options']['guid_field_is_permalink'],
  );
}