function video_preset_name_exists in Video 7.2
Same name and namespace in other branches
- 7 modules/video_ui/video.preset.inc \video_preset_name_exists()
Checks to see if another preset is already taken.
1 call to video_preset_name_exists()
- video_validate_preset_name in modules/
video_ui/ video.preset.inc - Verify the syntax of the given prefix name.
File
- modules/
video_ui/ video.preset.inc, line 889 - Administrative interface for maintaining video presets.
Code
function video_preset_name_exists($preset_name) {
// Get the default presets.
$default_presets = Preset::getDefaultPresets();
// See if there is a default preset name.
if ($default_presets && isset($default_presets[$preset_name])) {
return TRUE;
}
else {
return (bool) db_select('video_preset', 'p')
->fields('p')
->condition('p.name', $preset_name)
->range(0, 1)
->execute()
->fetchField();
}
}