'fieldset', '#title' => t('File locations'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['swftools_files']['swftools_player_path'] = array( '#type' => 'textfield', '#title' => t('Default flash player path'), '#default_value' => variable_get('swftools_player_path', ''), '#description' => t('Leave this blank to default to the shared player file inside the swftools module (%default). Otherwise your options are:
$conf = array( 'swftools_media_url' => 'http://anothersite.com/media', // No trailing slashes! );Leaving this value unset in your settings.php file will persuade SWF Tools to check for the existence of your media files, as they are automatically assumed to be on the local server."), ); $form['swftools_files']['swftools_check_media'] = array( '#type' => 'checkbox', '#title' => t('Check files'), '#default_value' => variable_get('swftools_check_media', TRUE), '#description' => t('This option will cause SWF Tools to check that the media file exists - and issue a warning if not.'), ); $form['swftools_method'] = array( '#type' => 'fieldset', '#title' => t('JavaScript Embedding'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $methods = swftools_methods_available(SWFTOOLS_EMBED_METHOD); if (count($methods)) { foreach ($methods AS $method => $info) { if (!file_exists($player_directory . $info['shared_file'])) { $swf_embed_methods[$method] = $info['title'] .' - Missing'; } else { $swf_embed_methods[$method] = $info['title']; } } } $form['swftools_method'][SWFTOOLS_EMBED_METHOD] = array( '#type' => 'radios', '#title' => t('Method'), '#default_value' => variable_get(SWFTOOLS_EMBED_METHOD, SWFTOOLS_NOJAVASCRIPT), '#options' => $swf_embed_methods, '#description' => t('JavaScript file that will be used for Flash replacement. UFO is coming next.'), ); // Might have another setting like above for SIFR, if it ever gets used $form['swftools_method']['swftools_always_add_js'] = array( '#type' => 'checkbox', '#title' => t('All pages.'), '#default_value' => variable_get('swftools_always_add_js', FALSE), '#description' => t('Some implementations, like filters, result in caching of flash content, and in these cases SWF Tools has no trigger to output a flash replacement script. Enable this setting to push the default javascript script into the header on every page so that cached content can be processed by SWFObject or UFO. '), ); $form['swftools_method']['swftools_user_no_js'] = array( '#type' => 'checkbox', '#title' => t('User override'), '#disabled' => TRUE, '#default_value' => variable_get('swftools_user_no_js', FALSE), '#description' => t('User can choose how Flash content is delivered overriding the \'Method\' setting above. Adds a setting to the profile page.'), ); $form['swftools_method']['swftools_html_alt'] = array( '#type' => 'textarea', '#title' => t('HTML alternative'), '#default_value' => variable_get('swftools_html_alt', "
Sorry, flash is not available.
"), '#description' => t('Enter the default HTML that will appear if the Flash content cannot be embedded. Future versions of SWF Tools will allow you have custom message for each content type, and to use tokens like %image to automatically fill in content.'), ); $form['swftools_params'] = array( '#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => TRUE, '#title' => t('Default settings for embedding'), '#description' => t('Please refer to !technote for more details about each setting. If you are looking for the \'base\' option, this is defined in the \'File Locations\' settings above.', array('!technote' => l('Adobe technote 12701', 'http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_12701'))), ); $form['swftools_params']['swftools_params_version'] = array( '#type' => 'textfield', '#size' => '5', '#title' => 'Flash version', '#default_value' => variable_get('swftools_params_version', '7'), ); $form['swftools_params']['swftools_params_play'] = array( '#type' => 'checkbox', '#title' => t('Play immediately (play)'), '#default_value' => variable_get('swftools_params_play', TRUE), ); $form['swftools_params']['swftools_params_loop'] = array( '#type' => 'checkbox', '#title' => t('Loop movie (loop) .'), '#default_value' => variable_get('swftools_params_loop', FALSE), ); $form['swftools_params']['swftools_params_menu'] = array( '#type' => 'checkbox', '#title' => t('Full menu (menu) Displays the full menu, allowing the user a variety of options to enhance or control playback.'), '#default_value' => variable_get('swftools_params_menu', FALSE), ); $form['swftools_params']['swftools_params_bgcolor'] = array( '#type' => 'textfield', '#title' => t('Background color (bgcolor)'), '#size' => 7, '#maxlength' => 7, '#required' => TRUE, '#default_value' => variable_get('swftools_params_bgcolor', '#FFFFFF'), '#description' => t('Hexadecimal background color in the form #RRGGBB.'), ); $form['swftools_params']['swftools_params_quality'] = array( '#type' => 'select', '#title' => t('Quality') .' (quality)', '#default_value' => variable_get('swftools_params_quality', 'autohigh'), '#options' => $swf_options['quality'], ); $form['swftools_params']['swftools_params_scale'] = array( '#type' => 'select', '#title' => t('Scale') .' (scale)', '#default_value' => variable_get('swftools_params_scale', 'showall'), '#options' => $swf_options['scale'], ); $form['swftools_params']['swftools_params_wmode'] = array( '#type' => 'select', '#title' => t('Window mode') .' (wmode)', '#default_value' => variable_get('swftools_params_wmode', 'opaque'), '#options' => $swf_options['wmode'], ); $form['swftools_params']['swftools_params_align'] = array( '#type' => 'select', '#title' => t('Align') .' (align)', '#default_value' => variable_get('swftools_params_align', 'l'), '#options' => $swf_options['align'], ); $form['swftools_params']['swftools_params_salign'] = array( '#type' => 'select', '#title' => t('salign') .' (salign)', '#default_value' => variable_get('swftools_params_salign', 'tl'), '#options' => $swf_options['salign'], ); $form['swftools_params']['swftools_params_swliveconnect'] = array( '#type' => 'select', '#options' => array('true' => 'Yes', 'default' => 'No'), // 'default' setting will simple omit this value for simplicity. '#title' => t('Load Java') .' (swliveconnect)', '#default_value' => variable_get('swftools_params_swliveconnect', 'default'), ); return $form; } 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.', ); $flv[0] = 'Link only'; $methods = swftools_methods_available(SWFTOOLS_FLV_DISPLAY); if (count($methods)) { foreach ($methods AS $method => $info) { if (!file_exists($player_directory . $info['shared_file'])) { $flv[$method] = $info['title'] .' - Missing'; } else { $flv[$method] = $info['title']; } } } $form['swftools']['handling'][SWFTOOLS_FLV_DISPLAY] = array( '#type' => 'radios', '#title' => t('Default player for .flv files'), '#default_value' => variable_get(SWFTOOLS_FLV_DISPLAY, GENERIC_FLV), '#options' => $flv, ); $mp3[0] = 'None'; $methods = swftools_methods_available(SWFTOOLS_MP3_DISPLAY); if (count($methods)) { foreach ($methods AS $method => $info) { if (!file_exists($player_directory . $info['shared_file'])) { $mp3[$method] = $info['title'] .' - Missing'; } else { $mp3[$method] = $info['title']; } } } $form['swftools']['handling'][SWFTOOLS_MP3_DISPLAY] = array( '#type' => 'radios', '#title' => t('Default player for .mp3 files'), '#default_value' => variable_get(SWFTOOLS_MP3_DISPLAY, GENERIC_MP3), '#options' => $mp3, ); $swf[SWFTOOLS_SWF] = 'Embed directly'; $methods = swftools_methods_available(SWFTOOLS_SWF_DISPLAY); if (count($methods)) { foreach ($methods AS $method => $info) { if (!file_exists($player_directory . $info['shared_file'])) { $swf[$method] = $info['title'] .' - Missing'; } else { $swf[$method] = $info['title']; } } } $form['swftools']['handling'][SWFTOOLS_SWF_DISPLAY_DIRECT] = array( '#type' => 'radios', '#title' => t('Default player for swf files'), '#default_value' => variable_get(SWFTOOLS_SWF_DISPLAY, SWFTOOLS_SWF), '#options' => $swf, ); $image_list[0] = 'None'; $methods = swftools_methods_available(SWFTOOLS_IMAGE_DISPLAY_LIST); if (count($methods)) { foreach ($methods AS $method => $info) { if (!file_exists($player_directory . $info['shared_file'])) { $image_list[$method] = $info['title'] .' - Missing'; } else { $image_list[$method] = $info['title']; } } } $form['swftools']['handling'][SWFTOOLS_IMAGE_DISPLAY_LIST] = array( '#type' => 'radios', '#title' => t('Default tool for list of images'), '#default_value' => variable_get(SWFTOOLS_IMAGE_DISPLAY_LIST, '0'), '#options' => $image_list, ); $media_list[0] = 'None'; $methods = swftools_methods_available(SWFTOOLS_MEDIA_DISPLAY_LIST); if (count($methods)) { foreach ($methods AS $method => $info) { if (!file_exists($player_directory . $info['shared_file'])) { $media_list[$method] = $info['title'] .' - Missing'; } else { $media_list[$method] = $info['title']; } } } $form['swftools']['handling'][SWFTOOLS_MEDIA_DISPLAY_LIST] = array( '#type' => 'radios', '#title' => t('Default tool for list of mixed media'), '#default_value' => variable_get(SWFTOOLS_MEDIA_DISPLAY_LIST, '0'), '#options' => $media_list, ); // 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') { 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.', ); return $form; }