You are here

class video_views_handler_field_playtime_seconds in Video 6.2

Field handler to display the play length of the video.

Hierarchy

Expanded class hierarchy of video_views_handler_field_playtime_seconds

1 string reference to 'video_views_handler_field_playtime_seconds'
video_views_data in views/video.views.inc
Provides views data and enumerates handlers for video.module

File

views/video_views_handler_field_playtime_seconds.inc, line 16

View source
class video_views_handler_field_playtime_seconds extends views_handler_field {

  /**
   * Define options available for this field.
   */
  function option_definition() {
    $options = parent::option_definition();
    $options['time_type'] = array(
      'default' => 'hms',
    );
    return $options;
  }

  /**
   * Build option configuration form.
   */
  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $form['time_type'] = array(
      '#title' => t('Show playtime as'),
      '#type' => 'select',
      '#options' => array(
        'hms' => t('Hour:min:sec'),
        'sec' => t('Seconds'),
      ),
      '#default_value' => $this->options['time_type'],
    );
  }

  /**
   * Render field output to the browser.
   */
  function render($values) {
    return _video_playtime_seconds($values, $this->options['time_type']);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
video_views_handler_field_playtime_seconds::options_form function Build option configuration form.
video_views_handler_field_playtime_seconds::option_definition function Define options available for this field.
video_views_handler_field_playtime_seconds::render function Render field output to the browser.