Changeset 8512 for trunk/wp-includes/js/tinymce/tiny_mce_config.php
- Timestamp:
- 07/31/2008 04:01:30 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/tinymce/tiny_mce_config.php
r8358 r8512 181 181 // Best is to use the default cleanup by not specifying valid_elements, as TinyMCE contains full set of XHTML 1.0. 182 182 183 // support for deprecated actions184 ob_start();185 do_action('mce_options');186 $mce_deprecated = ob_get_contents();187 ob_end_clean();188 189 $mce_deprecated = (string) $mce_deprecated;190 if ( strlen( $mce_deprecated ) < 10 || ! strpos( $mce_deprecated, ':' ) || ! strpos( $mce_deprecated, ',' ) )191 $mce_deprecated = '';192 193 183 // Settings for the gzip compression and cache 194 184 $disk_cache = ( ! isset($initArray['disk_cache']) || false == $initArray['disk_cache'] ) ? false : true; … … 226 216 if ( $disk_cache ) { 227 217 228 $cacheKey = apply_filters('tiny_mce_version', '200807 12');218 $cacheKey = apply_filters('tiny_mce_version', '20080730'); 229 219 230 220 foreach ( $initArray as $v ) … … 269 259 $mce_options .= $k . ':"' . $v . '",'; 270 260 271 if ( $mce_deprecated ) $mce_options .= $mce_deprecated;272 273 261 $mce_options = rtrim( trim($mce_options), '\n\r,' ); 274 262 275 $content = 'var tinyMCEPreInit = { settings : { themes : "' . $theme . '", plugins : "' . $initArray['plugins'] . '", languages : "' . $language . '", debug : false }, base : "' . $baseurl . '", suffix : "", query : "ver=311" };'; 263 // Pre-init settings 264 $content = 'var tinyMCEPreInit = { base : "'. $baseurl .'", suffix : "", query : "ver=311b", mceInit : {' . $mce_options . '}};' . "\n"; 276 265 277 266 // Load patch … … 280 269 // Add core 281 270 $content .= getFileContents( 'tiny_mce.js' ); 282 283 // Patch loading functions284 $content .= 'tinyMCEPreInit.start();';285 271 286 272 // Add all languages (WP) … … 295 281 $content .= getFileContents( 'plugins/' . $plugin . '/editor_plugin.js' ); 296 282 297 // Add external plugins and init 298 $content .= $ext_plugins . 'tinyMCE.init({' . $mce_options . '});'; 283 // Add external plugins 284 $content .= $ext_plugins; 285 286 // Mark translations as done 287 $content .= 'tinyMCEPreInit.start();' . "\n"; 288 289 // Init 290 $content .= 'tinyMCE.init(tinyMCEPreInit.mceInit);'; 299 291 300 292 // Generate GZIP'd content … … 308 300 309 301 // Write file 310 if ( '' != $cacheKey && is_dir($cache_path) && is_readable($cache_path) ) { 311 302 if ( '' != $cacheKey && is_dir($cache_path) && is_readable($cache_path) ) { 312 303 $old_cache = array(); 313 304 $handle = opendir($cache_path); 314 305 while ( false !== ( $file = readdir($handle) ) ) { 315 306 if ( $file == '.' || $file == '..' ) continue; 316 $saved = filectime("$cache_path/$file"); 317 if ( strpos($file, 'tinymce_') !== false && substr($file, -3) == $cache_ext ) $old_cache["$saved"] = $file; 307 $old_cache[] = filemtime("$cache_path/$file") . strval($file); 318 308 } 319 309 closedir($handle); 320 321 krsort($old_cache);310 311 rsort($old_cache); 322 312 if ( 1 >= $old_cache_max ) $del_cache = $old_cache; 323 313 else $del_cache = array_slice( $old_cache, ($old_cache_max - 1) ); 324 314 325 foreach ( $del_cache as $key ) 315 foreach ( $del_cache as $key ) { 316 $key = substr($key, 10); 326 317 @unlink("$cache_path/$key"); 327 318 } 328 319 putFileContents( $cache_file, $content ); 329 320 }
Note: See TracChangeset
for help on using the changeset viewer.