| 1 |
<?php $sizes = get_intermediate_image_sizes(); ?> |
| 2 |
<form id="coords" action="" method="post" enctype="multipart/form-data"> |
| 3 |
<input type="hidden" name="th_edit_option" id="th_edit_option" value="imageCrop"> |
| 4 |
<?php wp_nonce_field('th_edit_save_action', 'th_edit_save_action_field'); ?> |
| 5 |
<table width="100%" border="0" class="ap-table"> |
| 6 |
<tbody> |
| 7 |
<tr> |
| 8 |
<td> |
| 9 |
<div class="tools"> |
| 10 |
<storng class="selected-tool"><?php _e('Tools', 'thumbnail-editor'); ?></storng> |
| 11 |
<img src="<?php echo plugins_url(THE_PLUGIN_DIR . '/images/crop.png'); ?>" class="tool-item" alt="Crop" onClick="ImageEditor('crop');" title="Crop (Drag inside the image to Crop)" id="crop-tool"> |
| 12 |
<img src="<?php echo plugins_url(THE_PLUGIN_DIR . '/images/resize.png'); ?>" class="tool-item" alt="Resize" onClick="ImageEditor('resize');" title="Resize (Drag image from Bottom / Right Corners to Resize)" id="resize-tool"> |
| 13 |
<i><?php _e('Select a tool to start editing', 'thumbnail-editor'); ?></i> |
| 14 |
</div> |
| 15 |
</td> |
| 16 |
</tr> |
| 17 |
<tr> |
| 18 |
<td align="center"><img src="<?php echo $full_image[0]; ?>" id="target" style="border:1px dashed #CCCCCC;"></td> |
| 19 |
</tr> |
| 20 |
<tr> |
| 21 |
<td align="center"> |
| 22 |
<input type="hidden" name="att_id" value="<?php echo $att_id; ?>"> |
| 23 |
<div class="inline-labels"> |
| 24 |
<input type="hidden" size="4" id="x1" name="x1" /> |
| 25 |
<input type="hidden" size="4" id="y1" name="y1" /> |
| 26 |
<input type="hidden" size="4" id="x2" name="x2" /> |
| 27 |
<input type="hidden" size="4" id="y2" name="y2" /> |
| 28 |
<p> |
| 29 |
<label><strong><?php _e('Crop Width', 'thumbnail-editor'); ?></strong> <input type="text" size="4" id="w" name="w" readonly /></label> |
| 30 |
<label><strong><?php _e('Crop Height', 'thumbnail-editor'); ?></strong> <input type="text" size="4" id="h" name="h" readonly /></label> |
| 31 |
<label><strong><?php _e('Resize Width', 'thumbnail-editor'); ?></strong> <input type="text" size="4" id="rw" name="rw" readonly value="<?php echo $full_image[1]; ?>"/></label> |
| 32 |
<label><strong><?php _e('Resize Height', 'thumbnail-editor'); ?></strong> <input type="text" size="4" id="rh" name="rh" readonly value="<?php echo $full_image[2]; ?>"/></label> |
| 33 |
</p> |
| 34 |
<p id="aspr" style="display: none;"> |
| 35 |
<label><strong><?php _e('Crop Aspect Ratio', 'thumbnail-editor'); ?></strong> <input type="number" step="1" min="0" size="4" id="art" name="art"/> / <input type="number" step="1" min="1" size="4" id="ars" name="ars"/></label> |
| 36 |
<input type="button" name="setar" value="<?php _e('Set', 'thumbnail-editor'); ?>" class="button" onclick="setAspectRatio()"> |
| 37 |
</p> |
| 38 |
<p> |
| 39 |
<select name="crop_type"> |
| 40 |
<?php |
| 41 |
foreach ($sizes as $key => $value) { |
| 42 |
$s = $this->get_image_sizes($value); |
| 43 |
echo '<option value="' . $value . '">' . $value . ' - ' . $s['width'] . 'x' . $s['height'] . '</option>'; |
| 44 |
} |
| 45 |
?> |
| 46 |
</select></p> |
| 47 |
<p><input type="submit" name="submit" value="<?php _e('Edit Image', 'thumbnail-editor'); ?>" class="button button-primary button-ap-large"></p> |
| 48 |
<p><?php _e('Once Image is updated you can check the updated image from the below list of thumbnails. The above image will not be effected by the changes you make.', 'thumbnail-editor'); ?></p> |
| 49 |
</div> |
| 50 |
</td> |
| 51 |
</tr> |
| 52 |
<tr> |
| 53 |
<td><hr> |
| 54 |
<h3><?php _e('List of Available Thumbnail Types', 'thumbnail-editor'); ?></h3> |
| 55 |
|
| 56 |
<?php |
| 57 |
foreach ($sizes as $key => $value) { |
| 58 |
$s = $this->get_image_sizes($value); |
| 59 |
echo '<a href="#' . $value . '" class="button">' . $value . '</a> '; |
| 60 |
} |
| 61 |
?> |
| 62 |
|
| 63 |
<p><?php printf(esc_html__('If thumbnail images doesn\'t reflect the changes you made please use %s or clear browser cache. More editing options are available with %s version.', 'thumbnail-editor'), '<strong>Ctrl + F5</strong>', '<a href="https://goplugins.in/thumbnail-editor-pro/" target="_blank">PRO</a>'); ?> |
| 64 |
</p> |
| 65 |
</td> |
| 66 |
</tr> |
| 67 |
<?php |
| 68 |
foreach ($sizes as $key => $value) { |
| 69 |
$full_image = @wp_get_attachment_image_src($att_id, $value); |
| 70 |
?> |
| 71 |
<tr> |
| 72 |
<td> |
| 73 |
<a id="<?php echo $value; ?>"></a> |
| 74 |
<div class="thumb-items"> |
| 75 |
<p><h3><?php echo $value; ?></h3></p> |
| 76 |
|
| 77 |
<div class="thumbs"><img src="<?php echo $full_image[0]; ?>"></div> |
| 78 |
<p><strong>Usage</strong> <br> |
| 79 |
<span style="color:#0000ff;">get_thumb_image_src( "attachment id", "thumbnail type" ); </span> |
| 80 |
<br> |
| 81 |
<br> |
| 82 |
<strong><?php _e('Example', 'thumbnail-editor'); ?></strong> |
| 83 |
<br> |
| 84 |
// this will output the image src <br> |
| 85 |
<span style="color:#0000ff;">echo get_thumb_image_src( "<?php echo $att_id; ?>", "<?php echo $value; ?>" );</span> <br> |
| 86 |
<strong>Shortcode</strong> [thumb_image_src att_id="<?php echo $att_id; ?>" type="<?php echo $value; ?>"] |
| 87 |
<br> |
| 88 |
<br> |
| 89 |
// this will output the image <br> |
| 90 |
<span style="color:#0000ff;"> echo get_thumb_image( "<?php echo $att_id; ?>", "<?php echo $value; ?>" ); </span> |
| 91 |
<br> |
| 92 |
<strong>Shortcode</strong> [thumb_image att_id="<?php echo $att_id; ?>" type="<?php echo $value; ?>"] <br> |
| 93 |
|
| 94 |
</p> |
| 95 |
</div> |
| 96 |
</td> |
| 97 |
</tr> |
| 98 |
<?php |
| 99 |
} |
| 100 |
?> |
| 101 |
</tbody> |
| 102 |
</table> |
| 103 |
</form> |