Ticket #6812: disable-captions-support.patch
File disable-captions-support.patch, 10.3 KB (added by , 16 years ago) |
---|
-
wp-admin/gears-manifest.php
64 64 ?> 65 65 { 66 66 "betaManifestVersion" : 1, 67 "version" : "<?php echo $man_version; ?>_20080710 ",67 "version" : "<?php echo $man_version; ?>_20080710a", 68 68 "entries" : [ 69 69 <?php echo $defaults; ?> 70 70 … … 131 131 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311" }, 132 132 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" }, 133 133 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" }, 134 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311 c" },134 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311d" }, 135 135 { "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" }, 136 136 { "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" }, 137 137 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311" }, … … 148 148 { "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" }, 149 149 { "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, 150 150 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, 151 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311 c" },151 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311d" }, 152 152 { "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, 153 153 154 154 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" }, … … 161 161 { "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" }, 162 162 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, 163 163 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, 164 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311 c" },164 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311d" }, 165 165 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, 166 166 { "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, 167 167 -
wp-admin/includes/media.php
67 67 68 68 function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { 69 69 70 if ( empty($alt) ) return $html;70 if ( empty($alt) || ( defined('DISABLE_IMAGE_CAPTIONS') && true == DISABLE_IMAGE_CAPTIONS ) ) return $html; 71 71 $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; 72 72 73 73 preg_match( '/width="([0-9]+)/', $html, $matches ); … … 508 508 function image_attachment_fields_to_edit($form_fields, $post) { 509 509 if ( substr($post->post_mime_type, 0, 5) == 'image' ) { 510 510 $form_fields['post_title']['required'] = true; 511 $form_fields['post_excerpt']['label'] = __('Caption');512 $form_fields['post_excerpt']['helps'][] = __('Alternate text, e.g. "The Mona Lisa"');513 511 512 if ( defined('DISABLE_IMAGE_CAPTIONS') && true == DISABLE_IMAGE_CAPTIONS ) { 513 $form_fields['post_excerpt']['label'] = __('Alternate Text'); 514 $form_fields['post_excerpt']['helps'][] = __('Alt text for the image, e.g. "The Mona Lisa"'); 515 } else { 516 $form_fields['post_excerpt']['label'] = __('Caption'); 517 $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); 518 } 519 514 520 $form_fields['post_content']['label'] = __('Description'); 515 521 516 522 $thumb = wp_get_attachment_thumb_url($post->ID); … … 598 604 $file = wp_get_attachment_url($post->ID); 599 605 $link = get_attachment_link($post->ID); 600 606 607 if ( defined('DISABLE_IMAGE_CAPTIONS') && true == DISABLE_IMAGE_CAPTIONS ) 608 $alt = __('Alternate Text'); 609 else 610 $alt = __('Caption'); 611 601 612 $form_fields = array( 602 613 'post_title' => array( 603 614 'label' => __('Title'), 604 615 'value' => $edit_post->post_title, 605 616 ), 606 617 'post_excerpt' => array( 607 'label' => __('Caption'),618 'label' => $alt, 608 619 'value' => $edit_post->post_excerpt, 609 620 ), 610 621 'post_content' => array( … … 1007 1018 1008 1019 if ( f.alt.value ) { 1009 1020 alt = f.alt.value.replace(/['"<>]+/g, ''); 1021 <?php if ( ! defined('DISABLE_IMAGE_CAPTIONS') || true != DISABLE_IMAGE_CAPTIONS ) { ?> 1010 1022 caption = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); 1023 <?php } ?> 1011 1024 } 1012 1025 1013 1026 cls = caption ? '' : ' class="'+t.align+'"'; … … 1262 1275 } 1263 1276 1264 1277 function type_form_image() { 1265 return'1278 $form = ' 1266 1279 <table class="describe"><tbody> 1267 1280 <tr> 1268 1281 <th valign="top" scope="row" class="label" style="width:120px;"> … … 1279 1292 </th> 1280 1293 <td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td> 1281 1294 </tr> 1295 '; 1296 if ( defined('DISABLE_IMAGE_CAPTIONS') && true == DISABLE_IMAGE_CAPTIONS ) { 1297 $form .= ' 1298 <tr> 1299 <th valign="top" scope="row" class="label"> 1300 <span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span> 1301 </th> 1302 <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" /> 1303 <p class="help">' . __('Alt text for the image, e.g. "The Mona Lisa"') . '</p></td> 1304 </tr> 1305 '; 1282 1306 1307 } else { 1308 $form .= ' 1283 1309 <tr> 1284 1310 <th valign="top" scope="row" class="label"> 1285 1311 <span class="alignleft"><label for="alt">' . __('Image Caption') . '</label></span> … … 1287 1313 <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" /> 1288 1314 <p class="help">' . __('Also used as alternate text for the image') . '</p></td> 1289 1315 </tr> 1290 1316 '; 1317 } 1318 $form .= ' 1291 1319 <tr class="align"> 1292 1320 <th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th> 1293 1321 <td class="field"> … … 1321 1349 </tr> 1322 1350 </tbody></table> 1323 1351 '; 1352 1353 return $form; 1324 1354 } 1325 1355 1326 1356 function type_form_audio() { -
wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
4 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 5 <title></title> 6 6 7 <script type="text/javascript" src="js/editimage.js?ver=311 c"></script>7 <script type="text/javascript" src="js/editimage.js?ver=311d"></script> 8 8 <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script> 9 9 10 <link rel="stylesheet" href="css/editimage.css?ver=311 c" type="text/css" media="all" />10 <link rel="stylesheet" href="css/editimage.css?ver=311d" type="text/css" media="all" /> 11 11 <link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta3" type="text/css" media="all" /> 12 12 <script type="text/javascript"> 13 13 if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') ) … … 85 85 </td> 86 86 </tr> 87 87 88 <tr >88 <tr id="cap_field"> 89 89 <th valign="top" scope="row" class="label"> 90 90 <label for="img_cap"> 91 91 <span class="alignleft">{#wpeditimage.caption}</span> -
wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
247 247 setup : function() { 248 248 var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom, DL, caption = null; 249 249 document.dir = tinyMCEPopup.editor.getParam('directionality',''); 250 251 if ( ! tinyMCEPopup.editor.getParam('wpeditimage_do_captions', true) ) 252 t.I('cap_field').style.display = 'none'; 253 250 254 tinyMCEPopup.restoreSelection(); 251 255 el = ed.selection.getNode(); 252 256 if (el.nodeName != 'IMG') return; -
wp-includes/js/tinymce/tiny_mce_config.php
130 130 $mce_buttons_4 = apply_filters('mce_buttons_4', array()); 131 131 $mce_buttons_4 = implode($mce_buttons_4, ','); 132 132 133 $do_captions = ( defined('DISABLE_IMAGE_CAPTIONS') && true == DISABLE_IMAGE_CAPTIONS ) ? false : true; 134 133 135 // TinyMCE init settings 134 136 $initArray = array ( 135 137 'mode' => 'none', … … 163 165 'tab_focus' => ':next', 164 166 'content_css' => "$mce_css", 165 167 'save_callback' => 'switchEditors.saveCallback', 168 'wpeditimage_do_captions' => $do_captions, 166 169 'plugins' => "$plugins", 167 170 // pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init" 168 171 'disk_cache' => true, … … 222 225 // Setup cache info 223 226 if ( $disk_cache ) { 224 227 225 $cacheKey = apply_filters('tiny_mce_version', '200807 09');228 $cacheKey = apply_filters('tiny_mce_version', '20080710'); 226 229 227 230 foreach ( $initArray as $v ) 228 231 $cacheKey .= $v; -
wp-includes/media.php
353 353 add_shortcode('wp_caption', 'img_caption_shortcode'); 354 354 355 355 function img_caption_shortcode($attr, $content = null) { 356 356 357 if ( defined('DISABLE_IMAGE_CAPTIONS') && true == DISABLE_IMAGE_CAPTIONS ) 358 return $content; 359 357 360 // Allow plugins/themes to override the default caption template. 358 361 $output = apply_filters('img_caption_shortcode', '', $attr, $content); 359 362 if ( $output != '' ) -
wp-includes/script-loader.php
37 37 $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080706' ); 38 38 39 39 // Modify this version when tinyMCE plugins are changed. 40 $mce_version = apply_filters('tiny_mce_version', '200807 09');40 $mce_version = apply_filters('tiny_mce_version', '20080710'); 41 41 $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); 42 42 43 43 $scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');