You are here

function views_handler_field_serialized::options_form in Views (for Drupal 7) 6.3

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

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

Overrides views_handler_field::options_form

File

handlers/views_handler_field_serialized.inc, line 18

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'],
    '#process' => array(
      'views_process_dependency',
    ),
    '#dependency' => array(
      'edit-options-format' => array(
        'key',
      ),
    ),
  );
}