| 1 |
<?php
|
| 2 |
// $Id: wijering.admin.inc,v 1.2 2008/09/07 19:42:15 stuartgreenfield Exp $
|
| 3 |
|
| 4 |
function wijering_admin_form() {
|
| 5 |
|
| 6 |
$saved_settings = _wijering_settings(WIJERING_MEDIAPLAYER);
|
| 7 |
// Flatten settings for convenience
|
| 8 |
$saved = array();
|
| 9 |
foreach ($saved_settings AS $category => $vars) {
|
| 10 |
$saved = array_merge($saved, $vars);
|
| 11 |
}
|
| 12 |
$options = _wijering_options();
|
| 13 |
|
| 14 |
$form = array();
|
| 15 |
|
| 16 |
$form['wijering_mediaplayer']['basic'] = array(
|
| 17 |
'#type' => 'fieldset',
|
| 18 |
'#title' => t('Basic'),
|
| 19 |
'#collapsible' => TRUE,
|
| 20 |
'#collapsed' => TRUE,
|
| 21 |
);
|
| 22 |
$form['wijering_mediaplayer']['basic']['displayheight'] = array(
|
| 23 |
'#type' => 'textfield',
|
| 24 |
'#default_value' => $saved['displayheight'],
|
| 25 |
'#size' => 8,
|
| 26 |
'#maxlength' => 5,
|
| 27 |
'#title' => t('Display height'),
|
| 28 |
'#description' => t('Leave blank for default which will respond to the available height of the player. (<em>displayheight</em>)'),
|
| 29 |
);
|
| 30 |
$form['wijering_mediaplayer']['basic']['height'] = array(
|
| 31 |
'#type' => 'textfield',
|
| 32 |
'#default_value' => $saved['height'],
|
| 33 |
'#size' => 8,
|
| 34 |
'#maxlength' => 5,
|
| 35 |
'#title' => t('Height'),
|
| 36 |
'#description' => t('Leave blank for default. (<em>height</em>)'),
|
| 37 |
);
|
| 38 |
$form['wijering_mediaplayer']['basic']['width'] = array(
|
| 39 |
'#type' => 'textfield',
|
| 40 |
'#default_value' => $saved['width'],
|
| 41 |
'#size' => 8,
|
| 42 |
'#maxlength' => 5,
|
| 43 |
'#title' => t('Width'),
|
| 44 |
'#description' => t('Leave blank for default. (<em>width</em>)'),
|
| 45 |
);
|
| 46 |
$form['wijering_mediaplayer']['color'] = array(
|
| 47 |
'#type' => 'fieldset',
|
| 48 |
'#title' => t('Color'),
|
| 49 |
'#collapsible' => TRUE,
|
| 50 |
'#collapsed' => TRUE,
|
| 51 |
);
|
| 52 |
$form['wijering_mediaplayer']['color']['backcolor'] = array(
|
| 53 |
'#type' => 'textfield',
|
| 54 |
'#default_value' => $saved['backcolor'],
|
| 55 |
'#size' => 8,
|
| 56 |
'#maxlength' => 7,
|
| 57 |
'#title' => t('Background color'),
|
| 58 |
'#description' => t('Enter a hex value eg. for white enter <b>#FFFFFF</b>. (<em>backcolor</em>)'),
|
| 59 |
);
|
| 60 |
$form['wijering_mediaplayer']['color']['frontcolor'] = array(
|
| 61 |
'#type' => 'textfield',
|
| 62 |
'#default_value' => $saved['frontcolor'],
|
| 63 |
'#size' => 8,
|
| 64 |
'#maxlength' => 7,
|
| 65 |
'#title' => t('Text color'),
|
| 66 |
'#description' => t('Enter a hex value eg. for white enter <b>#FFFFFF</b>. (<em>frontcolor</em>)'),
|
| 67 |
);
|
| 68 |
$form['wijering_mediaplayer']['color']['lightcolor'] = array(
|
| 69 |
'#type' => 'textfield',
|
| 70 |
'#default_value' => $saved['lightcolor'],
|
| 71 |
'#size' => 8,
|
| 72 |
'#maxlength' => 7,
|
| 73 |
'#title' => t('Rollover color'),
|
| 74 |
'#description' => t('Enter a hex value eg. for white enter <b>#FFFFFF</b>. (<em>lightcolor</em>)'),
|
| 75 |
);
|
| 76 |
$form['wijering_mediaplayer']['appearance'] = array(
|
| 77 |
'#type' => 'fieldset',
|
| 78 |
'#title' => t('Appearance'),
|
| 79 |
'#collapsible' => TRUE,
|
| 80 |
'#collapsed' => TRUE,
|
| 81 |
);
|
| 82 |
$form['wijering_mediaplayer']['appearance']['autoscroll'] = array(
|
| 83 |
'#type' => 'select',
|
| 84 |
'#options' => $options['bool'],
|
| 85 |
'#default_value' => $saved['autoscroll'],
|
| 86 |
'#title' => t('Autoscroll'),
|
| 87 |
'#description' => t('Provide a scrollbar or autoscroll with mouse movements. (<em>autoscroll</em>)'),
|
| 88 |
);
|
| 89 |
$form['wijering_mediaplayer']['appearance']['displaywidth'] = array(
|
| 90 |
'#type' => 'textfield',
|
| 91 |
'#default_value' => $saved['displaywidth'],
|
| 92 |
'#size' => 8,
|
| 93 |
'#maxlength' => 5,
|
| 94 |
'#title' => t('Display width'),
|
| 95 |
'#description' => t('Setting this will result in controls along the side and override "Display width". (<em>displaywidth</em>)'),
|
| 96 |
);
|
| 97 |
$form['wijering_mediaplayer']['appearance']['largecontrols'] = array(
|
| 98 |
'#type' => 'select',
|
| 99 |
'#options' => $options['bool'],
|
| 100 |
'#default_value' => $saved['largecontrols'],
|
| 101 |
'#title' => t('Large controls'),
|
| 102 |
'#description' => t('Double the size of the controls. (<em>largecontrols</em>)'),
|
| 103 |
);
|
| 104 |
$form['wijering_mediaplayer']['appearance']['logo'] = array(
|
| 105 |
'#type' => 'textfield',
|
| 106 |
'#default_value' => $saved['logo'],
|
| 107 |
'#title' => t('Logo URL'),
|
| 108 |
'#description' => t('Full url to logo for a watermark, use PNG files for best results. (<em>logo</em>)'),
|
| 109 |
);
|
| 110 |
$form['wijering_mediaplayer']['appearance']['overstretch'] = array(
|
| 111 |
'#type' => 'select',
|
| 112 |
'#default_value' => $saved['overstretch'],
|
| 113 |
'#title' => t('Overstretch'),
|
| 114 |
'#options' => $options['overstretch'],
|
| 115 |
'#description' => t('Defines how to stretch images to fit the display. (<em>overstretch</em>)'),
|
| 116 |
);
|
| 117 |
$form['wijering_mediaplayer']['appearance']['showdigits'] = array(
|
| 118 |
'#type' => 'select',
|
| 119 |
'#options' => $options['bool'],
|
| 120 |
'#default_value' => $saved['showdigits'],
|
| 121 |
'#title' => t('Show digits'),
|
| 122 |
'#description' => t('Show or hide the elasped/total time. (<em>showdigits</em>)'),
|
| 123 |
);
|
| 124 |
$form['wijering_mediaplayer']['appearance']['showeq'] = array(
|
| 125 |
'#type' => 'select',
|
| 126 |
'#options' => $options['bool'],
|
| 127 |
'#default_value' => $saved['showeq'],
|
| 128 |
'#title' => t('Show equalizer'),
|
| 129 |
'#description' => t('Nice and fake graphic equalizer. (<em>showeq</em>)'),
|
| 130 |
);
|
| 131 |
$form['wijering_mediaplayer']['appearance']['showicons'] = array(
|
| 132 |
'#type' => 'select',
|
| 133 |
'#options' => $options['bool'],
|
| 134 |
'#default_value' => $saved['showicons'],
|
| 135 |
'#title' => t('Show icons'),
|
| 136 |
'#description' => t('Show status icons in display. (<em>showicons</em>)'),
|
| 137 |
);
|
| 138 |
$form['wijering_mediaplayer']['appearance']['thumbsinplaylist'] = array(
|
| 139 |
'#type' => 'select',
|
| 140 |
'#options' => $options['bool'],
|
| 141 |
'#default_value' => $saved['thumbsinplaylist'],
|
| 142 |
'#title' => t('Show thumbs in playlist'),
|
| 143 |
'#description' => t('Show item by item thumbnails passed by xml playlist. (<em>thumbsinplaylist</em>)'),
|
| 144 |
);
|
| 145 |
$form['wijering_mediaplayer']['playback'] = array(
|
| 146 |
'#type' => 'fieldset',
|
| 147 |
'#title' => t('Playback'),
|
| 148 |
'#collapsible' => TRUE,
|
| 149 |
'#collapsed' => TRUE,
|
| 150 |
);
|
| 151 |
$form['wijering_mediaplayer']['playback']['autostart'] = array(
|
| 152 |
'#type' => 'select',
|
| 153 |
'#options' => $options['bool'],
|
| 154 |
'#default_value' => $saved['autostart'],
|
| 155 |
'#title' => t('Autostart'),
|
| 156 |
'#description' => t('Automatically start playing the media. (<em>autostart</em>)'),
|
| 157 |
);
|
| 158 |
$form['wijering_mediaplayer']['playback']['bufferlength'] = array(
|
| 159 |
'#type' => 'textfield',
|
| 160 |
'#default_value' => $saved['bufferlength'],
|
| 161 |
'#size' => 5,
|
| 162 |
'#maxlength' => 2,
|
| 163 |
'#title' => t('Buffer length'),
|
| 164 |
'#description' => t('Number of seconds of buffering before playing file. (<em>bufferlength</em>)'),
|
| 165 |
);
|
| 166 |
$form['wijering_mediaplayer']['playback']['repeat'] = array(
|
| 167 |
'#type' => 'select',
|
| 168 |
'#default_value' => $saved['repeat'],
|
| 169 |
'#title' => t('Repeat'),
|
| 170 |
'#options' => $options['repeat'],
|
| 171 |
'#description' => t('Set whether the media repeats after completion. (<em>repeat</em>)'),
|
| 172 |
);
|
| 173 |
$form['wijering_mediaplayer']['playback']['rotatetime'] = array(
|
| 174 |
'#type' => 'textfield',
|
| 175 |
'#default_value' => $saved['rotatetime'],
|
| 176 |
'#size' => 5,
|
| 177 |
'#maxlength' => 3,
|
| 178 |
'#title' => t('Rotate time'),
|
| 179 |
'#description' => t('Number of seconds between image rotations. (<em>rotatetime</em>)'),
|
| 180 |
);
|
| 181 |
$form['wijering_mediaplayer']['playback']['shuffle'] = array(
|
| 182 |
'#type' => 'select',
|
| 183 |
'#options' => $options['bool'],
|
| 184 |
'#default_value' => $saved['shuffle'],
|
| 185 |
'#title' => t('Shuffle'),
|
| 186 |
'#description' => t('Shuffle media randomly. (<em>shuffle</em>)'),
|
| 187 |
);
|
| 188 |
$form['wijering_mediaplayer']['playback']['volume'] = array(
|
| 189 |
'#type' => 'textfield',
|
| 190 |
'#default_value' => $saved['volume'],
|
| 191 |
'#size' => 8,
|
| 192 |
'#maxlength' => 3,
|
| 193 |
'#title' => t('Volume'),
|
| 194 |
'#description' => t('Starting volume of the player. (<em>volume</em>)'),
|
| 195 |
);
|
| 196 |
$form['wijering_mediaplayer']['interaction'] = array(
|
| 197 |
'#type' => 'fieldset',
|
| 198 |
'#title' => t('Interaction'),
|
| 199 |
'#collapsible' => TRUE,
|
| 200 |
'#collapsed' => TRUE,
|
| 201 |
);
|
| 202 |
$form['wijering_mediaplayer']['interaction']['callback'] = array(
|
| 203 |
'#type' => 'textfield',
|
| 204 |
'#default_value' => $saved['callback'],
|
| 205 |
'#title' => t('Callback URL'),
|
| 206 |
'#description' => t('Full url used to pass statistics back to a server. (<em>callback</em>)'),
|
| 207 |
);
|
| 208 |
$form['wijering_mediaplayer']['interaction']['captions'] = array(
|
| 209 |
'#type' => 'textfield',
|
| 210 |
'#default_value' => $saved['captions'],
|
| 211 |
'#title' => t('Captions URL'),
|
| 212 |
'#description' => t('Full url used to an external textfile with captions. (<em>captions</em>)'),
|
| 213 |
);
|
| 214 |
$form['wijering_mediaplayer']['interaction']['enablejs'] = array(
|
| 215 |
'#type' => 'select',
|
| 216 |
'#options' => $options['bool'],
|
| 217 |
'#default_value' => $saved['enablejs'],
|
| 218 |
'#title' => t('Enable javascript'),
|
| 219 |
'#description' => t('Enable javascript interaction with the flash player. (<em>enablejs</em>)'),
|
| 220 |
);
|
| 221 |
$form['wijering_mediaplayer']['interaction']['fsbuttonlink'] = array(
|
| 222 |
'#type' => 'textfield',
|
| 223 |
'#default_value' => $saved['fsbuttonlink'],
|
| 224 |
'#title' => t('Fullscreen button link'),
|
| 225 |
'#description' => t('Full url link to an alternative page, assuming the player supports full screen play. (<em>fsbuttonlink</em>)'),
|
| 226 |
);
|
| 227 |
$form['wijering_mediaplayer']['interaction']['link'] = array(
|
| 228 |
'#type' => 'textfield',
|
| 229 |
'#default_value' => $saved['link'],
|
| 230 |
'#title' => t('Link URL'),
|
| 231 |
'#description' => t('Web address linked to logo watermark. (<em>link</em>)'),
|
| 232 |
);
|
| 233 |
$form['wijering_mediaplayer']['interaction']['linkfromdisplay'] = array(
|
| 234 |
'#type' => 'select',
|
| 235 |
'#options' => $options['bool'],
|
| 236 |
'#default_value' => $saved['linkfromdisplay'],
|
| 237 |
'#title' => t('Link from display'),
|
| 238 |
'#description' => t('Link "Link URL" but with the whole display as the click area. (<em>linkfromdisplay</em>)'),
|
| 239 |
);
|
| 240 |
$form['wijering_mediaplayer']['interaction']['linktarget'] = array(
|
| 241 |
'#type' => 'select',
|
| 242 |
'#default_value' => $saved['linktarget'],
|
| 243 |
'#options' => $options['linktarget'],
|
| 244 |
'#title' => t('Link target'),
|
| 245 |
'#description' => t('Target of "Link URL". (<em>linktarget</em>)'),
|
| 246 |
);
|
| 247 |
$form['wijering_mediaplayer']['interaction']['streamscript'] = array(
|
| 248 |
'#type' => 'textfield',
|
| 249 |
'#default_value' => $saved['streamscript'],
|
| 250 |
'#title' => t('Streaming script URL'),
|
| 251 |
'#description' => t('Full url to \'fake\' streaming script. (<em>streamscript</em>)'),
|
| 252 |
);
|
| 253 |
$form['wijering_mediaplayer']['interaction']['type'] = array(
|
| 254 |
'#type' => 'textfield',
|
| 255 |
'#size' => 8,
|
| 256 |
'#maxlength' => 5,
|
| 257 |
'#default_value' => $saved['type'],
|
| 258 |
'#title' => t('File type'),
|
| 259 |
'#description' => t('Specify a default filename extension, rarely required. (<em>type</em>)'),
|
| 260 |
);
|
| 261 |
$form['wijering_mediaplayer']['interaction']['usecaptions'] = array(
|
| 262 |
'#type' => 'select',
|
| 263 |
'#options' => $options['bool'],
|
| 264 |
'#default_value' => $saved['usecaptions'],
|
| 265 |
'#title' => t('Use captions'),
|
| 266 |
'#description' => t('Determine whether to show captions. (<em>usecaptions</em>)'),
|
| 267 |
);
|
| 268 |
$form['wijering_mediaplayer']['interaction']['usefullscreen'] = array(
|
| 269 |
'#type' => 'select',
|
| 270 |
'#options' => $options['bool'],
|
| 271 |
'#default_value' => $saved['usefullscreen'],
|
| 272 |
'#title' => t('Use fullscreen'),
|
| 273 |
'#description' => t('Determine whether to allow fullscreen functionality. (<em>usefullscreen</em>)'),
|
| 274 |
);
|
| 275 |
$form['wijering_mediaplayer']['interaction']['usekeys'] = array(
|
| 276 |
'#type' => 'select',
|
| 277 |
'#options' => $options['bool'],
|
| 278 |
'#default_value' => $saved['usekeys'],
|
| 279 |
'#title' => t('Use keys'),
|
| 280 |
'#description' => t('Determine whether to allow interaction with the keyboard. (<em>usekeys</em>)'),
|
| 281 |
);
|
| 282 |
|
| 283 |
$form['#tree'] = TRUE;
|
| 284 |
|
| 285 |
$form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'), '#submit' => array('swftools_admin_form_submit') );
|
| 286 |
$form['reset'] = array('#type' => 'submit', '#value' => t('Reset to defaults'), '#submit' => array('swftools_admin_form_submit') );
|
| 287 |
$form['#theme'] = 'system_settings_form';
|
| 288 |
|
| 289 |
return $form;
|
| 290 |
|
| 291 |
}
|