| 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 | |
198 | | <div class="imgedit-panel-content wp-clearfix"> |
199 | | <?php echo $note; ?> |
200 | | <div class="imgedit-menu wp-clearfix"> |
201 | | <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button> |
202 | | <?php |
203 | | |
204 | | // On some setups GD library does not provide imagerotate() - Ticket #11536. |
205 | | if ( wp_image_editor_supports( |
206 | | array( |
207 | | 'mime_type' => get_post_mime_type( $post_id ), |
208 | | 'methods' => array( 'rotate' ), |
209 | | ) |
210 | | ) ) { |
211 | | $note_no_rotate = ''; |
212 | | ?> |
213 | | <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate left' ); ?></button> |
214 | | <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate right' ); ?></button> |
215 | | <?php |
216 | | } else { |
217 | | $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>'; |
218 | | ?> |
219 | | <button type="button" class="imgedit-rleft button disabled" disabled></button> |
220 | | <button type="button" class="imgedit-rright button disabled" disabled></button> |
221 | | <?php } ?> |
222 | | |
223 | | <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><?php esc_html_e( 'Flip vertical' ); ?></button> |
224 | | <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><?php esc_html_e( 'Flip horizontal' ); ?></button> |
225 | | |
226 | | <br class="imgedit-undo-redo-separator" /> |
227 | | <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> |
228 | | <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> |
229 | | <?php echo $note_no_rotate; ?> |
230 | | </div> |
231 | | |
232 | | <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" /> |
233 | | <input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" /> |
234 | | <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" /> |
235 | | <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" /> |
236 | | <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" /> |
237 | | <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> |
238 | | |
239 | | <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> |
240 | | <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="" /> |
241 | | </div> |
242 | | |
243 | | <div class="imgedit-submit"> |
244 | | <input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button imgedit-cancel-btn" value="<?php esc_attr_e( 'Cancel' ); ?>" /> |
245 | | <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' ); ?>" /> |
246 | | </div> |