Make WordPress Core

Changeset 9469


Ignore:
Timestamp:
11/02/2008 02:12:26 AM (16 years ago)
Author:
azaozz
Message:

Remove outdated TinyMCE files, fix loading of translations for default plugins, fixes #7994

Location:
trunk
Files:
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r9456 r9469  
    8282    if ( ! isset($post_data['post_status']) )
    8383        $post_data['post_status'] = $previous_status;
    84    
     84
    8585    if (!isset( $post_data['comment_status'] ))
    8686        $post_data['comment_status'] = 'closed';
     
    257257            continue;
    258258        }
    259        
     259
    260260        if ( wp_check_post_lock( $post_ID ) ) {
    261261            $locked[] = $post_ID;
     
    10471047    if ( ! user_can_richedit() )
    10481048        return;
    1049    
     1049
    10501050    $baseurl = includes_url('js/tinymce');
    10511051
     
    10621062    */
    10631063    $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');
    1064    
     1064
    10651065    if ( $teeny ) {
    10661066        $plugins = apply_filters( 'teeny_mce_plugins', array('safari', 'inlinepopups', 'media', 'autosave', 'fullscreen') );
     
    10681068    } else {
    10691069        $plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage' );
    1070    
     1070
    10711071        /*
    10721072        The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'.
     
    10771077        */
    10781078        $mce_external_plugins = apply_filters('mce_external_plugins', array());
    1079        
     1079
    10801080        $ext_plugins = "\n";
    10811081        if ( ! empty($mce_external_plugins) ) {
    1082        
     1082
    10831083            /*
    10841084            The following filter loads external language files for TinyMCE plugins.
     
    10911091            */
    10921092            $mce_external_languages = apply_filters('mce_external_languages', array());
    1093        
     1093
    10941094            $loaded_langs = array();
    10951095            $strings = '';
    1096        
     1096
    10971097            if ( ! empty($mce_external_languages) ) {
    10981098                foreach ( $mce_external_languages as $name => $path ) {
     
    11041104                }
    11051105            }
    1106        
     1106
    11071107            foreach ( $mce_external_plugins as $name => $url ) {
    1108        
     1108
    11091109                if ( is_ssl() ) $url = str_replace('http://', 'https://', $url);
    1110        
     1110
    11111111                $plugins[] = '-' . $name;
    1112        
     1112
    11131113                $plugurl = dirname($url);
    1114                 $strings = '';
     1114                $strings = $str1 = $str2 = '';
    11151115                if ( ! in_array($name, $loaded_langs) ) {
    1116                     $plugpath = str_replace( WP_PLUGIN_URL, '', $plugurl );
    1117                     $plugpath = WP_PLUGIN_DIR . $plugpath;
     1116                    $path = preg_replace( '|.+?' . basename(WP_PLUGIN_URL) . '|', '', $plugurl );
     1117                    $path = WP_PLUGIN_DIR . $path . '/langs/';
    11181118
    11191119                    if ( function_exists('realpath') )
    11201120                        $plugpath = realpath($plugpath);
    11211121
    1122                     $path = $plugpath . '/langs/' . $mce_locale . '.js';
    1123                     $path2 = $plugpath . '/langs/en.js';
    1124 
    1125                     if ( is_file($path) && is_readable($path) ) {
    1126                         $strings = @file_get_contents($path);
    1127                     } elseif ( 'en' != $mce_locale && is_file($path2) && is_readable($path2) ) {
    1128                         $strings = @file_get_contents($path2);
    1129                         $strings = preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $strings, 1 );
     1122                    if ( is_file($path . $mce_locale . '.js') )
     1123                        $strings .= @file_get_contents($path . $mce_locale . '.js');
     1124
     1125                    if ( is_file($path . $mce_locale . '_dlg.js') )
     1126                        $strings .= @file_get_contents($path . $mce_locale . '_dlg.js');
     1127
     1128                    if ( 'en' != $mce_locale && empty($strings) ) {
     1129                        if ( is_file($path . 'en.js') ) {
     1130                            $str1 = @file_get_contents($path . 'en.js');
     1131                            $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 );
     1132                        }
     1133
     1134                        if ( is_file($path . 'en_dlg.js') ) {
     1135                            $str2 = @file_get_contents($path . 'en_dlg.js');
     1136                            $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 );
     1137                        }
    11301138                    }
    11311139
    1132                     if ( $strings )
     1140                    if ( ! empty($strings) )
    11331141                        $ext_plugins .= "\n" . $strings . "\n";
    11341142                }
     
    11411149
    11421150    $plugins = implode($plugins, ',');
    1143    
     1151
    11441152    if ( $teeny ) {
    11451153        $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold, italic, underline, blockquote, separator, strikethrough, bullist, numlist,justifyleft, justifycenter, justifyright, undo, redo, link, unlink, fullscreen') );
     
    11491157        $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ));
    11501158        $mce_buttons = implode($mce_buttons, ',');
    1151        
     1159
    11521160        $mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' ));
    11531161        $mce_buttons_2 = implode($mce_buttons_2, ',');
    1154        
     1162
    11551163        $mce_buttons_3 = apply_filters('mce_buttons_3', array());
    11561164        $mce_buttons_3 = implode($mce_buttons_3, ',');
    1157        
     1165
    11581166        $mce_buttons_4 = apply_filters('mce_buttons_4', array());
    11591167        $mce_buttons_4 = implode($mce_buttons_4, ',');
    11601168    }
    11611169    $no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false;
    1162    
     1170
    11631171    // TinyMCE init settings
    11641172    $initArray = array (
     
    11971205        'plugins' => "$plugins"
    11981206    );
    1199    
     1207
    12001208    // For people who really REALLY know what they're doing with TinyMCE
    12011209    // You can modify initArray to add, remove, change elements of the config before tinyMCE.init
     
    12181226    foreach ( $initArray as $k => $v )
    12191227        $mce_options .= $k . ':"' . $v . '", ';
    1220    
     1228
    12211229    $mce_options = rtrim( trim($mce_options), '\n\r,' ); ?>
    12221230
    12231231<script type="text/javascript">
    12241232/* <![CDATA[ */
    1225 
    12261233tinyMCEPreInit = {
    12271234    base : "<?php echo $baseurl; ?>",
     
    12321239    go : function() {
    12331240        var t = this, sl = tinymce.ScriptLoader, ln = t.mceInit.language, th = t.mceInit.theme, pl = t.mceInit.plugins;
    1234    
     1241
    12351242        sl.markDone(t.base + '/langs/' + ln + '.js');
    1236    
     1243
    12371244        sl.markDone(t.base + '/themes/' + th + '/langs/' + ln + '.js');
    12381245        sl.markDone(t.base + '/themes/' + th + '/langs/' + ln + '_dlg.js');
    1239    
     1246
    12401247        tinymce.each(pl.split(','), function(n) {
    12411248            if (n && n.charAt(0) != '-') {
     
    12451252        });
    12461253    },
    1247    
     1254
    12481255    load_ext : function(url,lang) {
    12491256        var sl = tinymce.ScriptLoader;
    1250    
     1257
    12511258        sl.markDone(url + '/langs/' + lang + '.js');
    12521259        sl.markDone(url + '/langs/' + lang + '_dlg.js');
    12531260    }
    12541261};
    1255 
    12561262/* ]]> */
    12571263</script>
    12581264<script type="text/javascript" src="<?php echo $baseurl; ?>/tiny_mce.js?ver=<?php echo $ver; ?>"></script>
    1259 <?php if ( 'en' == $language ) { ?>
    1260     <script type="text/javascript" src="<?php echo $baseurl; ?>/langs/wp-langs-en.js?ver=<?php echo $ver; ?>"></script>
     1265<?php if ( 'en' != $language && isset($lang) ) { ?>
     1266<script type="text/javascript">
     1267<?php echo $lang; ?>
     1268</script>
     1269<?php } else { ?>
     1270<script type="text/javascript" src="<?php echo $baseurl; ?>/langs/wp-langs-en.js?ver=<?php echo $ver; ?>"></script>
    12611271<?php } ?>
    12621272<script type="text/javascript">
    1263 <?php if ( 'en' != $language && isset($lang) ) echo $lang; ?>
    1264 
    12651273<?php if ( $ext_plugins ) echo $ext_plugins; ?>
    1266    
     1274
    12671275// Mark translations as done
    12681276tinyMCEPreInit.go();
     
    12701278// Init
    12711279tinyMCE.init(tinyMCEPreInit.mceInit);
    1272 
    12731280</script>
    12741281
Note: See TracChangeset for help on using the changeset viewer.