You are here

function video_get_preset in Video 7

Same name and namespace in other branches
  1. 7.2 modules/video_ui/video.preset.inc \video_get_preset()

Get's the preset.

3 calls to video_get_preset()
video_features_export_render in ./video.features.inc
Implementation of hook_features_export_render().
video_preset::properties in includes/preset.inc
Get the preset properties
video_preset_load in modules/video_ui/video_ui.module
Implementing the special "auto-loader" for menu %video_preset.

File

modules/video_ui/video.preset.inc, line 693

Code

function video_get_preset($preset_name) {

  // Get the preset from the database.
  $preset = db_select('video_preset', 'p')
    ->fields('p')
    ->condition('p.name', $preset_name)
    ->execute()
    ->fetchAssoc();
  if ($preset) {
    $preset['settings'] = $preset['settings'] ? unserialize($preset['settings']) : array();
  }
  else {

    // Get all of the default presets.
    $default_presets = video_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;
}