function mediafront_get_preset in MediaFront 7
Same name and namespace in other branches
- 6.2 includes/mediafront.preset.inc \mediafront_get_preset()
- 6 includes/mediafront.preset.inc \mediafront_get_preset()
- 7.2 includes/mediafront.preset.inc \mediafront_get_preset()
Get's the preset.
3 calls to mediafront_get_preset()
- mediafront_features_export_render in includes/
mediafront.features.inc - Implementation of hook_features_export_render().
- mediafront_get_player in ./
mediafront.module - Returns a media player.
- mediafront_preset_load in includes/
mediafront.preset.inc - Used for the menu item to load a preset.
File
- includes/
mediafront.preset.inc, line 584
Code
function mediafront_get_preset($preset_name) {
// Get the preset from the database.
$preset = db_select('mediafront_preset', 'p')
->fields('p')
->condition('p.name', $preset_name)
->execute()
->fetchAssoc();
if ($preset) {
$preset['settings'] = $preset['settings'] ? unserialize($preset['settings']) : array();
$preset['connect'] = $preset['connect'] ? unserialize($preset['connect']) : array();
}
else {
// Get all of the default presets.
$default_presets = mediafront_preset_get_default_presets();
// Check to see if this preset exists.
if (isset($default_presets[$preset_name])) {
// Make this our preset
$preset = $default_presets[$preset_name];
}
}
// Return the preset.
return $preset;
}