css
2 years ago
add-point-html.php
2 years ago
builder.php
2 years ago
edit-point-html.php
2 years ago
form.php
1 year ago
how-to-use.php
2 years ago
import-export-plugins.php
2 years ago
nested-point.php
2 years ago
plugin-settings.php
2 years ago
save.php
2 years ago
template-settings.php
2 years ago
wpmart-plugins.php
2 years ago
import-export-plugins.php
81 lines
| 1 | <?php |
| 2 | if (!defined('ABSPATH')) |
| 3 | exit; |
| 4 | ?> |
| 5 | <div class="isimb-6310"> |
| 6 | <h1>Plugin Export / Import</h1> |
| 7 | |
| 8 | <button class="isimb-6310-btn-primary" id="export-image-map-builder-data">Export Plugin Data</button> |
| 9 | <button class="isimb-6310-btn-primary" id="import-image-map-builder-data">Import Plugin Data</button> |
| 10 | <?php |
| 11 | |
| 12 | wp_enqueue_media(); |
| 13 | isimb_6310_export_full_map_builder_plugin(); |
| 14 | |
| 15 | if (!empty($_POST['update'])) { |
| 16 | $nonce = $_REQUEST['_wpnonce']; |
| 17 | if (!wp_verify_nonce($nonce, 'isimb-6310-nonce-update')) { |
| 18 | die('You do not have sufficient permissions to access this page.'); |
| 19 | } else { |
| 20 | if($_POST['file_url'] && substr($_POST['file_url'], -3) == 'txt'){ |
| 21 | isimb_6310_import_full_plugin($_POST['file_url']); |
| 22 | } else{ |
| 23 | echo "<p style='color: red; font-size: 14px;'>Can't import data. Please upload valid file.</p>"; |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | ?> |
| 28 | <form action="" method="post"> |
| 29 | <?php wp_nonce_field("isimb-6310-nonce-update") ?> |
| 30 | <div class="isimb-6310-modal-body-form"> |
| 31 | <table width="100%" cellpadding="10" cellspacing="0" class="import-file" style="display: none"> |
| 32 | <tr> |
| 33 | <td width="70px"><b>File URL</b></td> |
| 34 | <td> |
| 35 | <input type="text" required name="file_url" id="file-url" class="isimb-6310-form-input" style="width: 300px;"> |
| 36 | <input type="button" id="upload-csv-file" value="Upload file" class="isimb-6310-btn-default"> |
| 37 | </td> |
| 38 | </tr> |
| 39 | <tr> |
| 40 | <td colspan="3"> |
| 41 | <input type="submit" name="update" class="isimb-6310-btn-primary isimb-6310-margin-right-10" value="Import Data" onclick="return confirm('If you import you will lose all of your previous data of this plugin. Do you want to continue?');" /> |
| 42 | </td> |
| 43 | </tr> |
| 44 | </table> |
| 45 | </div> |
| 46 | <br class="isimb-6310-clear" /> |
| 47 | </form> |
| 48 | <script> |
| 49 | jQuery(document).ready(function() { |
| 50 | /* ######### Media Start ########### */ |
| 51 | jQuery("body").on("click", "#import-image-map-builder-data", function(e) { |
| 52 | jQuery('.import-file').removeClass('isimb-6310-hide'); |
| 53 | }); |
| 54 | |
| 55 | jQuery('body').on('click', '#export-image-map-builder-data', function(){ |
| 56 | if (!confirm("Do you want to export service box full plugin?")){ |
| 57 | return false; |
| 58 | } else{ |
| 59 | window.open(jQuery('#export-image-map-builder-plugin').attr('href'), '_blank'); |
| 60 | } |
| 61 | }); |
| 62 | |
| 63 | jQuery("body").on("click", "#upload-csv-file", function(e) { |
| 64 | e.preventDefault(); |
| 65 | var image = wp.media({ |
| 66 | title: 'Upload File', |
| 67 | multiple: false |
| 68 | }).open() |
| 69 | .on('select', function(e) { |
| 70 | var uploaded_image = image.state().get('selection').first(); |
| 71 | var image_url = uploaded_image.toJSON().url; |
| 72 | jQuery("#file-url").val(image_url); |
| 73 | }); |
| 74 | |
| 75 | jQuery("#isimb_6310_add_new_media").css({ |
| 76 | "overflow-x": "hidden", |
| 77 | "overflow-y": "auto" |
| 78 | }); |
| 79 | }); |
| 80 | }); |
| 81 | </script> |