You are here

function views_plugin_style_xml_test::options_form in Views Datasource 7

Same name and namespace in other branches
  1. 6 views_plugin_style_xml_test.inc \views_plugin_style_xml_test::options_form()

Provide a form for setting options.

Overrides views_plugin_style::options_form

File

views/plugins/views_plugin_style_xml_test.inc, line 39
Implementation of views_plugin_style for views_xml

Class

views_plugin_style_xml_test
Implements views_plugin_style

Code

function options_form(&$form, &$form_state) {
  $form['schema'] = array(
    '#type' => 'radios',
    '#title' => t('XML schema'),
    '#description' => t('The schema or format of the XML data document.'),
    '#options' => array(
      'raw' => t('Raw XML'),
      'opml' => t('OPML'),
      'atom' => t('Atom'),
    ),
    '#default_value' => $this->options['schema'],
  );
  $form['root_element'] = array(
    '#type' => 'textfield',
    '#title' => t('Root element name'),
    '#default_value' => $this->options['root_element'],
    '#description' => t('The name of the root element in the XML document.'),
  );
  $form['field_output'] = array(
    '#type' => 'radios',
    '#title' => t('Field output'),
    '#description' => t('For each row in the view, fields can be output as either the field rendered by Views, or by the raw content of the field.'),
    '#options' => array(
      'normal' => t('Normal'),
      'raw' => t('Raw'),
    ),
    '#default_value' => $this->options['field_output'],
  );
  $form['element_output'] = array(
    '#type' => 'radios',
    '#title' => t('Element output'),
    '#description' => t('For each row in the view, fields can be output as either nested XML child elements, or attributes of the XML element.'),
    '#options' => array(
      'nested' => t('Nested'),
      'attributes' => t('Attributes'),
    ),
    '#default_value' => $this->options['element_output'],
  );
  $form['escape_as_CDATA'] = array(
    '#type' => 'radios',
    '#title' => t('Escape row content as CDATA'),
    '#description' => t('For each row in the view, escape the row field content as XML CDATA sections.'),
    '#options' => array(
      'yes' => t('Yes'),
      'no' => t('No'),
    ),
    '#default_value' => $this->options['escape_as_CDATA'],
  );
}