function views_xml_backend_handler_field::options_form in Views XML Backend 6
Same name and namespace in other branches
- 7 handlers/views_xml_backend_handler_field.inc \views_xml_backend_handler_field::options_form()
2 calls to views_xml_backend_handler_field::options_form()
2 methods override views_xml_backend_handler_field::options_form()
File
- handlers/
views_xml_backend_handler_field.inc, line 38 - Base field handler for views_xml_backend.
Class
- views_xml_backend_handler_field
- @file Base field handler for views_xml_backend.
Code
function options_form(&$form, &$form_state) {
$form['xml'] = array(
'#type' => 'fieldset',
'#title' => t('XPath settings'),
);
$form['xml']['xpath_selector'] = array(
'#title' => t('XPath selector'),
'#description' => t('The xpath selector'),
'#type' => 'textfield',
'#default_value' => $this->options['xpath_selector'],
'#required' => TRUE,
'#parents' => array(
'options',
'xpath_selector',
),
);
$form['xml']['multiple'] = array(
'#title' => t('Allow multiple'),
'#description' => t('Treat this field as multi-valued.'),
'#type' => 'checkbox',
'#default_value' => $this->options['multiple'],
'#parents' => array(
'options',
'multiple',
),
);
$form['xml']['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'),
),
'#process' => array(
'expand_radios',
'views_process_dependency',
),
'#dependency' => array(
'edit-options-multiple' => array(
TRUE,
),
),
'#prefix' => '<div id="edit-options-list-type-wrapper">',
'#id' => 'edit-options-list-type',
'#suffix' => '</div>',
'#parents' => array(
'options',
'list_type',
),
);
$form['xml']['custom_separator'] = array(
'#type' => 'textfield',
'#title' => t('Separator'),
'#default_value' => $this->options['custom_separator'],
'#process' => array(
'views_process_dependency',
),
'#dependency' => array(
'radio:options[list_type]' => array(
'other',
),
),
'#parents' => array(
'options',
'custom_separator',
),
);
parent::options_form($form, $form_state);
$form['ui_name']['#weight'] = -100;
}