You are here

function swftools_flowplayer3_admin_settings in SWF Tools 6.3

Menu callback for the Flowplayer 3 settings form.

1 string reference to 'swftools_flowplayer3_admin_settings'
swftools_flowplayer3_menu in flowplayer3/swftools_flowplayer3.module
Implementation of hook_menu().

File

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

Code

function swftools_flowplayer3_admin_settings() {

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

  // Fetch form definition from the profile as our start point
  $form = swftools_flowplayer3_profile_form();

  // Player path
  $form['swftools_flowplayer3_files'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Player and plugin files'),
  );
  $form['swftools_flowplayer3_files']['swftools_flowplayer3_file'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('swftools_flowplayer3_file', SWFTOOLS_FLOWPLAYER3_FILE),
    '#title' => t('Player file'),
    '#description' => t('Specify the name of the player file - with Flowplayer 3 this typically changes with each new release.'),
    '#size' => 50,
    '#autocomplete_path' => 'admin/settings/swftools/flowplayer3/autocomplete',
  );
  $form['swftools_flowplayer3_files']['swftools_flowplayer3_stream_plugin'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('swftools_flowplayer3_stream_plugin', SWFTOOLS_FLOWPLAYER3_STREAM_PLUGIN),
    '#title' => t('RTMP streaming plugin'),
    '#description' => t('Specify the name of the rtmp streaming plugin.'),
    '#size' => 50,
    '#autocomplete_path' => 'admin/settings/swftools/flowplayer3/autocomplete',
  );
  $form['swftools_flowplayer3_files']['swftools_flowplayer3_javascript'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('swftools_flowplayer3_javascript', SWFTOOLS_FLOWPLAYER3_JAVASCRIPT),
    '#title' => t('Embedding script'),
    '#description' => t('The path to the Flowplayer 3 embedding script, if Flowplayer 3 embedding is enabled. When downloaded from flowplayer.org the script file is in a subdirectory <em>example</em> so a relative path may be needed when setting this value.'),
    '#size' => 50,
    '#autocomplete_path' => 'admin/settings/swftools/flowplayer3/autocomplete',
  );
  $form['swftools_flowplayer3_files']['swftools_flowplayer3_scrollable_javascript'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('swftools_flowplayer3_scrollable_javascript', SWFTOOLS_FLOWPLAYER3_SCROLLABLE_JAVASCRIPT),
    '#title' => t('Scrollable script'),
    '#description' => t('The path to the Flowplayer 3 tools.scrollable script.'),
    '#size' => 50,
    '#autocomplete_path' => 'admin/settings/swftools/flowplayer3/autocomplete',
  );
  $form['swftools_flowplayer3_files']['swftools_flowplayer3_controls'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('swftools_flowplayer3_controls', ''),
    '#title' => t('Controls'),
    '#description' => t('The path to the Flowplayer 3 controls plug-in. Leave blank to use the default.'),
    '#size' => 50,
    '#autocomplete_path' => 'admin/settings/swftools/flowplayer3/autocomplete',
  );
  $form['swftools_flowplayer3_files']['swftools_flowplayer3_product_key'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('swftools_flowplayer3_product_key', ''),
    '#title' => t('Product key'),
    '#description' => t('Enter your product key if you are using the commercial version of Flowplayer 3.'),
    '#size' => 50,
  );

  // Embedding setting
  $form['swftools_flowplayer3_embedding'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Flowplayer 3 embedding'),
  );
  $form['swftools_flowplayer3_embedding']['swftools_flowplayer3_embed'] = array(
    '#type' => 'radios',
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Enabled'),
    ),
    '#default_value' => variable_get('swftools_flowplayer3_embed', 0),
    '#title' => t('Flowplayer 3 embedding'),
    '#description' => t('When enabled the default embedding method wil be over-ridden and the Flowplayer 3 embedding script will be used. The script file must be installed and the correct path added in <em>Player and plugin files</em> above.'),
  );
  $form['swftools_flowplayer3_embedding']['swftools_flowplayer3_load'] = array(
    '#type' => 'radios',
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Enabled'),
    ),
    '#default_value' => variable_get('swftools_flowplayer3_load', 1),
    '#title' => t('Load Flowplayers immediately'),
    '#description' => t('If this setting is disabled then Flowplayers will not load until the container content is clicked. This feature requires Flowplayer 3 embedding to be enabled.'),
  );
  $form['swftools_flowplayer3_embedding']['swftools_flowplayer3_scrollable_script'] = array(
    '#type' => 'radios',
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Enabled'),
    ),
    '#default_value' => variable_get('swftools_flowplayer3_scrollable_script', 0),
    '#title' => t('tools.scrollable.js'),
    '#description' => t('This must be enabled in order to allow scrollable playlists to be used. This feature requires the <a href="http://drupal.org/project/jquery_update">jQuery update</a> module to be installed.', array(
      '!url' => url('admin/settings/swftools/flowplayer3'),
    )),
    '#disabled' => !swftools_flowplayer3_jquery_ok(),
  );

  // Add custom form handler to flush cache upon submit
  $form['#submit'][] = 'swftools_admin_settings_submit';

  // Return finished form
  return system_settings_form($form);
}