You are here

function videojs_style_plugin::options_form in Video.js (HTML5 Video Player) 6

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

File

includes/videojs_style_plugin.inc, line 21
Display style plugin for Views that renders rows as a Video.js.

Class

videojs_style_plugin
Style plugin to display a Video.js.

Code

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

  // Build a list of all fields.
  $options = array();
  foreach ($this->display->handler
    ->get_handlers('field') as $field => $handler) {
    if ($label = $handler
      ->label()) {
      $options[$field] = $label;
    }
    else {
      $options[$field] = $handler
        ->ui_name();
    }
  }
  if (empty($options)) {
    $options[''] = t('No available fields');
  }
  $form['path_field'] = array(
    '#type' => 'select',
    '#title' => t('File path fields'),
    '#options' => $options,
    '#multiple' => TRUE,
    '#size' => 4,
    '#default_value' => $this->options['path_field'],
    '#description' => t('Select the fields that will contain a file path to an video file. If multiple fields are selected, the first one that contains a value will be used. This field will not be visible in the view unless there are no other fields visible'),
    '#weight' => -5,
  );
}