You are here

function jplayer_settings_form in jPlayer 6

Same name and namespace in other branches
  1. 7.2 includes/jplayer.admin.inc \jplayer_settings_form()

Menu callback; Provides the jPlayer settings form.

1 string reference to 'jplayer_settings_form'
jplayer_menu in ./jplayer.module
Implementation of hook_menu().

File

includes/jplayer.admin.inc, line 11
Administrative pages for the jPlayer module.

Code

function jplayer_settings_form() {
  $form = array();
  $form['jplayer_directory'] = array(
    '#type' => 'textfield',
    '#title' => t('jPlayer file directory'),
    '#default_value' => variable_get('jplayer_directory', 'sites/all/libraries/jplayer'),
    '#description' => t('Specify the path that contains the jPlayer library. The jplayer.player.min.js file should be in the root of this directory.'),
  );
  $form['options'] = array(
    '#type' => 'fieldset',
    '#title' => t('jPlayer options'),
    '#collapsible' => FALSE,
  );
  $form['options']['jplayer_autoplay'] = array(
    '#type' => 'checkbox',
    '#title' => t('Auto-play files on page load'),
    '#description' => t('Use caution when combining this option with multiple players on the same page.'),
    '#default_value' => variable_get('jplayer_autoplay', ''),
  );
  $form['options']['jplayer_pause_others'] = array(
    '#type' => 'checkbox',
    '#title' => t('Pause other jPlayers'),
    '#description' => t('Prevents multiple jPlayers from playing at once on a single page. If a second player is started, the current player is paused.'),
    '#default_value' => variable_get('jplayer_pause_others', FALSE),
  );
  $form = system_settings_form($form);
  $form['#validate'][] = 'jplayer_settings_form_validate';
  $form['#submit'][] = 'jplayer_settings_form_submit';
  return $form;
}