| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) |
| 3 |
exit; |
| 4 |
?> |
| 5 |
<div class="imh-6310"> |
| 6 |
<h1>Plugin Export / Import</h1> |
| 7 |
|
| 8 |
<button class="imh-6310-btn-primary" id="export-image-map-hotspot-data">Export Plugin Data</button> |
| 9 |
<button class="imh-6310-btn-primary" id="import-image-map-hotspot-data">Import Plugin Data (Pro)</button> |
| 10 |
<?php |
| 11 |
|
| 12 |
wp_enqueue_media(); |
| 13 |
imh_6310_export_full_map_hotspot_plugin(); |
| 14 |
?> |
| 15 |
<script> |
| 16 |
jQuery(document).ready(function() { |
| 17 |
/* ######### Media Start ########### */ |
| 18 |
jQuery("body").on("click", "#import-image-map-hotspot-data", function(e) { |
| 19 |
alert("Import option available in pro version only.") |
| 20 |
}); |
| 21 |
|
| 22 |
jQuery('body').on('click', '#export-image-map-hotspot-data', function(){ |
| 23 |
if (!confirm("Do you want to export service box full plugin?")){ |
| 24 |
return false; |
| 25 |
} else{ |
| 26 |
window.open(jQuery('#export-image-map-hotspot-plugin').attr('href'), '_blank'); |
| 27 |
} |
| 28 |
}); |
| 29 |
|
| 30 |
jQuery("body").on("click", "#upload-csv-file", function(e) { |
| 31 |
e.preventDefault(); |
| 32 |
var image = wp.media({ |
| 33 |
title: 'Upload File', |
| 34 |
multiple: false |
| 35 |
}).open() |
| 36 |
.on('select', function(e) { |
| 37 |
var uploaded_image = image.state().get('selection').first(); |
| 38 |
var image_url = uploaded_image.toJSON().url; |
| 39 |
jQuery("#file-url").val(image_url); |
| 40 |
}); |
| 41 |
|
| 42 |
jQuery("#imh_6310_add_new_media").css({ |
| 43 |
"overflow-x": "hidden", |
| 44 |
"overflow-y": "auto" |
| 45 |
}); |
| 46 |
}); |
| 47 |
}); |
| 48 |
</script> |