You are here

public function views_xml_backend_handler_field::options_form in Views XML Backend 7

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

Default options form provides the label widget that all fields should have.

Overrides views_handler_field::options_form

2 calls to views_xml_backend_handler_field::options_form()
views_xml_backend_handler_field_date::options_form in handlers/views_xml_backend_handler_field_date.inc
Default options form provides the label widget that all fields should have.
views_xml_backend_handler_field_markup::options_form in handlers/views_xml_backend_handler_field_markup.inc
Default options form provides the label widget that all fields should have.
2 methods override views_xml_backend_handler_field::options_form()
views_xml_backend_handler_field_date::options_form in handlers/views_xml_backend_handler_field_date.inc
Default options form provides the label widget that all fields should have.
views_xml_backend_handler_field_markup::options_form in handlers/views_xml_backend_handler_field_markup.inc
Default options form provides the label widget that all fields should have.

File

handlers/views_xml_backend_handler_field.inc, line 49
Contains views_xml_backend_handler_field.

Class

views_xml_backend_handler_field
Base field handler for views_xml_backend.

Code

public function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['xpath_selector'] = array(
    '#title' => t('XPath selector'),
    '#description' => t('The xpath selector'),
    '#type' => 'textfield',
    '#default_value' => $this->options['xpath_selector'],
    '#required' => TRUE,
  );
  $form['multiple'] = array(
    '#title' => t('Allow multiple'),
    '#description' => t('Treat this field as multi-valued.'),
    '#type' => 'checkbox',
    '#default_value' => $this->options['multiple'],
  );
  $form['list_options'] = array(
    '#type' => 'fieldset',
    '#states' => array(
      'visible' => array(
        ':input[name="options[multiple]"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );
  $form['list_type'] = array(
    '#title' => t('List type'),
    '#description' => t('The type of list.'),
    '#type' => 'radios',
    '#default_value' => $this->options['list_type'],
    '#options' => array(
      'ul' => t('Unordered list'),
      'ol' => t('Ordered list'),
      'br' => check_plain('<br />'),
      'other' => t('Custom separator'),
    ),
    '#fieldset' => 'list_options',
  );
  $form['custom_separator'] = array(
    '#type' => 'textfield',
    '#title' => t('Separator'),
    '#default_value' => $this->options['custom_separator'],
    '#states' => array(
      'visible' => array(
        ':input[name="options[list_type]"]' => array(
          'value' => 'other',
        ),
      ),
    ),
    '#fieldset' => 'list_options',
  );
}