function _swftools_admin_handling_form in SWF Tools 5
1 call to _swftools_admin_handling_form()
File
- ./
swftools.admin.inc, line 210
Code
function _swftools_admin_handling_form() {
$player_directory = swftools_get_player_path() . '/';
$form = array();
$form['swftools']['handling'] = array(
'#type' => 'fieldset',
'#title' => t('File handling'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#description' => 'Choose how different file types are handled.',
);
$form['swftools']['handling'][SWFTOOLS_FLV_DISPLAY] = _swftools_admin_file_handling_option(SWFTOOLS_FLV_DISPLAY, $player_directory, "Default player for single FLV movies");
$form['swftools']['handling'][SWFTOOLS_MP3_DISPLAY] = _swftools_admin_file_handling_option(SWFTOOLS_MP3_DISPLAY, $player_directory, "Default player for single MP3 files");
$form['swftools']['handling'][SWFTOOLS_SWF_DISPLAY] = _swftools_admin_file_handling_option(SWFTOOLS_SWF_DISPLAY, $player_directory, "Default player for single SWF files");
$form['swftools']['handling'][SWFTOOLS_IMAGE_DISPLAY_LIST] = _swftools_admin_file_handling_option(SWFTOOLS_IMAGE_DISPLAY_LIST, $player_directory, "Default player for a list of images");
$form['swftools']['handling'][SWFTOOLS_FLV_DISPLAY_LIST] = _swftools_admin_file_handling_option(SWFTOOLS_FLV_DISPLAY_LIST, $player_directory, "Default player for a list of FLV movies");
$form['swftools']['handling'][SWFTOOLS_MP3_DISPLAY_LIST] = _swftools_admin_file_handling_option(SWFTOOLS_MP3_DISPLAY_LIST, $player_directory, "Default player for a list of MP3 music files");
$form['swftools']['handling'][SWFTOOLS_MEDIA_DISPLAY_LIST] = _swftools_admin_file_handling_option(SWFTOOLS_MEDIA_DISPLAY_LIST, $player_directory, "Default player for a list of mixed media");
// Playlist settings
$form['swftools']['playlist'] = array(
'#type' => 'fieldset',
'#title' => t('Playlist handling'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#description' => 'Settings for XML files and playlists.',
);
$caching = variable_get('swftools_playlist_caching', 'here');
if ($caching == 'here') {
// Check the user didn't set the playlist path to their file system top level before deleting everything!
$playlist_path = variable_get('swftools_playlist_path', SWFTOOLS_PLAYLIST_PATH);
if (!empty($playlist_path)) {
file_scan_directory(swftools_get_playlist_path(), '.*', array(
'.',
'..',
'CVS',
), 'file_delete', TRUE);
}
}
$form['swftools']['playlist']['swftools_playlist_caching'] = array(
'#type' => 'select',
'#title' => t('Clear playlist cache'),
'#default_value' => $caching,
'#options' => array(
'here' => 'Only here',
'always' => 'Every page view',
),
'#description' => 'Select \'Only here\' to clear the playlist directory just ' . 'by visiting this page. It is useful to select \'Every ' . 'page view\' for site or module development but not ' . 'advisable for live sites.',
);
$form['swftools_private'] = array(
'#type' => 'fieldset',
'#title' => t('Private file system'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
// Allow SWF Tools to grant access to non-uploaded files
$form['swftools_private']['swftools_grant_access_to_private_files'] = array(
'#type' => 'checkbox',
'#title' => t('Allow SWF Tools to grant access to supported private files'),
'#default_value' => variable_get('swftools_grant_access_to_private_files', SWFTOOLS_GRANT_ACCESS_TO_PRIVATE_FILES),
'#description' => t('If using a private file system then SWF Tools is unable to
access files that are not uploaded via a file module that
supports a private file system. For example, with a private
file system SWF Tools is unable to access files that are
manually uploaded via FTP. Enabling this setting will
allow SWF Tools to grant access to files with the extension
swf, mp3, flv, xml, jpg and jpeg. However, if another module
denies access then access to the file will not be granted.
SWF Tools always allows access to files in the playlists directory.
'),
);
return $form;
}