You are here

function mediafront_preset_get_presets in MediaFront 6

Same name and namespace in other branches
  1. 6.2 includes/mediafront.preset.inc \mediafront_preset_get_presets()
  2. 7.2 includes/mediafront.preset.inc \mediafront_preset_get_presets()
  3. 7 includes/mediafront.preset.inc \mediafront_preset_get_presets()

Gets a list of all presets.

7 calls to mediafront_preset_get_presets()
mediafront_features_export_options in includes/mediafront.features.inc
Implementation of hook_features_export_options().
mediafront_field_formatter_info in ./mediafront_field.inc
Implementation of hook_field_formatter_info().
mediafront_presets_overview in includes/mediafront.preset.inc
Menu callback: MediaFront Module administration.
mediafront_preset_form in includes/mediafront.preset.inc
mediafront_preset_select_form in ./mediafront.module
Define the preset form selection.

... See full list

File

includes/mediafront.preset.inc, line 567

Code

function mediafront_preset_get_presets() {
  $presets = array();
  $normal_presets = array();

  // Get all the presets from the database.
  $result = db_query("SELECT * FROM {mediafront_preset} ORDER BY name ASC");
  while ($preset = db_fetch_array($result)) {
    $preset = (array) $preset;
    $preset['connect'] = $preset['connect'] ? unserialize($preset['connect']) : array();
    $preset['settings'] = $preset['settings'] ? unserialize($preset['settings']) : array();
    $presets[$preset['pid']] = $preset;
    $normal_presets[$preset['name']] = $preset['pid'];
  }

  // Now allow other modules to add their default presets.
  foreach (mediafront_preset_get_default_presets() as $preset) {
    if (!empty($preset['name']) && !isset($normal_presets[$preset['name']])) {
      $presets[$preset['name']] = $preset;
    }
  }
  return $presets;
}