You are here

function swftools_flowplayer3_profile_form in SWF Tools 6.3

1 call to swftools_flowplayer3_profile_form()
swftools_flowplayer3_admin_settings in flowplayer3/swftools_flowplayer3.admin.inc
Menu callback for the Flowplayer 3 settings form.
1 string reference to 'swftools_flowplayer3_profile_form'
swftools_flowplayer3_swftools_methods in flowplayer3/swftools_flowplayer3.module
Implementation of hook_swftools_methods().

File

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

Code

function swftools_flowplayer3_profile_form($profile = '') {

  // Retrieve combination of default and saved settings
  $saved_settings = _swftools_flowplayer3_settings($profile);

  // Retrieve options needed to populate select elements
  $options = _swftools_flowplayer3_options();

  // Initialise array to hold form
  $form = array();

  // Add color scheme form
  $form['color'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Color scheme'),
    '#weight' => -1,
    '#attributes' => array(
      'id' => 'swftools_flowplayer3_scheme_form',
    ),
    '#theme' => 'swftools_flowplayer3_scheme_form',
  );
  $form['color'] += swftools_flowplayer3_scheme_form($form_state, $profile);

  // Initialise tree from this point forward as want to store arrays
  $form['swftools_flowplayer3']['#tree'] = TRUE;

  // Clip settings
  $form['swftools_flowplayer3']['clip'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Overall clip properties'),
  );
  $form['swftools_flowplayer3']['clip']['autoPlay'] = array(
    '#type' => 'radios',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['clip']['autoPlay'],
    '#title' => t('Auto play'),
    '#description' => t('When enabled the player will being playback immediately after it has finished loading.'),
  );
  $form['swftools_flowplayer3']['clip']['autoBuffering'] = array(
    '#type' => 'radios',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['clip']['autoBuffering'],
    '#title' => t('Auto buffering'),
    '#description' => t('When enabled loading of clip into the player\'s memory will begin as soon as the player is loaded on the page.'),
  );
  $form['swftools_flowplayer3']['clip']['scaling'] = array(
    '#type' => 'radios',
    '#options' => $options['scaling'],
    '#default_value' => $saved_settings['clip']['scaling'],
    '#title' => t('Scaling'),
    '#description' => t('This determines how a video clip should be scaled if it is bigger than the player canvas.'),
  );
  $form['swftools_flowplayer3']['clip']['start'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['clip']['start'],
    '#title' => t('Start'),
    '#description' => t('Specify start point for playback (only works with a streaming server). Streaming support not yet in place for SWF Tools.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['clip']['duration'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['clip']['duration'],
    '#title' => t('Duration'),
    '#description' => t('The time (in seconds) for which a video clip should be played until playback ceases.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['clip']['accelerated'] = array(
    '#type' => 'radios',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['clip']['accelerated'],
    '#title' => t('Acceleration'),
    '#description' => t('When enabled browsers using Flash 9 or higher will use hardware-accelerated full screen mode.'),
  );
  $form['swftools_flowplayer3']['clip']['bufferLength'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['clip']['bufferLength'],
    '#title' => t('Buffer length'),
    '#description' => t('The amount of video data (in seconds) which should be loaded into Flowplayer\'s memory in advance of playback commencing. '),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['clip']['provider'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['clip']['provider'],
    '#title' => t('Provider'),
    '#description' => t('Not sure if this will be supported in this module. Need to investigate.'),
  );
  $form['swftools_flowplayer3']['clip']['fadeInSpeed'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['clip']['fadeInSpeed'],
    '#title' => t('Fade in speed'),
    '#description' => t('Time in milliseconds to fade from zero to full opacity upon commencement of video playback.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['clip']['fadeOutSpeed'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['clip']['fadeOutSpeed'],
    '#title' => t('Fade out speed'),
    '#description' => t('Time in milliseconds to fade from full to zero opacity upon completion of video playback.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['clip']['linkUrl'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['clip']['linkUrl'],
    '#title' => t('Link url'),
    '#description' => t('The URL to direct users to when clicking the video screen.'),
  );
  $form['swftools_flowplayer3']['clip']['linkWindow'] = array(
    '#type' => 'radios',
    '#options' => $options['linkWindow'],
    '#default_value' => $saved_settings['clip']['linkWindow'],
    '#title' => t('Link window'),
    '#description' => t('This determines where the url defined by the linkUrl setting will open.'),
  );
  $form['swftools_flowplayer3']['clip']['live'] = array(
    '#type' => 'radios',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['clip']['live'],
    '#title' => t('Live'),
    '#description' => t('RTMP streaming servers support live streaming, which means that it is possible to setup a video camera or other live video source to stream live video data to Flowplayer. If you have an RTMP server which is providing a live video stream, you should set this property to enabled. Streaming support not yet in place for SWF Tools.'),
  );
  $form['swftools_flowplayer3']['clip']['cuePointMultiplier'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['clip']['cuePointMultiplier'],
    '#title' => t('Cue point multiplier'),
    '#description' => t('The times of embedded cuepoints are multiplied by this value before being used. Some encoding tools embed cuepoints in seconds but Flowplayer processes cuepoints in milliseconds. Note that the times are also rounded to the nearest 100 milliseconds. For example, if a file has a cuepoint at 5.535 seconds, the cuepoint is fired at 5500 milliseconds (assuming the default multiplier value of 1000).'),
    '#size' => 8,
  );

  // Control bar settings
  $form['swftools_flowplayer3']['controls'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Controlbar properties'),
  );
  $form['swftools_flowplayer3']['controls']['backgroundGradient'] = array(
    '#type' => 'select',
    '#options' => $options['gradient'],
    '#default_value' => $saved_settings['controls']['backgroundGradient'],
    '#title' => t('Background gradient'),
    '#description' => t('The control bar can be displayed with a fade that runs vertically, or if set to none it will be a flat color.'),
  );
  $form['swftools_flowplayer3']['controls']['progressGradient'] = array(
    '#type' => 'select',
    '#options' => $options['gradient'],
    '#default_value' => $saved_settings['controls']['progressGradient'],
    '#title' => t('Progress gradient'),
    '#description' => t('The progress bar can be displayed with a fade that runs vertically, or if set to none it will be a flat color.'),
  );
  $form['swftools_flowplayer3']['controls']['bufferGradient'] = array(
    '#type' => 'select',
    '#options' => $options['gradient'],
    '#default_value' => $saved_settings['controls']['bufferGradient'],
    '#title' => t('Buffer gradient'),
    '#description' => t('The buffer progress can be displayed with a fade that runs vertically, or if set to none it will be a flat color.'),
  );
  $form['swftools_flowplayer3']['controls']['sliderGradient'] = array(
    '#type' => 'select',
    '#options' => $options['gradient'],
    '#default_value' => $saved_settings['controls']['sliderGradient'],
    '#title' => t('Slider gradient'),
    '#description' => t('The slider can be displayed with a fade that runs vertically, or if set to none it will be a flat color.'),
  );
  $form['swftools_flowplayer3']['controls']['volumeSliderGradient'] = array(
    '#type' => 'select',
    '#options' => $options['gradient'],
    '#default_value' => $saved_settings['controls']['volumeSliderGradient'],
    '#title' => t('Volume slider gradient'),
    '#description' => t('The volume bar can be displayed with a fade that runs vertically, or if set to none it will be a flat color.'),
  );
  $form['swftools_flowplayer3']['controls']['autoHide'] = array(
    '#type' => 'select',
    '#options' => $options['autoHide'],
    '#default_value' => $saved_settings['controls']['autoHide'],
    '#title' => t('Hide control bar'),
    '#description' => t('Specifies whether the controlbar should be hidden when the user is not actively using the player.'),
  );
  $form['swftools_flowplayer3']['controls']['play'] = array(
    '#type' => 'select',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['controls']['play'],
    '#title' => t('Play button'),
    '#description' => t('When enabled the play button will be shown. When disabled it will be hidden.'),
  );
  $form['swftools_flowplayer3']['controls']['volume'] = array(
    '#type' => 'select',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['controls']['volume'],
    '#title' => t('Volume button'),
    '#description' => t('When enabled the volume button will be shown. When disabled it will be hidden.'),
  );
  $form['swftools_flowplayer3']['controls']['mute'] = array(
    '#type' => 'select',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['controls']['mute'],
    '#title' => t('Mute button'),
    '#description' => t('When enabled the mute button will be shown. When disabled it will be hidden.'),
  );
  $form['swftools_flowplayer3']['controls']['time'] = array(
    '#type' => 'select',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['controls']['time'],
    '#title' => t('Time display'),
    '#description' => t('When enabled the timer will be shown. When disabled it will be hidden.'),
  );
  $form['swftools_flowplayer3']['controls']['stop'] = array(
    '#type' => 'select',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['controls']['stop'],
    '#title' => t('Stop button'),
    '#description' => t('When enabled the stop button will be shown. When disabled it will be hidden.'),
  );
  $form['swftools_flowplayer3']['controls']['playlist'] = array(
    '#type' => 'select',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['controls']['playlist'],
    '#title' => t('Playlist buttons'),
    '#description' => t('When enabled the playlist buttons will be shown. When disabled they will be hidden. These buttons will allow navigation through the playlist entries that have been configured for the player. These buttons are always hidden if there are less than two entries in the playlist.'),
  );
  $form['swftools_flowplayer3']['controls']['fullscreen'] = array(
    '#type' => 'select',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['controls']['fullscreen'],
    '#title' => t('Fullscreen button'),
    '#description' => t('When enabled the full screen button will be shown. When disabled it will be hidden. Note that to enabled full screen playback the flash settings must also be set to allow full screen, otherwise the button will not work.'),
  );
  $form['swftools_flowplayer3']['controls']['scrubber'] = array(
    '#type' => 'select',
    '#options' => $options['enabled'],
    '#default_value' => $saved_settings['controls']['scrubber'],
    '#title' => t('Scrubber'),
    '#description' => t('The scrubber is the timeline/playhead combination. This specifies whether it should be visible.'),
  );
  $form['swftools_flowplayer3']['controls']['borderRadius'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['controls']['borderRadius'],
    '#title' => t('Border radius'),
    '#description' => t('Specifies the amount of rounding for the control bar. Larger values mean more rounding.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['controls']['scrubberHeightRatio'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['controls']['scrubberHeightRatio'],
    '#title' => t('Scrubber height ratio'),
    '#description' => t('How much the scrubber handle should take of the controlbar total height. A value of 1.0 means that the scrubber handle takes the entire available height in the controlbar plugin.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['controls']['scrubberBarHeightRatio'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['controls']['scrubberBarHeightRatio'],
    '#title' => t('Scrubber bar height ratio'),
    '#description' => t('The ratio between the scrubber bar and the scrubber handle. A value of 1.0 means that the scrubber bar\'s height is the same as the handle\'s height.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['controls']['volumeSliderHeightRatio'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['controls']['volumeSliderHeightRatio'],
    '#title' => t('Volume slider height ratio'),
    '#description' => t('How much the volume slider handle should take of the controlbar total height.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['controls']['volumeBarHeightRatio'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['controls']['volumeBarHeightRatio'],
    '#title' => t('Volume bar height ratio'),
    '#description' => t('The ratio between the volume bar and the voume slider handle. A value of 1.0 means that the bar\'s height is the same as the handle\'s height.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['controls']['timeBgHeightRatio'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['controls']['timeBgHeightRatio'],
    '#title' => t('Time background height ratio'),
    '#description' => t('How much the time/duration display should take of the controlbar total height. A value of 1.0 means that it takes the entire available height of the controlbar plugin.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['controls']['hideDelay'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['controls']['hideDelay'],
    '#title' => t('Hide delay'),
    '#description' => t('The delay in milliseconds before the controlbar is automatically hidden. The timer starts over again when the user stops moving the mouse or moves the mouse out of the player. Specifying 0 here causes the controlbar to hide immediately.'),
    '#size' => 8,
  );

  // Canvas settings
  $form['swftools_flowplayer3']['canvas'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Canvas properties'),
  );
  $form['swftools_flowplayer3']['canvas']['height'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['canvas']['height'],
    '#title' => t('Height'),
    '#description' => t('The height of the player in pixels.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['canvas']['width'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['canvas']['width'],
    '#title' => t('Width'),
    '#description' => t('The width of the player in pixels.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['canvas']['backgroundImage'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['canvas']['backgroundImage'],
    '#title' => t('Background image'),
    '#description' => t('The absolute or relative path to the image that should be used as the background to this plugin. Supported formats are GIF, JPEG and PNG. The syntax is similar to CSS in that you must enclose your path inside a url() wrapper.'),
    '#size' => 24,
  );
  $form['swftools_flowplayer3']['canvas']['backgroundRepeat'] = array(
    '#type' => 'select',
    '#options' => $options['backgroundRepeat'],
    '#default_value' => $saved_settings['canvas']['backgroundRepeat'],
    '#title' => t('Background repeat'),
    '#description' => t('Default is "repeat", which makes the background image repeat both horizontally and vertically. "no-repeat" displays the background image only once from the top left-hand corner.'),
  );
  $form['swftools_flowplayer3']['canvas']['backgroundGradient'] = array(
    '#type' => 'select',
    '#options' => $options['gradient'],
    '#default_value' => $saved_settings['canvas']['backgroundGradient'],
    '#title' => t('Background gradient'),
    '#description' => t('Gradient setting for the canvas.'),
  );
  $form['swftools_flowplayer3']['canvas']['border'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['canvas']['border'],
    '#title' => t('Border'),
    '#description' => t('Draws a border around a plugin\'s edges. The syntax follows the CSS standard: width style color. For example: "1px solid #cccccc". The only supported style currently is "solid", but the width and colour can be set to any valid value.'),
    '#size' => 24,
  );
  $form['swftools_flowplayer3']['canvas']['borderRadius'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['canvas']['borderRadius'],
    '#title' => t('Border radius'),
    '#description' => t('Specifies the amount of rounding for each corner. Larger values mean more rounding.'),
    '#size' => 8,
  );

  // Play button configuration
  $form['swftools_flowplayer3']['play'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Play button properties'),
  );
  $form['swftools_flowplayer3']['play']['url'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['play']['url'],
    '#title' => t('Button url'),
    '#description' => t('A relative path to the play button, which can be a JPG, PNG or SWF file. Note that the button can only be changed in the commercial versions of Flowplayer.'),
    '#size' => 24,
  );
  $form['swftools_flowplayer3']['play']['opacity'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['play']['opacity'],
    '#title' => t('Opacity'),
    '#description' => t('Opacity (0.0-1.0)'),
    '#size' => 5,
  );
  $form['swftools_flowplayer3']['play']['fadeSpeed'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['play']['fadeSpeed'],
    '#title' => t('Fade speed'),
    '#description' => t('Time in milliseconds for the play button to fade out when the video starts.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['play']['rotateSpeed'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['play']['rotateSpeed'],
    '#title' => t('Rotate speed'),
    '#description' => t('The rotation speed of the buffering animation, in milliseconds.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['play']['height'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['play']['height'],
    '#title' => t('Height'),
    '#description' => t('The height of the play button, either in pixels or as a percentage.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['play']['width'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['play']['width'],
    '#title' => t('Width'),
    '#description' => t('The width of the play button, either in pixels or as a percentage.'),
    '#size' => 8,
  );
  $form['swftools_flowplayer3']['play']['label'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['play']['label'],
    '#title' => t('Label'),
    '#description' => t('Text to display with the play button.'),
    '#size' => 25,
  );
  $form['swftools_flowplayer3']['play']['replayLabel'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['play']['replayLabel'],
    '#title' => t('Replay label'),
    '#description' => t('Text to display with the replay button.'),
    '#size' => 25,
  );

  // Logo configuration
  $form['swftools_flowplayer3']['logo'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Logo properties (commercial players only)'),
    '#description' => t('This section is only relevant if you are using a commercial version of Flowplayer.'),
  );
  $form['swftools_flowplayer3']['logo']['use_logo'] = array(
    '#type' => 'checkbox',
    '#default_value' => $saved_settings['logo']['use_logo'],
    '#title' => t('Use logo settings'),
    '#description' => t('Check this option to pass the logo settings to Flowplayer.'),
  );
  $form['swftools_flowplayer3']['logo']['url'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['logo']['url'],
    '#title' => t('URL'),
    '#description' => t('Relative URL of logo image.'),
    '#size' => 100,
  );
  $form['swftools_flowplayer3']['logo']['displayTime'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['logo']['displayTime'],
    '#title' => t('Display time'),
    '#description' => t('mSecs to display logo.'),
    '#size' => 5,
  );
  $form['swftools_flowplayer3']['logo']['fadeSpeed'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['logo']['fadeSpeed'],
    '#title' => t('Fade speed'),
    '#description' => t('Logo fade to opacity 0 speed.'),
    '#size' => 5,
  );
  $form['swftools_flowplayer3']['logo']['opacity'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['logo']['opacity'],
    '#title' => t('Opacity'),
    '#description' => t('Opacity (0.0-1.0)'),
    '#size' => 5,
  );
  $form['swftools_flowplayer3']['logo']['top'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['logo']['top'],
    '#title' => t('Top offset'),
    '#description' => t('Logo position from top.'),
    '#size' => 5,
  );
  $form['swftools_flowplayer3']['logo']['right'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['logo']['right'],
    '#title' => t('Right offset'),
    '#description' => t('Logo position from right.'),
    '#size' => 5,
  );
  $form['swftools_flowplayer3']['logo']['width'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['logo']['width'],
    '#title' => t('Width'),
    '#description' => t('Logo width.'),
    '#size' => 5,
  );
  $form['swftools_flowplayer3']['logo']['height'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['logo']['height'],
    '#title' => t('Height'),
    '#description' => t('Logo height.'),
    '#size' => 5,
  );
  $form['swftools_flowplayer3']['logo']['zIndex'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['logo']['zIndex'],
    '#title' => t('Z-order'),
    '#description' => t('Logo z-order - just leave it as is.'),
    '#size' => 5,
  );
  $form['swftools_flowplayer3']['logo']['fullscreenOnly'] = array(
    '#type' => 'select',
    '#options' => $options['bool'],
    '#default_value' => $saved_settings['logo']['fullscreenOnly'],
    '#title' => t('Fullscreen only'),
    '#description' => t('When set to true the logo is only shown when fullscreen.'),
  );
  $form['swftools_flowplayer3']['logo']['linkUrl'] = array(
    '#type' => 'textfield',
    '#default_value' => $saved_settings['logo']['linkUrl'],
    '#title' => t('Link URL'),
    '#description' => t('URL to open if the logo is clicked.'),
    '#size' => 100,
  );
  $form['swftools_flowplayer3']['logo']['linkWindow'] = array(
    '#type' => 'select',
    '#options' => $options['linkWindow'],
    '#default_value' => $saved_settings['logo']['linkWindow'],
    '#title' => t('Link window'),
    '#description' => t('Where should the URL open when the logo is clicked.'),
  );
  $form['swftools_flowplayer3']['accessibility'] = array(
    '#type' => 'fieldset',
    '#title' => t('Accessibility'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['swftools_flowplayer3']['accessibility']['accessible'] = array(
    '#type' => 'radios',
    '#options' => $options['accessible'],
    '#default_value' => $saved_settings['accessibility']['accessible'],
    '#title' => t('Accessible controls'),
    '#description' => t('This option can be used to enable accessible controls to allow the player to operated via accessible links. The links can be enabled but hidden (but they will be accessible to screen readers), or they can be enabled and displayed below the player.'),
  );
  $form['swftools_flowplayer3']['playlists'] = array(
    '#type' => 'fieldset',
    '#title' => t('Playlists'),
    '#description' => t('Flowplayer 3 uses a JavaScript mechanism to add playlists to the page. This code is currently under active development and is not fully implemented, but it has some basic functionality.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['swftools_flowplayer3']['playlists']['playlist'] = array(
    '#type' => 'radios',
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Enabled'),
    ),
    '#default_value' => $saved_settings['playlists']['playlist'],
    '#title' => t('Create playlist'),
    '#description' => t('Playlists are output to the left of the player. This features requires that Flowplayer 3 embedding is used. This is enabled in the <a href="!url">global Flowplayer 3 settings</a>.', array(
      '!url' => url('admin/settings/swftools/flowplayer3'),
    )),
  );
  $form['swftools_flowplayer3']['playlists']['scrollable'] = array(
    '#type' => 'radios',
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Enabled'),
    ),
    '#default_value' => $saved_settings['playlists']['scrollable'],
    '#title' => t('Scrollable playlist'),
    '#description' => t('This feature requires the <a href="http://drupal.org/project/jquery_update">jQuery update</a> module to be installed. The tools.scrollable.js script must also be enabled on the <a href="!url">global Flowplayer 3 settings</a>.', array(
      '!url' => url('admin/settings/swftools/flowplayer3'),
    )),
    '#disabled' => !swftools_flowplayer3_jquery_ok(),
  );
  $form['swftools_flowplayer3']['playlists']['images'] = array(
    '#type' => 'radios',
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Enabled'),
    ),
    '#default_value' => $saved_settings['playlists']['images'],
    '#title' => t('Thumbnails'),
    '#description' => t('Whether to include thumbnail images in the playlist.'),
  );
  $form['swftools_flowplayer3']['playlists']['style'] = array(
    '#type' => 'radios',
    '#options' => array(
      'gray' => t('Gray'),
      'petrol' => t('Petrol'),
    ),
    '#default_value' => $saved_settings['playlists']['style'],
    '#title' => t('Playlist style'),
    '#description' => t('The default playlist offers two color variants. If a customised playlist template is created then this setting may have no effect.'),
  );
  $form['swftools_flowplayer3']['playlists']['fillemptyimages'] = array(
    '#type' => 'radios',
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Enabled'),
    ),
    '#default_value' => $saved_settings['playlists']['fillemptyimages'],
    '#title' => t('Fill empty images'),
    '#description' => t('When enabled then elements in a playlist that do not have a thumbnail will be assigned a default one of a single pixel gif.'),
  );

  // If imagecache is available show options, otherwise just store the current values
  if (module_exists('imagecache')) {
    $form['swftools_flowplayer3']['imagecache'] = array(
      '#type' => 'fieldset',
      '#title' => t('Image cache'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $options = array(
      SWFTOOLS_UNDEFINED => t('None'),
    );
    foreach (imagecache_presets() as $preset) {
      $options[$preset['presetname']] = $preset['presetname'];
    }
    $form['swftools_flowplayer3']['imagecache']['imagecache_player'] = array(
      '#type' => 'select',
      '#title' => t('Player splash images'),
      '#default_value' => $saved_settings['imagecache']['imagecache_player'],
      '#options' => $options,
      '#description' => t('Select the image cache preset that should be applied to images used as a splash image in the player.'),
    );
    $form['swftools_flowplayer3']['imagecache']['imagecache_playlist'] = array(
      '#type' => 'select',
      '#title' => t('Playlist thumbnails'),
      '#default_value' => $saved_settings['imagecache']['imagecache_playlist'],
      '#options' => $options,
      '#description' => t('Select the image cache preset that should be applied to thumbanils used in playlists.'),
    );
  }
  else {
    $form['swftools_flowplayer3']['imagecache']['imagecache_player'] = array(
      '#type' => 'value',
      '#value' => $saved_settings['imagecache']['imagecache_player'],
    );
    $form['swftools_flowplayer3']['imagecache']['imagecache_playlist'] = array(
      '#type' => 'value',
      '#value' => $saved_settings['imagecache']['imagecache_playlist'],
    );
  }

  // Return finished form
  return $form;
}