You are here

function views_xml_backend_plugin_query_xml::options_form in Views XML Backend 6

Same name and namespace in other branches
  1. 7 views_xml_backend_plugin_query_xml.inc \views_xml_backend_plugin_query_xml::options_form()

Add settings for the ui.

Overrides views_plugin_query::options_form

File

./views_xml_backend_plugin_query_xml.inc, line 278
Query plugin for views_xml_backend.

Class

views_xml_backend_plugin_query_xml
@file Query plugin for views_xml_backend.

Code

function options_form(&$form, &$form_state) {
  $form['xml_file'] = array(
    '#type' => 'textfield',
    '#title' => t('XML File'),
    '#default_value' => $this->options['xml_file'],
    '#description' => t("The URL or path to the XML file."),
    '#maxlength' => 1024,
  );
  $form['row_xpath'] = array(
    '#type' => 'textfield',
    '#title' => t('Row Xpath'),
    '#default_value' => $this->options['row_xpath'],
    '#description' => t("An xpath function that selects rows."),
    '#required' => TRUE,
  );
  $form['default_namespace'] = array(
    '#type' => 'textfield',
    '#title' => t('Default namespace'),
    '#default_value' => $this->options['default_namespace'],
    '#description' => t("If the xml contains a default namespace, it will be accessible as 'default:element'. If you want something different, declare it here."),
    '#required' => FALSE,
  );
  $form['show_errors'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show XML errors'),
    '#default_value' => $this->options['show_errors'],
    '#description' => t('If there were any errors during XML parsing, display them. It is recommended to leave this on during development.'),
    '#required' => FALSE,
  );
}