You are here

function swftools_flowplayer3_get_palette in SWF Tools 6.3

Helper function to retrieve the color palette for a particular style.

Parameters

int $default: (optional) Use one of the following constants:

  • SWFTOOLS_FLOWPLAYER3_DEFAULT_PALETTE
  • SWFTOOLS_FLOWPLAYER_CURRENT_PALETTE

Return value

An array of key/value pairs - the key defines the componenent and the value defines the color.

1 call to swftools_flowplayer3_get_palette()
swftools_flowplayer3_scheme_form in flowplayer3/swftools_flowplayer3.admin.inc
Helper function to produce the color scheme form for the flowplayer

File

flowplayer3/swftools_flowplayer3.admin.inc, line 261
Configuration settings for Flowplayer 3.

Code

function swftools_flowplayer3_get_palette($default = SWFTOOLS_FLOWPLAYER3_CURRENT_PALETTE, $profile = '') {

  // Define palette properties
  $fields = array(
    'backgroundColor',
    'controlbarbackgroundColor',
    'timeColor',
    'durationColor',
    'progressColor',
    'bufferColor',
    'sliderColor',
    'buttonColor',
    'buttonOverColor',
    'volumeSliderColor',
    'timeBgColor',
  );

  // Get the theme information
  $info = swftools_flowplayer3_get_info();

  // Get the keys (strings of colors) from the available schemes
  $keys = array_keys($info['schemes']);

  // Exploded the first (default) string in an array
  foreach (explode(',', array_shift($keys)) as $k => $scheme) {

    // Build a palette
    $palette[$fields[$k]] = $scheme;
  }

  // If default is required, return it, otherwise load palette variable
  return $default ? $palette : swftools_variable_get('swftools_flowplayer3_palette', $palette, $profile);
}