Changeset 9469
- Timestamp:
- 11/02/2008 02:12:26 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r9456 r9469 82 82 if ( ! isset($post_data['post_status']) ) 83 83 $post_data['post_status'] = $previous_status; 84 84 85 85 if (!isset( $post_data['comment_status'] )) 86 86 $post_data['comment_status'] = 'closed'; … … 257 257 continue; 258 258 } 259 259 260 260 if ( wp_check_post_lock( $post_ID ) ) { 261 261 $locked[] = $post_ID; … … 1047 1047 if ( ! user_can_richedit() ) 1048 1048 return; 1049 1049 1050 1050 $baseurl = includes_url('js/tinymce'); 1051 1051 … … 1062 1062 */ 1063 1063 $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 1065 1065 if ( $teeny ) { 1066 1066 $plugins = apply_filters( 'teeny_mce_plugins', array('safari', 'inlinepopups', 'media', 'autosave', 'fullscreen') ); … … 1068 1068 } else { 1069 1069 $plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage' ); 1070 1070 1071 1071 /* 1072 1072 The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'. … … 1077 1077 */ 1078 1078 $mce_external_plugins = apply_filters('mce_external_plugins', array()); 1079 1079 1080 1080 $ext_plugins = "\n"; 1081 1081 if ( ! empty($mce_external_plugins) ) { 1082 1082 1083 1083 /* 1084 1084 The following filter loads external language files for TinyMCE plugins. … … 1091 1091 */ 1092 1092 $mce_external_languages = apply_filters('mce_external_languages', array()); 1093 1093 1094 1094 $loaded_langs = array(); 1095 1095 $strings = ''; 1096 1096 1097 1097 if ( ! empty($mce_external_languages) ) { 1098 1098 foreach ( $mce_external_languages as $name => $path ) { … … 1104 1104 } 1105 1105 } 1106 1106 1107 1107 foreach ( $mce_external_plugins as $name => $url ) { 1108 1108 1109 1109 if ( is_ssl() ) $url = str_replace('http://', 'https://', $url); 1110 1110 1111 1111 $plugins[] = '-' . $name; 1112 1112 1113 1113 $plugurl = dirname($url); 1114 $strings = '';1114 $strings = $str1 = $str2 = ''; 1115 1115 if ( ! in_array($name, $loaded_langs) ) { 1116 $p lugpath = str_replace( WP_PLUGIN_URL, '', $plugurl );1117 $p lugpath = WP_PLUGIN_DIR . $plugpath;1116 $path = preg_replace( '|.+?' . basename(WP_PLUGIN_URL) . '|', '', $plugurl ); 1117 $path = WP_PLUGIN_DIR . $path . '/langs/'; 1118 1118 1119 1119 if ( function_exists('realpath') ) 1120 1120 $plugpath = realpath($plugpath); 1121 1121 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 } 1130 1138 } 1131 1139 1132 if ( $strings)1140 if ( ! empty($strings) ) 1133 1141 $ext_plugins .= "\n" . $strings . "\n"; 1134 1142 } … … 1141 1149 1142 1150 $plugins = implode($plugins, ','); 1143 1151 1144 1152 if ( $teeny ) { 1145 1153 $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold, italic, underline, blockquote, separator, strikethrough, bullist, numlist,justifyleft, justifycenter, justifyright, undo, redo, link, unlink, fullscreen') ); … … 1149 1157 $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' )); 1150 1158 $mce_buttons = implode($mce_buttons, ','); 1151 1159 1152 1160 $mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' )); 1153 1161 $mce_buttons_2 = implode($mce_buttons_2, ','); 1154 1162 1155 1163 $mce_buttons_3 = apply_filters('mce_buttons_3', array()); 1156 1164 $mce_buttons_3 = implode($mce_buttons_3, ','); 1157 1165 1158 1166 $mce_buttons_4 = apply_filters('mce_buttons_4', array()); 1159 1167 $mce_buttons_4 = implode($mce_buttons_4, ','); 1160 1168 } 1161 1169 $no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false; 1162 1170 1163 1171 // TinyMCE init settings 1164 1172 $initArray = array ( … … 1197 1205 'plugins' => "$plugins" 1198 1206 ); 1199 1207 1200 1208 // For people who really REALLY know what they're doing with TinyMCE 1201 1209 // You can modify initArray to add, remove, change elements of the config before tinyMCE.init … … 1218 1226 foreach ( $initArray as $k => $v ) 1219 1227 $mce_options .= $k . ':"' . $v . '", '; 1220 1228 1221 1229 $mce_options = rtrim( trim($mce_options), '\n\r,' ); ?> 1222 1230 1223 1231 <script type="text/javascript"> 1224 1232 /* <![CDATA[ */ 1225 1226 1233 tinyMCEPreInit = { 1227 1234 base : "<?php echo $baseurl; ?>", … … 1232 1239 go : function() { 1233 1240 var t = this, sl = tinymce.ScriptLoader, ln = t.mceInit.language, th = t.mceInit.theme, pl = t.mceInit.plugins; 1234 1241 1235 1242 sl.markDone(t.base + '/langs/' + ln + '.js'); 1236 1243 1237 1244 sl.markDone(t.base + '/themes/' + th + '/langs/' + ln + '.js'); 1238 1245 sl.markDone(t.base + '/themes/' + th + '/langs/' + ln + '_dlg.js'); 1239 1246 1240 1247 tinymce.each(pl.split(','), function(n) { 1241 1248 if (n && n.charAt(0) != '-') { … … 1245 1252 }); 1246 1253 }, 1247 1254 1248 1255 load_ext : function(url,lang) { 1249 1256 var sl = tinymce.ScriptLoader; 1250 1257 1251 1258 sl.markDone(url + '/langs/' + lang + '.js'); 1252 1259 sl.markDone(url + '/langs/' + lang + '_dlg.js'); 1253 1260 } 1254 1261 }; 1255 1256 1262 /* ]]> */ 1257 1263 </script> 1258 1264 <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> 1261 1271 <?php } ?> 1262 1272 <script type="text/javascript"> 1263 <?php if ( 'en' != $language && isset($lang) ) echo $lang; ?>1264 1265 1273 <?php if ( $ext_plugins ) echo $ext_plugins; ?> 1266 1274 1267 1275 // Mark translations as done 1268 1276 tinyMCEPreInit.go(); … … 1270 1278 // Init 1271 1279 tinyMCE.init(tinyMCEPreInit.mceInit); 1272 1273 1280 </script> 1274 1281
Note: See TracChangeset
for help on using the changeset viewer.