You are here

function views_handler_field_computing_json::options_form in Drupal Computing 7.2

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

Overrides views_handler_field_serialized::options_form

File

./computing.views.inc, line 84

Class

views_handler_field_computing_json

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['format']['#type'] = 'radios';
  unset($form['format']['#description']);
  $form['format']['#options']['unserialized'] = t('Pretty JSON object');
  $form['format']['#options']['serialized'] = t('Raw JSON string (Full)');
  $form['format']['#options']['trimmed'] = t('Raw JSON string (Trimmed)');
  $form['format']['unserialized']['#description'] = t('Display JSON object in Krumo if installed, or show data in array.');
  $form['format']['serialized']['#description'] = t('Display the raw encoded JSON string in full length.');
  $form['format']['trimmed']['#description'] = t('Display the first 100 characters of the raw JSON encoded string.');

  //$form['format']['#attached']['css'] = array('.views-field .krumo-footnote { display: none; }', array('type' => 'inline'));

  // we won't allow 'key' options.
  unset($form['format']['#options']['key']);
}