function views_handler_field_serialized::options_form

Same name in other branches
  1. 7.x-3.x handlers/views_handler_field_serialized.inc \views_handler_field_serialized::options_form()

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',
            ),
        ),
    );
}