| 51 | | <div class="imgedit-settings"> |
| | 51 | <div class="imgedit-panel-content wp-clearfix"> |
| | 52 | <?php echo $note; ?> |
| | 53 | <div class="imgedit-menu wp-clearfix"> |
| | 54 | <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button> |
| | 55 | <?php |
| | 56 | |
| | 57 | // On some setups GD library does not provide imagerotate() - Ticket #11536 |
| | 58 | if ( wp_image_editor_supports( |
| | 59 | array( |
| | 60 | 'mime_type' => get_post_mime_type( $post_id ), |
| | 61 | 'methods' => array( 'rotate' ), |
| | 62 | ) |
| | 63 | ) ) { |
| | 64 | $note_no_rotate = ''; |
| | 65 | ?> |
| | 66 | <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate left' ); ?></button> |
| | 67 | <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate right' ); ?></button> |
| | 68 | <?php |
| | 69 | } else { |
| | 70 | $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>'; |
| | 71 | ?> |
| | 72 | <button type="button" class="imgedit-rleft button disabled" disabled></button> |
| | 73 | <button type="button" class="imgedit-rright button disabled" disabled></button> |
| | 74 | <?php } ?> |
| | 75 | |
| | 76 | <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><?php esc_html_e( 'Flip vertical' ); ?></button> |
| | 77 | <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><?php esc_html_e( 'Flip horizontal' ); ?></button> |
| | 78 | |
| | 79 | <br class="imgedit-undo-redo-separator" /> |
| | 80 | <button type="button" id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo button disabled" disabled><?php esc_html_e( 'Undo' ); ?></button> |
| | 81 | <button type="button" id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo button disabled" disabled><?php esc_html_e( 'Redo' ); ?></button> |
| | 82 | <?php echo $note_no_rotate; ?> |
| | 83 | </div> |
| | 84 | |
| | 85 | <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" /> |
| | 86 | <input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" /> |
| | 87 | <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" /> |
| | 88 | <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" /> |
| | 89 | <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" /> |
| | 90 | <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> |
| | 91 | |
| | 92 | <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> |
| | 93 | <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&_ajax_nonce=<?php echo $nonce; ?>&postid=<?php echo $post_id; ?>&rand=<?php echo rand( 1, 99999 ); ?>" alt="" /> |
| | 94 | </div> |
| | 95 | |
| | 96 | <div class="imgedit-submit"> |
| | 97 | <input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button imgedit-cancel-btn" value="<?php esc_attr_e( 'Cancel' ); ?>" /> |
| | 98 | <input type="button" onclick="imageEdit.save(<?php echo "$post_id, '$nonce'"; ?>)" disabled="disabled" class="button button-primary imgedit-submit-btn" value="<?php esc_attr_e( 'Save' ); ?>" /> |
| | 99 | </div> |
| | 100 | </div> |
| | 101 | |
| | 102 | <div class="imgedit-settings wp-clearfix"> |
| 196 | | <div class="imgedit-panel-content wp-clearfix"> |
| 197 | | <?php echo $note; ?> |
| 198 | | <div class="imgedit-menu wp-clearfix"> |
| 199 | | <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button> |
| 200 | | <?php |
| 201 | | |
| 202 | | // On some setups GD library does not provide imagerotate() - Ticket #11536 |
| 203 | | if ( wp_image_editor_supports( |
| 204 | | array( |
| 205 | | 'mime_type' => get_post_mime_type( $post_id ), |
| 206 | | 'methods' => array( 'rotate' ), |
| 207 | | ) |
| 208 | | ) ) { |
| 209 | | $note_no_rotate = ''; |
| 210 | | ?> |
| 211 | | <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate left' ); ?></button> |
| 212 | | <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate right' ); ?></button> |
| 213 | | <?php |
| 214 | | } else { |
| 215 | | $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>'; |
| 216 | | ?> |
| 217 | | <button type="button" class="imgedit-rleft button disabled" disabled></button> |
| 218 | | <button type="button" class="imgedit-rright button disabled" disabled></button> |
| 219 | | <?php } ?> |
| 220 | | |
| 221 | | <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><?php esc_html_e( 'Flip vertical' ); ?></button> |
| 222 | | <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><?php esc_html_e( 'Flip horizontal' ); ?></button> |
| 223 | | |
| 224 | | <br class="imgedit-undo-redo-separator" /> |
| 225 | | <button type="button" id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo button disabled" disabled><?php esc_html_e( 'Undo' ); ?></button> |
| 226 | | <button type="button" id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo button disabled" disabled><?php esc_html_e( 'Redo' ); ?></button> |
| 227 | | <?php echo $note_no_rotate; ?> |
| 228 | | </div> |
| 229 | | |
| 230 | | <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" /> |
| 231 | | <input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" /> |
| 232 | | <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" /> |
| 233 | | <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" /> |
| 234 | | <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" /> |
| 235 | | <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> |
| 236 | | |
| 237 | | <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> |
| 238 | | <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&_ajax_nonce=<?php echo $nonce; ?>&postid=<?php echo $post_id; ?>&rand=<?php echo rand( 1, 99999 ); ?>" alt="" /> |
| 239 | | </div> |
| 240 | | |
| 241 | | <div class="imgedit-submit"> |
| 242 | | <input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button imgedit-cancel-btn" value="<?php esc_attr_e( 'Cancel' ); ?>" /> |
| 243 | | <input type="button" onclick="imageEdit.save(<?php echo "$post_id, '$nonce'"; ?>)" disabled="disabled" class="button button-primary imgedit-submit-btn" value="<?php esc_attr_e( 'Save' ); ?>" /> |
| 244 | | </div> |