function mediafront_preset_name_exists in MediaFront 7
Same name and namespace in other branches
- 6.2 includes/mediafront.preset.inc \mediafront_preset_name_exists()
- 6 includes/mediafront.preset.inc \mediafront_preset_name_exists()
- 7.2 includes/mediafront.preset.inc \mediafront_preset_name_exists()
Checks to see if another preset is already taken.
1 call to mediafront_preset_name_exists()
- mediafront_validate_preset_name in includes/
mediafront.preset.inc - Verify the syntax of the given prefix name.
File
- includes/
mediafront.preset.inc, line 626
Code
function mediafront_preset_name_exists($preset_name) {
// Get the default presets.
$default_presets = mediafront_preset_get_default_presets();
// See if there is a default preset name.
if ($default_presets && isset($default_presets[$preset_name])) {
return true;
}
else {
return (bool) db_select('mediafront_preset', 'p')
->fields('p')
->condition('p.name', $preset_name)
->range(0, 1)
->execute()
->fetchField();
}
}