1 views_handler_field_serialized.inc views_handler_field_serialized::options_form(&$form, &$form_state)

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

Overrides views_handler_field::options_form

File

core/modules/views/handlers/views_handler_field_serialized.inc, line 22
Definition of views_handler_field_serialized.

Class

views_handler_field_serialized
Field handler to show data of serialized fields.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);

  $form['format'] = array(
    '#type' => 'select',
    '#title' => t('Display format'),
    '#description' => t('How should the serialized data be displayed. You can choose a custom array/object key or a print_r on the full output.'),
    '#options' => array(
      'unserialized' => t('Full data (unserialized)'),
      'serialized' => t('Full data (serialized)'),
      'key' => t('A certain key'),
    ),
    '#default_value' => $this->options['format'],
  );
  $form['key'] = array(
    '#type' => 'textfield',
    '#title' => t('Which key should be displayed'),
    '#default_value' => $this->options['key'],
    '#states' => array(
      'visible' => array(
        ':input[name="options[format]"]' => array('value' => 'key'),
      ),
    ),
  );
}