function _imagerotator_flashvars in SWF Tools 6
Same name and namespace in other branches
- 6.2 imagerotator/imagerotator.module \_imagerotator_flashvars()
This function is called from imagerotator_swftools_flashvars() which is called from swf() It will return the default flashvar configuration, just prior to any overrides passed into swf(). We start with the settings defined on admin/swf/imagerotator which are returned by _imagerotator_settings(). Then we prepare these values for output to html (eg. '1' become 'true') and we unset undefined flashvars to prevent their output.
1 call to _imagerotator_flashvars()
- imagerotator_swftools_flashvars in imagerotator/
imagerotator.module - Implementation of swftools_flashvars hook. Return an array of flashvars.
File
- imagerotator/
imagerotator.module, line 146
Code
function _imagerotator_flashvars($this_player) {
// Cache this.
static $flashvars = array();
if (!count($flashvars)) {
// Media Player
foreach (array(
WIJERING_IMAGEROTATOR,
) as $player) {
// Get saved settings for this method.
$defaults = _imagerotator_settings($player);
foreach ($defaults as $category => $vars) {
foreach ($vars as $key => $setting) {
if (!$setting || $setting == 'default') {
unset($defaults[$category][$key]);
}
else {
switch ($category) {
case 'color':
$defaults['color'][$key] = str_replace('#', '0x', $defaults['color'][$key]);
break;
case 'boolean':
$defaults['boolean'][$key] = _swftools_tf($defaults['boolean'][$key]);
break;
}
}
}
}
// Not the same as width/height. This determines the extended width OR height
// past the main view area where the actual playlist file names can be found.
// Setting both together is not supported.
if ($defaults['integer']['displaywidth']) {
unset($defaults['integer']['displayheight']);
}
else {
unset($defaults['integer']['displaywidth']);
}
$flashvars[$player] = $defaults;
}
}
return $flashvars[$this_player];
}