'300', 'width' => '400', 'alt' => '
'.__('The Flash plugin is required to view this object.', 'swfobj').'
', 'allowfullscreen' => 'false', 'required_player_version' => '8.0.0', 'express_install_swf' => get_bloginfo('wpurl').'/wp-content/plugins/swfobj/'.'expressInstall.swf' ); $saved_options = get_option($this->admin_options_saved); if (!empty($saved_options)) { foreach($saved_options as $key => $val) { $admin_options[$key] = $val; } } update_option($this->admin_options_saved, $admin_options); return $admin_options; } function init() { $this->get_options(); ?>
';
}
function media_upload_flash() {
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
// Upload File button was clicked
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
unset($_FILES);
if ( is_wp_error($id) ) {
$errors['upload_error'] = $id;
$id = false;
}
}
if ( !empty($_POST['insertonlybutton']) ) {
$href = $_POST['insertonly']['href'];
if ( !empty($href) && !strpos($href, '://') )
$href = "http://$href";
$title = attribute_escape($_POST['insertonly']['title']);
if ( empty($title) )
$title = basename($href);
if ( !empty($title) && !empty($href) )
$html = "[swfobj src='$href' title='$title']";
return media_send_to_editor($html);
}
if ( !empty($_POST) ) {
$return = media_upload_form_handler();
if ( is_string($return) )
return $return;
if ( is_array($return) )
$errors = $return;
}
if ( isset($_POST['save']) )
$errors['upload_notice'] = __('Saved.');
return wp_iframe( 'media_upload_type_form', 'flash', $errors, $id );
}
function modify_post_mime_types($post_mime_types) {
$post_mime_types['application/x-shockwave-flash'] = array(__('Flash', 'swfobj'), __('Manage Flash', 'swfobj'), __ngettext_noop('Flash (%s)', 'Flash (%s)', 'swfobj'));
return $post_mime_types;
}
function modify_media_send_to_editor($html) {
if ( isset($_POST['send']) ) {
$keys = array_keys($_POST['send']);
$send_id = (int) array_shift($keys);
$flashobj = $_POST['attachments'][$send_id];
$url = $flashobj['url'];
$title = stripslashes( htmlspecialchars ($flashobj['post_title'], ENT_QUOTES));
$alt = stripslashes( htmlspecialchars ($flashobj['post_content'], ENT_QUOTES));
// append any additional properties passed to the object.
$extras = '';
if ( !empty($flashobj['width']) && intval($flashobj['width']) ) {
$extras .= ' width="'.stripslashes( htmlspecialchars ($flashobj['width'], ENT_QUOTES)).'"';
}
if ( !empty($flashobj['height']) && intval($flashobj['height']) ) {
$extras .= ' height="'.stripslashes( htmlspecialchars ($flashobj['height'], ENT_QUOTES)).'"';
}
if ( !empty($flashobj['id']) ) {
$extras .= ' id="'.stripslashes( htmlspecialchars ($flashobj['id'], ENT_QUOTES)).'"';
}
if ( !empty($flashobj['name']) ) {
$extras .= ' name="'.stripslashes( htmlspecialchars ($flashobj['name'], ENT_QUOTES)).'"';
}
if ( !empty($flashobj['class']) ) {
$extras .= ' class="'.stripslashes( htmlspecialchars ($flashobj['class'], ENT_QUOTES)).'"';
}
if ( isset($flashobj['align']) ) {
$extras .= ' align="'.$flashobj['align'].'"';
}
if ( isset($flashobj['allowfullscreen']) ) {
$extras .= ' allowfullscreen="'.$flashobj['allowfullscreen'].'"';
}
if ( !empty($flashobj['required_player_version']) ) {
$extras .= ' required_player_version="'.stripslashes( htmlspecialchars ($flashobj['required_player_version'], ENT_QUOTES)).'"';
}
$html = '[swfobj src="'.$url.'"'.( ($alt != '') ? ' alt="'.$alt.'"' : '' ).$extras.'] ';
}
return $html;
}
function flash_attachment_fields_to_edit($form_fields, $post) {
if ( substr($post->post_mime_type, -5) == 'flash' ) {
$form_fields['post_title']['required'] = true;
unset( $form_fields['post_excerpt'] );
$form_fields['post_content']['label'] = __('Alternate html');
$form_fields['post_content']['helps'][] = __('Displayed when Flash is unavailable, e.g. "<p>Cool Flash game.</p>"');
$form_fields['size'] = array( 'label' => __('Size').' '.__('width/height').'',
'input' => 'html',
'html' => '
' );
// Advanced options
$form_fields['advanced_open'] = array( 'label' => __('Advanced Options'),
'input' => 'html',
'html' => '