$vars) {
$saved = array_merge($saved, $vars);
}
$options = _wijering4_options();
$form = array();
// Media Player
$form['wijering4_mediaplayer'] = array(
'#type' => 'fieldset',
//'#title' => t('JW FLV Media Player 4 Flashvars'),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#description' => 'These are the settings for Jeroen Wijering\'s FLV Media Player 4.
For details of what each parameter does refer to the '.
l('JW Player for Flash wiki page', 'http://code.jeroenwijering.com/trac/wiki/FlashVars')
.'. It is possible that you do not need to change any of
these settings, blank values will defer to friendly
Media Player defaults. Note that the label in (brackets)
is the actual flashvar name and corresponds to the wiki page.
If content is embedded using the SWF Tools filter then each parameter
can be over-ridden by specifying a new value in the filter string.'
);
$form['wijering4_mediaplayer']['basic'] = array(
'#type' => 'fieldset',
'#title' => t('Basic'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['wijering4_mediaplayer']['basic']['playlistsize'] = array(
'#type' => 'textfield',
'#default_value' => $saved['playlistsize'],
'#size' => 8,
'#maxlength' => 5,
'#title' => t('Playlist size'),
'#description' => t('Leave blank for default. (playlistsize)'),
);
$form['wijering4_mediaplayer']['basic']['height'] = array(
'#type' => 'textfield',
'#default_value' => $saved['height'],
'#size' => 8,
'#maxlength' => 5,
'#title' => t('Height'),
'#description' => t('Leave blank for default. (height)'),
);
$form['wijering4_mediaplayer']['basic']['width'] = array(
'#type' => 'textfield',
'#default_value' => $saved['width'],
'#size' => 8,
'#maxlength' => 5,
'#title' => t('Width'),
'#description' => t('Leave blank for default. (width)'),
);
$form['wijering4_mediaplayer']['color'] = array(
'#type' => 'fieldset',
'#title' => t('Color'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['wijering4_mediaplayer']['color']['backcolor'] = array(
'#type' => 'textfield',
'#default_value' => $saved['backcolor'],
'#size' => 8,
'#maxlength' => 7,
'#title' => t('Background color'),
'#description' => t('Enter a hex value eg. for white enter #FFFFFF. (backcolor)'),
);
$form['wijering4_mediaplayer']['color']['frontcolor'] = array(
'#type' => 'textfield',
'#default_value' => $saved['frontcolor'],
'#size' => 8,
'#maxlength' => 7,
'#title' => t('Text color'),
'#description' => t('Enter a hex value eg. for white enter #FFFFFF. (frontcolor)'),
);
$form['wijering4_mediaplayer']['color']['lightcolor'] = array(
'#type' => 'textfield',
'#default_value' => $saved['lightcolor'],
'#size' => 8,
'#maxlength' => 7,
'#title' => t('Rollover color'),
'#description' => t('Enter a hex value eg. for white enter #FFFFFF. (lightcolor)'),
);
$form['wijering4_mediaplayer']['color']['screencolor'] = array(
'#type' => 'textfield',
'#default_value' => $saved['screencolor'],
'#size' => 8,
'#maxlength' => 7,
'#title' => t('Screen color'),
'#description' => t('Enter a hex value eg. for white enter #FFFFFF. (screencolor)'),
);
$form['wijering4_mediaplayer']['appearance'] = array(
'#type' => 'fieldset',
'#title' => t('Appearance'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['wijering4_mediaplayer']['appearance']['skin'] = array(
'#type' => 'textfield',
'#default_value' => $saved['skin'],
'#title' => t('Skin URL'),
'#description' => t('Full url to a skin for the player. (skin)'),
);
/**
$form['wijering4_mediaplayer']['appearance']['displaywidth'] = array(
'#type' => 'textfield',
'#default_value' => $saved['displaywidth'],
'#size' => 8,
'#maxlength' => 5,
'#title' => t('Display width'),
'#description' => t('Setting this will result in controls along the side and override "Display width". (displaywidth)'),
);
**/
$form['wijering4_mediaplayer']['appearance']['logo'] = array(
'#type' => 'textfield',
'#default_value' => $saved['logo'],
'#title' => t('Logo URL'),
'#description' => t('Full url to logo for a watermark, use PNG files for best results. (logo)'),
);
$form['wijering4_mediaplayer']['appearance']['overstretch'] = array(
'#type' => 'select',
'#default_value' => $saved['overstretch'],
'#title' => t('Overstretch'),
'#options' => $options['overstretch'],
'#description' => t('Defines how to stretch images to fit the display. (overstretch)'),
);
$form['wijering4_mediaplayer']['appearance']['controlbar'] = array(
'#type' => 'select',
'#default_value' => $saved['controlbar'],
'#title' => t('Control bar position'),
'#options' => $options['controlbar'],
'#description' => t('Defines where to position the control bar. (controlbar)'),
);
$form['wijering4_mediaplayer']['appearance']['playlist'] = array(
'#type' => 'select',
'#default_value' => $saved['playlist'],
'#title' => t('Playlist position'),
'#options' => $options['playlist'],
'#description' => t('Defines where to position the playlist. (playlist)'),
);
$form['wijering4_mediaplayer']['playback'] = array(
'#type' => 'fieldset',
'#title' => t('Playback'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['wijering4_mediaplayer']['playback']['autostart'] = array(
'#type' => 'select',
'#options' => $options['bool'],
'#default_value' => $saved['autostart'],
'#title' => t('Autostart'),
'#description' => t('Automatically start playing the media. (autostart)'),
);
$form['wijering4_mediaplayer']['playback']['bufferlength'] = array(
'#type' => 'textfield',
'#default_value' => $saved['bufferlength'],
'#size' => 5,
'#maxlength' => 2,
'#title' => t('Buffer length'),
'#description' => t('Number of seconds of buffering before playing file. (bufferlength)'),
);
$form['wijering4_mediaplayer']['playback']['displayclick'] = array(
'#type' => 'select',
'#default_value' => $saved['displayclick'],
'#title' => t('Display click'),
'#options' => $options['displayclick'],
'#description' => t('Action to take when the player is clicked. (displayclick)'),
);
$form['wijering4_mediaplayer']['playback']['repeat'] = array(
'#type' => 'select',
'#default_value' => $saved['repeat'],
'#title' => t('Repeat'),
'#options' => $options['repeat'],
'#description' => t('Set whether the media repeats after completion. (repeat)'),
);
$form['wijering4_mediaplayer']['playback']['shuffle'] = array(
'#type' => 'select',
'#options' => $options['bool'],
'#default_value' => $saved['shuffle'],
'#title' => t('Shuffle'),
'#description' => t('Shuffle media randomly. (shuffle)'),
);
$form['wijering4_mediaplayer']['playback']['volume'] = array(
'#type' => 'textfield',
'#default_value' => $saved['volume'],
'#size' => 8,
'#maxlength' => 3,
'#title' => t('Volume'),
'#description' => t('Starting volume of the player. (volume)'),
);
$form['wijering4_mediaplayer']['interaction'] = array(
'#type' => 'fieldset',
'#title' => t('Interaction'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['wijering4_mediaplayer']['interaction']['captions'] = array(
'#type' => 'textfield',
'#default_value' => $saved['captions'],
'#title' => t('Captions URL'),
'#description' => t('Full url used to an external textfile with captions. (captions)'),
);
$form['wijering4_mediaplayer']['interaction']['link'] = array(
'#type' => 'textfield',
'#default_value' => $saved['link'],
'#title' => t('Link URL'),
'#description' => t('Web address linked to logo watermark. (link)'),
);
$form['wijering4_mediaplayer']['interaction']['linktarget'] = array(
'#type' => 'select',
'#default_value' => $saved['linktarget'],
'#options' => $options['linktarget'],
'#title' => t('Link target'),
'#description' => t('Target of "Link URL". (linktarget)'),
);
$form['wijering4_mediaplayer']['interaction']['streamscript'] = array(
'#type' => 'textfield',
'#default_value' => $saved['streamscript'],
'#title' => t('Streaming script URL'),
'#description' => t('Full url to \'fake\' streaming script. (streamscript)'),
);
$form['wijering4_mediaplayer']['interaction']['type'] = array(
'#type' => 'select',
'#options' => $options['type'],
'#default_value' => $saved['type'],
'#title' => t('File type'),
'#description' => t('Specify a default filetype, the default setting will auto-detect. (type)'),
);
$form['wijering4_mediaplayer']['interaction']['fullscreen'] = array(
'#type' => 'select',
'#options' => $options['bool'],
'#default_value' => $saved['fullscreen'],
'#title' => t('Allow use of fullscreen'),
'#description' => t('Determine whether to allow fullscreen functionality. (usefullscreen).
Allow full screen mode must also be enabled on the SWF Tools embedding settings page.'),
);
$form['#tree'] = TRUE;
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
return $form;
}
/*
* Called by wijering4_admin_form_submit()
*/
function _wijering4_admin_form_submit($form_id, &$form_values) {
// Flatten settings for saving
$saved = array();
foreach ($form_values AS $player => $settings) {
$flat[$player] = array();
if (is_array($settings)) {
foreach ($settings AS $category => $vars) {
$flat[$player] = array_merge($flat[$player], $vars);
}
variable_set('swftools_'. $player, $flat[$player]);
}
}
// Clear caches
cache_clear_all();
cache_clear_all('*', 'cache_filter', TRUE);
}