WordPress.org

Make WordPress Core

Changeset 12556


Ignore:
Timestamp:
12/27/2009 09:27:00 PM (10 years ago)
Author:
azaozz
Message:

Show disabled image rotation buttons when imagerotate() is missing, props husky and hakre, fixes #11536 for 2.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.9/wp-admin/includes/image-edit.php

    r12482 r12556  
    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    // On some setups GD library does not provide imagerotate() - Ticket #11536   
    4243    if ( function_exists('imagerotate') ) { ?>
    43 
    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
    46 
    47     } ?>
     44        <div class="imgedit-rleft"  onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)" title="<?php esc_attr_e( 'Rotate counter-clockwise' ); ?>"></div>
     45        <div class="imgedit-rright" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)" title="<?php esc_attr_e( 'Rotate clockwise' ); ?>"></div>
     46<?php } else {
     47        $note_gdlib = esc_attr__('Image rotation is not supported by your web host (function imagerotate() is missing)');
     48?>
     49        <div class="imgedit-rleft disabled"  title="<?php echo $note_gdlib; ?>"></div>
     50        <div class="imgedit-rright disabled" title="<?php echo $note_gdlib; ?>"></div>
     51<?php } ?>
    4852
    4953        <div onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv" title="<?php esc_attr_e( 'Flip vertically' ); ?>"></div>
Note: See TracChangeset for help on using the changeset viewer.