function videojs_style_plugin::validate in Video.js (HTML5 Video Player) 7
Same name and namespace in other branches
- 6.2 includes/videojs_style_plugin.inc \videojs_style_plugin::validate()
- 6 includes/videojs_style_plugin.inc \videojs_style_plugin::validate()
Validate that the plugin is correct and can be saved.
Return value
array An array of error strings to tell the user what is wrong with this plugin.
Overrides views_plugin_style::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;
}