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
2 years 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
plugin-settings.php
169 lines
| 1 | <?php |
| 2 | if (!defined('ABSPATH')) |
| 3 | exit; |
| 4 | ?> |
| 5 | <div class="isimb-6310"> |
| 6 | <h1>Plugin Settings</h1> |
| 7 | <?php |
| 8 | |
| 9 | wp_enqueue_media(); |
| 10 | |
| 11 | |
| 12 | $font_awesome = isimb_6310_get_option('isimb_6310_font_awesome_status'); |
| 13 | $closeIcon = isimb_6310_get_option('isimb_6310_close_icon'); |
| 14 | $desktopSize = isimb_6310_get_option('isimb_6310_desktop_size'); |
| 15 | $mobileSize = isimb_6310_get_option('isimb_6310_mobile_size'); |
| 16 | $tabClass = isimb_6310_get_option('isimb_6310_tab_class'); |
| 17 | |
| 18 | $closeIcon = $closeIcon? $closeIcon : 'https://wpmart.org/wp-content/uploads/2022/08/close.png'; |
| 19 | $desktopSize = $desktopSize ? $desktopSize : 30; |
| 20 | $mobileSize = $mobileSize ? $mobileSize : 20; |
| 21 | |
| 22 | if (!empty($_POST['update']) && $_POST['update'] == 'Update') { |
| 23 | $nonce = $_REQUEST['_wpnonce']; |
| 24 | if (!wp_verify_nonce($nonce, 'isimb-6310-nonce-update')) { |
| 25 | die('You do not have sufficient permissions to access this page.'); |
| 26 | } else { |
| 27 | |
| 28 | //fontawesome Font Start |
| 29 | if($font_awesome != ''){ |
| 30 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 31 | option_value='". sanitize_text_field($_POST['font_awesome']) ."' |
| 32 | where option_name = 'isimb_6310_font_awesome_status'"); |
| 33 | } |
| 34 | else{ |
| 35 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_font_awesome_status'"); |
| 36 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_font_awesome_status', '". sanitize_text_field($_POST['font_awesome']) ."')"); |
| 37 | } |
| 38 | |
| 39 | $font_awesome = $_POST['font_awesome']; |
| 40 | //Next image start |
| 41 | $isimb_6310_close_icon = isimb_6310_get_option('isimb_6310_close_icon'); |
| 42 | if(!$isimb_6310_close_icon){ |
| 43 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_close_icon'"); |
| 44 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_close_icon', '". sanitize_text_field($_POST['isimb_6310_close_icon']) ."')"); |
| 45 | } |
| 46 | else{ |
| 47 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 48 | option_value='". sanitize_text_field($_POST['isimb_6310_close_icon']) ."' |
| 49 | where option_name = 'isimb_6310_close_icon'"); |
| 50 | } |
| 51 | $closeIcon = $_POST['isimb_6310_close_icon']; |
| 52 | |
| 53 | |
| 54 | //Desktop Size |
| 55 | $isimb_6310_desktop_size = isimb_6310_get_option('isimb_6310_desktop_size'); |
| 56 | if(!$isimb_6310_desktop_size){ |
| 57 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_desktop_size'"); |
| 58 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_desktop_size', '". sanitize_text_field($_POST['isimb_6310_desktop_size']) ."')"); |
| 59 | } |
| 60 | else{ |
| 61 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 62 | option_value='". sanitize_text_field($_POST['isimb_6310_desktop_size']) ."' |
| 63 | where option_name = 'isimb_6310_desktop_size'"); |
| 64 | } |
| 65 | $desktopSize = $_POST['isimb_6310_desktop_size']; |
| 66 | |
| 67 | //Mobile size |
| 68 | $isimb_6310_mobile_size = isimb_6310_get_option('isimb_6310_mobile_size'); |
| 69 | if(!$isimb_6310_mobile_size){ |
| 70 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_mobile_size'"); |
| 71 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_mobile_size', '". sanitize_text_field($_POST['isimb_6310_mobile_size']) ."')"); |
| 72 | } |
| 73 | else{ |
| 74 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 75 | option_value='". sanitize_text_field($_POST['isimb_6310_mobile_size']) ."' |
| 76 | where option_name = 'isimb_6310_mobile_size'"); |
| 77 | } |
| 78 | $mobileSize = $_POST['isimb_6310_mobile_size']; |
| 79 | |
| 80 | //Tab Class |
| 81 | $isimb_6310_tab_class = isimb_6310_get_option('isimb_6310_tab_class'); |
| 82 | if(!$isimb_6310_tab_class){ |
| 83 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_tab_class'"); |
| 84 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_tab_class', '". sanitize_text_field($_POST['isimb_6310_tab_class']) ."')"); |
| 85 | } |
| 86 | else{ |
| 87 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 88 | option_value='". sanitize_text_field($_POST['isimb_6310_tab_class']) ."' |
| 89 | where option_name = 'isimb_6310_tab_class'"); |
| 90 | } |
| 91 | $tabClass = $_POST['isimb_6310_tab_class']; |
| 92 | } |
| 93 | } |
| 94 | ?> |
| 95 | <form action="" method="post"> |
| 96 | <?php wp_nonce_field("isimb-6310-nonce-update") ?> |
| 97 | <div class="isimb-6310-modal-body-form"> |
| 98 | <table width="100%" cellpadding="10" cellspacing="0"> |
| 99 | <tr> |
| 100 | <td width="200px"> |
| 101 | <b>Font Awesome Activation:</b><br /> |
| 102 | |
| 103 | </td> |
| 104 | <td width="500px" colspan="2"> |
| 105 | <input type="radio" name="font_awesome" value="2" checked> Active |
| 106 | <input type="radio" name="font_awesome" value="1" <?php echo ($font_awesome == 1) ? ' checked':'' ?>> Inactive |
| 107 | </td> |
| 108 | </tr> |
| 109 | <tr> |
| 110 | <td width="200px"><b>Change Close Icon</b></td> |
| 111 | <td width="500px"> |
| 112 | <input type="text" required name="isimb_6310_close_icon" id="close-icon-src" value="<?php echo esc_attr($closeIcon) ?>" class="isimb-form-input lg"> |
| 113 | <input type="button" id="close-icon" value="Change Image" class="isimb-6310-btn-success"> |
| 114 | </td> |
| 115 | <td> |
| 116 | <img src="<?php echo esc_attr($closeIcon) ?>" width="40" /> |
| 117 | </td> |
| 118 | </tr> |
| 119 | <tr> |
| 120 | <td width="200px"><b>Close Icon Size in Desktop</b></td> |
| 121 | <td width="500px"> |
| 122 | <input type="number" required min="10" name="isimb_6310_desktop_size" id="close-icon-src" value="<?php echo esc_attr($desktopSize) ?>" class="isimb-form-input lg"> |
| 123 | </td> |
| 124 | </tr> |
| 125 | <tr> |
| 126 | <td width="200px"><b>Close Icon Size in Mobile</b></td> |
| 127 | <td width="500px"> |
| 128 | <input type="number" required min="10" name="isimb_6310_mobile_size" id="close-icon-src" value="<?php echo esc_attr($mobileSize) ?>" class="isimb-form-input lg"> |
| 129 | </td> |
| 130 | </tr> |
| 131 | <tr> |
| 132 | <td width="200px"><b>Tab Class</b></td> |
| 133 | <td width="500px"> |
| 134 | <input type="text" required name="isimb_6310_tab_class" value="<?php echo $tabClass != '' ? esc_attr($tabClass) : '.elementor-tab-title' ?>" class="isimb-form-input isimb-form-input-lg"> |
| 135 | <p>If multiple class, then add comma between them. <br />For example, <b>".elementor-tab-title, .content-tab"</b></p> |
| 136 | </td> |
| 137 | </tr> |
| 138 | <tr> |
| 139 | <td colspan="3"> |
| 140 | <input type="submit" name="update" class="isimb-6310-btn-primary isimb-margin-right-10" value="Update" /> |
| 141 | </td> |
| 142 | </tr> |
| 143 | </table> |
| 144 | </div> |
| 145 | <br class="isimb-6310-clear" /> |
| 146 | </form> |
| 147 | <script type="text/javascript"> |
| 148 | jQuery(document).ready(function(){ |
| 149 | jQuery("body").on("click", "#close-icon", function (e) { |
| 150 | e.preventDefault(); |
| 151 | var image = wp |
| 152 | .media({ |
| 153 | title: "Upload Image", |
| 154 | multiple: false, |
| 155 | }) |
| 156 | .open() |
| 157 | .on("select", function (e) { |
| 158 | var uploaded_image = image.state().get("selection").first(); |
| 159 | var image_url = uploaded_image.toJSON().url; |
| 160 | jQuery("#close-icon-src").val(image_url); |
| 161 | }); |
| 162 | |
| 163 | jQuery("#isimb_6310_add_new_media").css({ |
| 164 | "overflow-x": "hidden", |
| 165 | "overflow-y": "auto", |
| 166 | }); |
| 167 | }); |
| 168 | }) |
| 169 | </script> |