function jplayer_style_plugin::validate in jPlayer 7.2
Same name and namespace in other branches
- 6 includes/jplayer_style_plugin.inc \jplayer_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/
jplayer_style_plugin.inc, line 73 - Display style plugin for Views that renders rows as a jPlayer playlist.
Class
- jplayer_style_plugin
- Style plugin to display a jPlayer playlist.
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 jPlayer 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 jPlayer display style requires being configured so that at least one field is selected to provide a file path.');
}
return $errors;
}