You are here

function jw_player_preset_load in JW Player 7

Same name and namespace in other branches
  1. 7.2 jw_player.module \jw_player_preset_load()

Load the given preset(s).

Parameters

string $machine_name:

Return value

array

3 calls to jw_player_preset_load()
jw_player_field_formatter_settings_form in ./jw_player.module
Implements hook_field_formatter_settings_form().
jw_player_field_formatter_settings_summary in ./jw_player.module
Implements hook_field_formatter_settings_summary().
template_preprocess_jw_player in ./jw_player.module
Process variables for jw_player.tpl.php.
1 string reference to 'jw_player_preset_load'
jw_player_ctools_export_ui_form in plugins/export_ui/jw_player_ctools_export_ui.inc
Implements hook_ctools_export_ui_form().

File

./jw_player.module, line 230
Adds a theme function which allows theme developers to use the JW Player.

Code

function jw_player_preset_load($machine_name = NULL) {
  ctools_include('export');
  if (isset($machine_name)) {
    $items = ctools_export_crud_load('jwplayer_preset', $machine_name);

    // CTools returns an object, so we explictly typecast it to array before
    // returning.
    return $items = (array) $items;
  }
  else {
    $result = ctools_export_crud_load_all('jwplayer_preset');
    if (!empty($result)) {
      foreach ($result as $key => $item) {
        $items[$key] = (array) $item;
      }
      return $items;
    }
  }
}