Make WordPress Core

Ticket #11536: 11536.patch

File 11536.patch, 2.0 KB (added by husky, 15 years ago)

Show the rotate buttons, but disable them and add tooltip

  • wp-admin/includes/image-edit.php

     
    3939        <div class="imgedit-menu">
    4040                <div onclick="imageEdit.crop(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-crop disabled" title="<?php esc_attr_e( 'Crop' ); ?>"></div><?php
    4141
    42         if ( function_exists('imagerotate') ) { ?>
     42       // On some PHP installs the GD library doesn't supply imagerotate() because
     43       // the library is not the PHP version, but the official libray, which lacks
     44       // this function. See ticket #11536 in trac.
     45       if (function_exists('imagerotate') ) : ?>
     46                <div onclick="imageEdit.rotate(90, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-rleft" title="<?php esc_attr_e( 'Rotate couter-clockwise' ); ?>"></div>
     47                <div onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-rright" title="<?php esc_attr_e( 'Rotate clockwise' ); ?>"></div>
     48<?php else : ?>
     49            <div class="imgedit-rleft disabled" title="<?php esc_attr_e('Image rotation is not supported on your webhost'); ?>"></div>
     50            <div class="imgedit-rright disabled" title="<?php esc_attr_e('Image rotation is not supported on your webhost'); ?>"></div>
     51<?php endif; ?>
    4352
    44                 <div onclick="imageEdit.rotate(90, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-rleft" title="<?php esc_attr_e( 'Rotate counter-clockwise' ); ?>"></div>
    45                 <div onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-rright" title="<?php esc_attr_e( 'Rotate clockwise' ); ?>"></div><?php
    4653
    47         } ?>
    48 
    4954                <div onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv" title="<?php esc_attr_e( 'Flip vertically' ); ?>"></div>
    5055                <div onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph" title="<?php esc_attr_e( 'Flip horizontally' ); ?>"></div>
    5156