You are here

function videojs_style_plugin::validate in Video.js (HTML5 Video Player) 6.2

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

File

includes/videojs_style_plugin.inc, line 52
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 validate() {
  $errors = parent::validate();

  // Ensure that we're using the field row style.
  if (!$this->row_plugin
    ->uses_fields()) {
    $errors[] = t('Display "@display" uses the "@style" row style, but the Video.js display style requires use of the "Fields" row style.', array(
      '@display' => $this->display->display_title,
      '@style' => $this->row_plugin->definition['title'],
    ));
  }

  // Ensure that a file path field is selected.
  if (empty($this->options['path_field'])) {
    $errors[] = t('The Video.js display style requires being configured so that at least one field is selected to provide a file path.');
  }
  return $errors;
}