Changeset 8600 for trunk/wp-includes/js/tinymce/tiny_mce_config.php
- Timestamp:
- 08/09/2008 05:36:14 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/tinymce/tiny_mce_config.php
r8517 r8600 1 <?php 1 <?php 2 2 // some code below is from: 3 3 /** … … 69 69 $plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage' ); 70 70 71 /* 71 /* 72 72 The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'. 73 It adds the plugin's name to TinyMCE's plugins init and the call to PluginManager to load the plugin. 74 The url should be absolute and should include the js file name to be loaded. Example: 73 It adds the plugin's name to TinyMCE's plugins init and the call to PluginManager to load the plugin. 74 The url should be absolute and should include the js file name to be loaded. Example: 75 75 array( 'myplugin' => 'http://my-site.com/wp-content/plugins/myfolder/mce_plugin.js' ) 76 76 If the plugin uses a button, it should be added with one of the "$mce_buttons" filters. … … 80 80 $ext_plugins = "\n"; 81 81 if ( ! empty($mce_external_plugins) ) { 82 82 83 83 /* 84 84 The following filter loads external language files for TinyMCE plugins. 85 It takes an associative array 'plugin_name' => 'path', where path is the 86 include path to the file. The language file should follow the same format as 87 /tinymce/langs/wp-langs.php and should define a variable $strings that 88 holds all translated strings. Example: 85 It takes an associative array 'plugin_name' => 'path', where path is the 86 include path to the file. The language file should follow the same format as 87 /tinymce/langs/wp-langs.php and should define a variable $strings that 88 holds all translated strings. Example: 89 89 $strings = 'tinyMCE.addI18n("' . $mce_locale . '.mypluginname_dlg",{tab_general:"General", ... })'; 90 90 */ 91 $mce_external_languages = apply_filters('mce_external_languages', array()); 92 91 $mce_external_languages = apply_filters('mce_external_languages', array()); 92 93 93 $loaded_langs = array(); 94 94 $strings = ''; 95 95 96 96 if ( ! empty($mce_external_languages) ) { 97 97 foreach ( $mce_external_languages as $name => $path ) { 98 if ( is_file($path) && is_readable($path) ) { 98 if ( is_file($path) && is_readable($path) ) { 99 99 include_once($path); 100 100 $ext_plugins .= $strings; … … 105 105 106 106 foreach ( $mce_external_plugins as $name => $url ) { 107 107 108 108 if ( is_ssl() ) $url = str_replace('http://', 'https://', $url); 109 109 110 110 $plugins[] = '-' . $name; 111 111 … … 127 127 $mce_buttons_3 = apply_filters('mce_buttons_3', array()); 128 128 $mce_buttons_3 = implode($mce_buttons_3, ','); 129 129 130 130 $mce_buttons_4 = apply_filters('mce_buttons_4', array()); 131 131 $mce_buttons_4 = implode($mce_buttons_4, ','); … … 196 196 197 197 // Cache path, this is where the .gz files will be stored 198 $cache_path = WP_CONTENT_DIR . '/uploads/js_cache'; 198 $cache_path = WP_CONTENT_DIR . '/uploads/js_cache'; 199 199 if ( $disk_cache && ! is_dir($cache_path) ) 200 200 $disk_cache = wp_mkdir_p($cache_path); … … 204 204 $theme = ( 'simple' == $initArray['theme'] ) ? 'simple' : 'advanced'; 205 205 $language = ( isset($initArray['language']) && ! empty($initArray['language']) ) ? substr( $initArray['language'], 0, 2 ) : 'en'; 206 $cacheKey = $mce_options = ''; 206 $cacheKey = $mce_options = ''; 207 207 208 208 // Check if browser supports gzip … … 225 225 $cacheKey .= $n; 226 226 } 227 227 228 228 $cacheKey = md5( $cacheKey ); 229 229 $cache_file = $cache_path . '/tinymce_' . $cacheKey . $cache_ext; … … 239 239 240 240 $mtime = gmdate("D, d M Y H:i:s", filemtime($cache_file)) . " GMT"; 241 241 242 242 if ( isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $mtime ) { 243 243 header('HTTP/1.1 304 Not Modified'); … … 248 248 249 249 $content = getFileContents( $cache_file ); 250 250 251 251 if ( '.gz' == $cache_ext ) 252 252 header( 'Content-Encoding: gzip' ); … … 256 256 } 257 257 258 foreach ( $initArray as $k => $v ) 258 foreach ( $initArray as $k => $v ) 259 259 $mce_options .= $k . ':"' . $v . '",'; 260 260 … … 278 278 279 279 // Add plugins 280 foreach ( $plugins as $plugin ) 280 foreach ( $plugins as $plugin ) 281 281 $content .= getFileContents( 'plugins/' . $plugin . '/editor_plugin.js' ); 282 282 283 // Add external plugins 283 // Add external plugins 284 284 $content .= $ext_plugins; 285 285
Note: See TracChangeset
for help on using the changeset viewer.