You are here

public function views_xml_backend_plugin_query_xml::options_form in Views XML Backend 7

Same name and namespace in other branches
  1. 6 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 368
Contains views_xml_backend_plugin_query_xml.

Class

views_xml_backend_plugin_query_xml
@file Contains views_xml_backend_plugin_query_xml.

Code

public 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 errors'),
    '#default_value' => $this->options['show_errors'],
    '#description' => t('If there were any errors during XML parsing or downloading the file, display them. It is recommended to leave this on during development.'),
    '#required' => FALSE,
  );
}