| 1 |
<?php
|
| 2 |
// $Id: flowplayer.admin.inc,v 1.2 2008/09/07 19:42:14 stuartgreenfield Exp $
|
| 3 |
|
| 4 |
function flowplayer_admin_form() {
|
| 5 |
|
| 6 |
$saved_settings = _flowplayer_settings(FLOWPLAYER_MEDIAPLAYER);
|
| 7 |
|
| 8 |
// Flatten settings for convenience
|
| 9 |
$saved = array();
|
| 10 |
foreach ($saved_settings AS $category => $vars) {
|
| 11 |
$saved = array_merge($saved, $vars);
|
| 12 |
}
|
| 13 |
$options = _flowplayer_options();
|
| 14 |
|
| 15 |
$form = array();
|
| 16 |
|
| 17 |
$form['flowplayer_mediaplayer']['appearance']['player'] = array(
|
| 18 |
'#type' => 'select',
|
| 19 |
'#default_value' => $saved['player'],
|
| 20 |
'#title' => t('FlowPlayer to use'),
|
| 21 |
'#options' => $options['player'],
|
| 22 |
'#description' => t('Defines which FlowPlayer to use.'),
|
| 23 |
);
|
| 24 |
$form['flowplayer_mediaplayer']['appearance']['usePlayOverlay'] = array(
|
| 25 |
'#type' => 'select',
|
| 26 |
'#default_value' => $saved['usePlayOverlay'],
|
| 27 |
'#title' => t('Overlay play control'),
|
| 28 |
'#options' => $options['bool'],
|
| 29 |
'#description' => t('Show a play button at the start of the playlist. (<em>usePlayOverlay</em>)'),
|
| 30 |
);
|
| 31 |
$form['flowplayer_mediaplayer']['appearance']['hideControls'] = array(
|
| 32 |
'#type' => 'select',
|
| 33 |
'#default_value' => $saved['hideControls'],
|
| 34 |
'#title' => t('Hide controls'),
|
| 35 |
'#options' => $options['bool'],
|
| 36 |
'#description' => t('Hide the player controls and progress bar. (<em>hideControls</em>)'),
|
| 37 |
);
|
| 38 |
$form['flowplayer_mediaplayer']['appearance']['controlBarGloss'] = array(
|
| 39 |
'#type' => 'select',
|
| 40 |
'#default_value' => $saved['controlBarGloss'],
|
| 41 |
'#title' => t('Control bar gloss'),
|
| 42 |
'#options' => $options['controlBarGloss'],
|
| 43 |
'#description' => t('Choose the level of \'gloss\' to apply to the control bar. (<em>controlBarGloss</em>)'),
|
| 44 |
);
|
| 45 |
$form['flowplayer_mediaplayer']['appearance']['showFullScreenButton'] = array(
|
| 46 |
'#type' => 'select',
|
| 47 |
'#default_value' => $saved['showFullScreenButton'],
|
| 48 |
'#title' => t('Show full screen button'),
|
| 49 |
'#options' => $options['bool'],
|
| 50 |
'#description' => t('Show a button on the player to allow full screen mode. (<em>showFullScreenButton</em>)'),
|
| 51 |
);
|
| 52 |
$form['flowplayer_mediaplayer']['appearance']['showPlayListButtons'] = array(
|
| 53 |
'#type' => 'select',
|
| 54 |
'#default_value' => $saved['showPlayListButtons'],
|
| 55 |
'#title' => t('Show playlist buttons'),
|
| 56 |
'#options' => $options['bool'],
|
| 57 |
'#description' => t('Show previous/next buttons when playing a playlist. (<em>showPlayListButtons</em>)'),
|
| 58 |
);
|
| 59 |
$form['flowplayer_mediaplayer']['playback']['autoPlay'] = array(
|
| 60 |
'#type' => 'select',
|
| 61 |
'#options' => $options['bool'],
|
| 62 |
'#default_value' => $saved['autoPlay'],
|
| 63 |
'#title' => t('Autoplay'),
|
| 64 |
'#description' => t('Automatically start playing the media. (<em>autoPlay</em>)'),
|
| 65 |
);
|
| 66 |
$form['flowplayer_mediaplayer']['playback']['loop'] = array(
|
| 67 |
'#type' => 'select',
|
| 68 |
'#default_value' => $saved['loop'],
|
| 69 |
'#title' => t('Loop'),
|
| 70 |
'#options' => $options['bool'],
|
| 71 |
'#description' => t('Set whether the media repeats after completion. (<em>loop</em>)'),
|
| 72 |
);
|
| 73 |
$form['flowplayer_mediaplayer']['playback']['initialVolumePercentage'] = array(
|
| 74 |
'#type' => 'textfield',
|
| 75 |
'#default_value' => $saved['initialVolumePercentage'],
|
| 76 |
'#size' => 8,
|
| 77 |
'#maxlength' => 3,
|
| 78 |
'#title' => t('Volume'),
|
| 79 |
'#description' => t('Starting volume of the player. (<em>initialVolumePercentage</em>)'),
|
| 80 |
);
|
| 81 |
|
| 82 |
$form['#tree'] = TRUE;
|
| 83 |
|
| 84 |
$form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'), '#submit' => array('swftools_admin_form_submit') );
|
| 85 |
$form['reset'] = array('#type' => 'submit', '#value' => t('Reset to defaults'), '#submit' => array('swftools_admin_form_submit') );
|
| 86 |
$form['#theme'] = 'system_settings_form';
|
| 87 |
|
| 88 |
return $form;
|
| 89 |
|
| 90 |
}
|