X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/177fd6fefd2e3d5a0ea6591c71d660cabdb3c1a4..8a06f4f9392d1ac373442f82ee40428a3cb81395:/wp-includes/js/tinymce/tiny_mce_config.php diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php index f95a7467..757d06be 100644 --- a/wp-includes/js/tinymce/tiny_mce_config.php +++ b/wp-includes/js/tinymce/tiny_mce_config.php @@ -4,7 +4,7 @@ * $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. **/ @@ -12,7 +12,7 @@ // Discard any buffers while ( @ob_end_clean() ); -@ require('../../../wp-config.php'); +@ require('../../../wp-load.php'); function getFileContents($path) { @@ -51,14 +51,10 @@ function putFileContents( $path, $content ) { } // 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 @@ -70,7 +66,7 @@ http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker */ $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'. @@ -109,7 +105,7 @@ if ( ! empty($mce_external_plugins) ) { 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; @@ -122,7 +118,7 @@ if ( ! empty($mce_external_plugins) ) { } $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' )); @@ -134,6 +130,8 @@ $mce_buttons_3 = implode($mce_buttons_3, ','); $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', @@ -167,6 +165,7 @@ $initArray = array ( '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, @@ -206,14 +205,14 @@ if ( $msie = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) { } // 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 @@ -226,7 +225,7 @@ if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) { // 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; @@ -273,7 +272,7 @@ if ( $mce_deprecated ) $mce_options .= $mce_deprecated; $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' ); @@ -329,4 +328,4 @@ if ( '' != $cacheKey && is_dir($cache_path) && is_readable($cache_path) ) { putFileContents( $cache_file, $content ); } -?> +?> \ No newline at end of file