Permalink
Browse files

Show disabled image rotation buttons when imagerotate() is missing, p…

…rops husky and hakre, fixes #11536 for 2.9

git-svn-id: http://svn.automattic.com/wordpress/branches/2.9@12556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
azaozz
azaozz committed Dec 27, 2009
1 parent a313be2 commit f7b0a058fc5d2ba019a60ce32b35bafdc35f7c53
Showing with 9 additions and 5 deletions.
  1. +9 −5 wp-admin/includes/image-edit.php
@@ -39,12 +39,16 @@ function wp_image_editor($post_id, $msg = false) {
<div class="imgedit-menu">
<div onclick="imageEdit.crop(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-crop disabled" title="<?php esc_attr_e( 'Crop' ); ?>"></div><?php
+ // On some setups GD library does not provide imagerotate() - Ticket #11536
if ( function_exists('imagerotate') ) { ?>
-
- <div onclick="imageEdit.rotate(90, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-rleft" title="<?php esc_attr_e( 'Rotate counter-clockwise' ); ?>"></div>
- <div onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-rright" title="<?php esc_attr_e( 'Rotate clockwise' ); ?>"></div><?php
-
- } ?>
+ <div class="imgedit-rleft" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)" title="<?php esc_attr_e( 'Rotate counter-clockwise' ); ?>"></div>
+ <div class="imgedit-rright" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)" title="<?php esc_attr_e( 'Rotate clockwise' ); ?>"></div>
+<?php } else {
+ $note_gdlib = esc_attr__('Image rotation is not supported by your web host (function imagerotate() is missing)');
+?>
+ <div class="imgedit-rleft disabled" title="<?php echo $note_gdlib; ?>"></div>
+ <div class="imgedit-rright disabled" title="<?php echo $note_gdlib; ?>"></div>
+<?php } ?>
<div onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv" title="<?php esc_attr_e( 'Flip vertically' ); ?>"></div>
<div onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph" title="<?php esc_attr_e( 'Flip horizontally' ); ?>"></div>

0 comments on commit f7b0a05

Please sign in to comment.