You are here

function mediafront_handler_field_player::options_form in MediaFront 6

Same name and namespace in other branches
  1. 6.2 views/mediafront_handler_field_player.inc \mediafront_handler_field_player::options_form()
  2. 7 views/mediafront_handler_field_player.inc \mediafront_handler_field_player::options_form()

Provide link to the page being visited.

File

views/mediafront_handler_field_player.inc, line 26

Class

mediafront_handler_field_player
Field handler to provide simple renderer that turns a URL into a clickable link.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $fields = array(
    '' => t('<None>'),
  );
  foreach ($this->view->display_handler
    ->get_handlers('field') as $field => $handler) {
    if (strpos($field, 'mediafront_player') === FALSE) {
      if ($label = $handler
        ->label()) {
        $fields[$field] = $label;
      }
      else {
        $fields[$field] = $handler
          ->ui_name();
      }
    }
  }
  $form['mediafront'] = array(
    '#type' => 'fieldset',
    '#title' => t('Media Player Settings'),
  );
  $form['mediafront']['preset'] = mediafront_preset_select_form($this->options, 'preset');
  $form['mediafront']['mediawrapper'] = array(
    '#type' => 'fieldset',
    '#title' => t('Media Settings'),
  );
  $form['mediafront']['mediawrapper']['intro'] = array(
    '#type' => 'select',
    '#title' => t('Intro Media Field'),
    '#options' => $fields,
    '#default_value' => $this->options['intro'],
    '#description' => t('The intro is the media that plays before all other media.'),
  );
  $form['mediafront']['mediawrapper']['commercial'] = array(
    '#type' => 'select',
    '#title' => t('Commercial Media Field'),
    '#options' => $fields,
    '#default_value' => $this->options['commercial'],
    '#description' => t('The commercial media will block out all media controls while it is playing.'),
  );
  $form['mediafront']['mediawrapper']['prereel'] = array(
    '#type' => 'select',
    '#title' => t('Pre-reel Media Field'),
    '#options' => $fields,
    '#default_value' => $this->options['prereel'],
    '#description' => t('The pre-reel plays before the main media.'),
  );
  $form['mediafront']['mediawrapper']['media'] = array(
    '#type' => 'select',
    '#title' => t('Main Media Field'),
    '#options' => $fields,
    '#default_value' => $this->options['media'],
    '#description' => t('The main media.'),
  );
  $form['mediafront']['mediawrapper']['postreel'] = array(
    '#type' => 'select',
    '#title' => t('Post-reel Media Field'),
    '#options' => $fields,
    '#default_value' => $this->options['postreel'],
    '#description' => t('The post-reel plays after the main media.'),
  );
  $form['mediafront']['previewwrapper'] = array(
    '#type' => 'fieldset',
    '#title' => t('Image Settings'),
  );
  $form['mediafront']['previewwrapper']['preview'] = array(
    '#type' => 'select',
    '#title' => t('Preview Image Field'),
    '#options' => $fields,
    '#default_value' => $this->options['preview'],
    '#description' => t('The image field to show as the preview image.'),
  );
}