You are here

function getid3_handler_field_duration::options_form in getID3() 7

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

Overrides views_handler_field_numeric::options_form

File

includes/getid3_handler_field_duration.inc, line 24
A special handler that properly formats duration fields as minutes:seconds.

Class

getid3_handler_field_duration
Render a field as a readable value in hours, minutes, and seconds.

Code

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

  // Remove the separator options since we don't need them.
  unset($form['separator']);
  $form['prefix']['#weight'] = 10;
  $form['suffix']['#weight'] = 10;
  $form['format'] = array(
    '#type' => 'select',
    '#title' => t('Time format'),
    '#default_value' => $this->options['format'],
    '#options' => array(
      'default' => t('Default (usually mm:ss)'),
      'hours' => t('Hours: h'),
      'minutes' => t('Minutes: mm'),
      'seconds' => t('Seconds: ss'),
      'total' => t('Total seconds'),
    ),
  );
}