* $Id: tiny_mce_gzip.php 315 2007-10-25 14:03:43Z spocke $
*
* @author Moxiecode
- * @copyright Copyright © 2005-2006, Moxiecode Systems AB, All rights reserved.
+ * @copyright Copyright © 2005-2006, Moxiecode Systems AB, All rights reserved.
*
* This file compresses the TinyMCE JavaScript using GZip.
**/
// Discard any buffers
while ( @ob_end_clean() );
-@ require('../../../wp-config.php');
+@ require('../../../wp-load.php');
function getFileContents($path) {
}
// Set up init variables
-$https = ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false;
-
-$baseurl = get_option('siteurl') . '/wp-includes/js/tinymce';
-if ( $https ) $baseurl = str_replace('http://', 'https://', $baseurl);
+$baseurl = includes_url('js/tinymce');
$mce_css = $baseurl . '/wordpress.css';
$mce_css = apply_filters('mce_css', $mce_css);
-if ( $https ) $mce_css = str_replace('http://', 'https://', $mce_css);
$mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); // only ISO 639-1
*/
$mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv');
-$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen' );
+$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage' );
/*
The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'.
foreach ( $mce_external_plugins as $name => $url ) {
- if ( $https ) $url = str_replace('http://', 'https://', $url);
+ if ( is_ssl() ) $url = str_replace('http://', 'https://', $url);
$plugins[] = '-' . $name;
}
$plugins = implode($plugins, ',');
-$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'image', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ));
+$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ));
$mce_buttons = implode($mce_buttons, ',');
$mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' ));
$mce_buttons_4 = apply_filters('mce_buttons_4', array());
$mce_buttons_4 = implode($mce_buttons_4, ',');
+$no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false;
+
// TinyMCE init settings
$initArray = array (
'mode' => 'none',
'tab_focus' => ':next',
'content_css' => "$mce_css",
'save_callback' => 'switchEditors.saveCallback',
+ 'wpeditimage_disable_captions' => $no_captions,
'plugins' => "$plugins",
// pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init"
'disk_cache' => true,
}
// Cache path, this is where the .gz files will be stored
-$cache_path = ABSPATH . 'wp-content/uploads/js_cache';
+$cache_path = WP_CONTENT_DIR . '/uploads/js_cache';
if ( $disk_cache && ! is_dir($cache_path) )
$disk_cache = wp_mkdir_p($cache_path);
$cache_ext = '.js';
$plugins = explode( ',', $initArray['plugins'] );
$theme = ( 'simple' == $initArray['theme'] ) ? 'simple' : 'advanced';
-$language = isset($initArray['language']) ? substr( $initArray['language'], 0, 2 ) : 'en';
+$language = ( isset($initArray['language']) && ! empty($initArray['language']) ) ? substr( $initArray['language'], 0, 2 ) : 'en';
$cacheKey = $mce_options = '';
// Check if browser supports gzip
// Setup cache info
if ( $disk_cache ) {
- $cacheKey = apply_filters('tiny_mce_version', '20080414');
+ $cacheKey = apply_filters('tiny_mce_version', '20080810');
foreach ( $initArray as $v )
$cacheKey .= $v;
$mce_options = rtrim( trim($mce_options), '\n\r,' );
-$content = 'var tinyMCEPreInit = { settings : { themes : "' . $theme . '", plugins : "' . $initArray['plugins'] . '", languages : "' . $language . '", debug : false }, base : "' . $baseurl . '", suffix : "" };';
+$content = 'var tinyMCEPreInit = { settings : { themes : "' . $theme . '", plugins : "' . $initArray['plugins'] . '", languages : "' . $language . '", debug : false }, base : "' . $baseurl . '", suffix : "", query : "ver=311" };';
// Load patch
$content .= getFileContents( 'tiny_mce_ext.js' );
putFileContents( $cache_file, $content );
}
-?>
+?>
\ No newline at end of file