Changeset 7173 for trunk/wp-includes/js/tinymce/tiny_mce_config.php
- Timestamp:
- 03/06/2008 07:56:02 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/tinymce/tiny_mce_config.php
r7159 r7173 45 45 46 46 // Set up init variables 47 $https = ( isset($_SERVER['HTTPS']) && 'on' == $_SERVER['HTTPS']) ? true : false;47 $https = ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false; 48 48 49 49 $baseurl = get_option('siteurl') . '/wp-includes/js/tinymce'; … … 54 54 if ( $https ) str_replace('http://', 'https://', $mce_css); 55 55 56 $valid_elements = '*[*]'; 57 $valid_elements = apply_filters('mce_valid_elements', $valid_elements); 58 56 /* 57 Setting mce_valid_elements to *[*] skips all of the internal cleanup and can cause problems. 58 The minimal setting would be -strong/-b[*],-em/-i[*],*[*]. 59 Best is to use the default cleanup by not specifying mce_valid_elements, 60 and then use extended_valid_elements to add to it. 61 */ 62 $valid_elements = apply_filters('mce_valid_elements', ''); 59 63 $invalid_elements = apply_filters('mce_invalid_elements', ''); 64 65 $extended_valid_elements = '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],bdo,code,col[*],colgroup[*],dfn,fieldset,form[*],input[*],kbd,label[*],legend[*],noscript,optgroup[*],option[*],q[cite|class],samp,textarea[*],title,var'; 66 67 $extended_valid_elements = apply_filters('mce_extended_valid_elements', $extended_valid_elements); 68 69 /* 70 The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu. 71 By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server. 72 The + sign marks the default language. 73 More information: 74 http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker 75 */ 76 $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'); 60 77 61 78 $plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen' ); … … 71 88 72 89 $ext_plugins = "\n"; 73 foreach ( $mce_external_plugins as $name => $url) {74 $plugins[] = '-' . $name;75 if ( $https ) str_replace('http://', 'https://', $url);76 77 $ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n";78 }79 90 if ( ! empty($mce_external_plugins) ) { 91 foreach ( $mce_external_plugins as $name => $url ) { 92 if ( $https ) str_replace('http://', 'https://', $url); 93 $plugins[] = '-' . $name; 94 $ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n"; 95 } 96 } 80 97 $plugins = implode($plugins, ','); 81 98 … … 106 123 'theme_advanced_buttons4' => "$mce_buttons_4", 107 124 'language' => "$mce_locale", 125 'spellchecker_languages' => "$mce_spellchecker_languages", 108 126 'theme_advanced_toolbar_location' => 'top', 109 127 'theme_advanced_toolbar_align' => 'left', … … 114 132 'relative_urls' => false, 115 133 'remove_script_host' => false, 116 'fix_list_elements' => true,117 'fix_table_elements' => true,118 134 'gecko_spellcheck' => true, 119 135 'entities' => '38,amp,60,lt,62,gt', … … 130 146 131 147 if ( $valid_elements ) $initArray['valid_elements'] = $valid_elements; 148 if ( $extended_valid_elements ) $initArray['extended_valid_elements'] = $extended_valid_elements; 132 149 if ( $invalid_elements ) $initArray['invalid_elements'] = $invalid_elements; 133 150 … … 241 258 // Write file 242 259 if ( '' != $cacheKey ) { 243 if ( $old_cache_max ) { 244 $keys_file = $cache_path . '/tinymce_compressed' . $cache_ext . '_key'; 245 $old_keys = getFileContents($keys_file); 260 if ( (int) $old_cache_max && is_dir($cache_path) ) { 261 262 $old_cache = array(); 263 $handle = opendir($cache_path); 264 while ( false !== ( $file = readdir($handle) ) ) { 265 if ( $file == '.' || $file == '..' ) continue; 266 $saved = filectime("$cache_path/$file"); 267 if ( strpos($file, 'tinymce_') !== false && substr($file, -3) == $cache_ext ) $old_cache["$saved"] = $file; 268 } 269 closedir($handle); 246 270 247 if ( '' != $old_keys ) { 248 $keys_ar = explode( "\n", $old_keys ); 249 if ( 1 >= $old_cache_max ) $old_keys_rem = $keys_ar; 250 else $old_keys_rem = array_slice( $keys_ar, ($old_cache_max - 1) ); 271 krsort($old_cache); 272 if ( 1 >= $old_cache_max ) $del_cache = $old_cache; 273 else $del_cache = array_slice( $old_cache, ($old_cache_max - 1) ); 251 274 252 foreach ( $old_keys_rem as $key ) { 253 $key = trim($key); 254 if ( 32 != strlen($key) ) continue; 255 $old_cache = $cache_path . '/tinymce_' . $key . $cache_ext; 256 @unlink($old_cache); 257 } 258 259 array_unshift( $keys_ar, $cacheKey ); 260 $keys_ar = array_slice( $keys_ar, 0, $old_cache_max ); 261 $cacheKey = trim( implode( "\n", $keys_ar ) ); 262 } 263 264 putFileContents( $keys_file, $cacheKey ); 275 foreach ( $del_cache as $key ) 276 @unlink("$cache_path/$key"); 265 277 } 266 278
Note: See TracChangeset
for help on using the changeset viewer.