css
2 years ago
add-point-html.php
10 months ago
builder.php
2 years ago
edit-point-html.php
10 months ago
form.php
10 months ago
how-to-use.php
2 years ago
import-export-plugins.php
1 year ago
nested-point.php
2 years ago
plugin-settings.php
2 years ago
save.php
2 years ago
template-settings.php
10 months ago
wpmart-plugins.php
2 years ago
plugin-settings.php
234 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 | $desktopMenuHeight = isimb_6310_get_option('isimb_6310_desktop_menu_height'); |
| 19 | $tabMenuHeight = isimb_6310_get_option('isimb_6310_tab_menu_height'); |
| 20 | $mobileMenuHeight = isimb_6310_get_option('isimb_6310_mobile_menu_height'); |
| 21 | |
| 22 | $closeIcon = $closeIcon? $closeIcon : 'https://wpmart.org/wp-content/uploads/2022/08/close.png'; |
| 23 | $desktopSize = $desktopSize ? $desktopSize : 30; |
| 24 | $mobileSize = $mobileSize ? $mobileSize : 20; |
| 25 | |
| 26 | $desktopMenuHeight = $desktopMenuHeight ? $desktopMenuHeight : 0; |
| 27 | $tabMenuHeight = $tabMenuHeight ? $tabMenuHeight : 0; |
| 28 | $mobileMenuHeight = $mobileMenuHeight ? $mobileMenuHeight : 0; |
| 29 | |
| 30 | if (!empty($_POST['update']) && $_POST['update'] == 'Update') { |
| 31 | $nonce = $_REQUEST['_wpnonce']; |
| 32 | if (!wp_verify_nonce($nonce, 'isimb-6310-nonce-update')) { |
| 33 | die('You do not have sufficient permissions to access this page.'); |
| 34 | } else { |
| 35 | |
| 36 | //fontawesome Font Start |
| 37 | if($font_awesome != ''){ |
| 38 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 39 | option_value='". sanitize_text_field($_POST['font_awesome']) ."' |
| 40 | where option_name = 'isimb_6310_font_awesome_status'"); |
| 41 | } |
| 42 | else{ |
| 43 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_font_awesome_status'"); |
| 44 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_font_awesome_status', '". sanitize_text_field($_POST['font_awesome']) ."')"); |
| 45 | } |
| 46 | |
| 47 | $font_awesome = $_POST['font_awesome']; |
| 48 | //Next image start |
| 49 | $isimb_6310_close_icon = isimb_6310_get_option('isimb_6310_close_icon'); |
| 50 | if(!$isimb_6310_close_icon){ |
| 51 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_close_icon'"); |
| 52 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_close_icon', '". sanitize_text_field($_POST['isimb_6310_close_icon']) ."')"); |
| 53 | } |
| 54 | else{ |
| 55 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 56 | option_value='". sanitize_text_field($_POST['isimb_6310_close_icon']) ."' |
| 57 | where option_name = 'isimb_6310_close_icon'"); |
| 58 | } |
| 59 | $closeIcon = $_POST['isimb_6310_close_icon']; |
| 60 | |
| 61 | |
| 62 | //Desktop Size |
| 63 | $isimb_6310_desktop_size = isimb_6310_get_option('isimb_6310_desktop_size'); |
| 64 | if(!$isimb_6310_desktop_size){ |
| 65 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_desktop_size'"); |
| 66 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_desktop_size', '". sanitize_text_field($_POST['isimb_6310_desktop_size']) ."')"); |
| 67 | } |
| 68 | else{ |
| 69 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 70 | option_value='". sanitize_text_field($_POST['isimb_6310_desktop_size']) ."' |
| 71 | where option_name = 'isimb_6310_desktop_size'"); |
| 72 | } |
| 73 | $desktopSize = $_POST['isimb_6310_desktop_size']; |
| 74 | |
| 75 | //Mobile size |
| 76 | $isimb_6310_mobile_size = isimb_6310_get_option('isimb_6310_mobile_size'); |
| 77 | if(!$isimb_6310_mobile_size){ |
| 78 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_mobile_size'"); |
| 79 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_mobile_size', '". sanitize_text_field($_POST['isimb_6310_mobile_size']) ."')"); |
| 80 | } |
| 81 | else{ |
| 82 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 83 | option_value='". sanitize_text_field($_POST['isimb_6310_mobile_size']) ."' |
| 84 | where option_name = 'isimb_6310_mobile_size'"); |
| 85 | } |
| 86 | $mobileSize = $_POST['isimb_6310_mobile_size']; |
| 87 | |
| 88 | //Tab Class |
| 89 | $isimb_6310_tab_class = isimb_6310_get_option('isimb_6310_tab_class'); |
| 90 | if(!$isimb_6310_tab_class){ |
| 91 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_tab_class'"); |
| 92 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_tab_class', '". sanitize_text_field($_POST['isimb_6310_tab_class']) ."')"); |
| 93 | } |
| 94 | else{ |
| 95 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 96 | option_value='". sanitize_text_field($_POST['isimb_6310_tab_class']) ."' |
| 97 | where option_name = 'isimb_6310_tab_class'"); |
| 98 | } |
| 99 | $tabClass = $_POST['isimb_6310_tab_class']; |
| 100 | |
| 101 | //Desktop Menu Height |
| 102 | $isimb_6310_desktop_menu_height = isimb_6310_get_option('isimb_6310_desktop_menu_height'); |
| 103 | if(!$isimb_6310_desktop_menu_height){ |
| 104 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_desktop_menu_height'"); |
| 105 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_desktop_menu_height', '". sanitize_text_field($_POST['isimb_6310_desktop_menu_height']) ."')"); |
| 106 | } |
| 107 | else{ |
| 108 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 109 | option_value='". sanitize_text_field($_POST['isimb_6310_desktop_menu_height']) ."' |
| 110 | where option_name = 'isimb_6310_desktop_menu_height'"); |
| 111 | } |
| 112 | $desktopMenuHeight = $_POST['isimb_6310_desktop_menu_height']; |
| 113 | |
| 114 | //Tab Menu Height |
| 115 | $isimb_6310_tab_menu_height = isimb_6310_get_option('isimb_6310_tab_menu_height'); |
| 116 | if(!$isimb_6310_tab_menu_height){ |
| 117 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_tab_menu_height'"); |
| 118 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_tab_menu_height', '". sanitize_text_field($_POST['isimb_6310_tab_menu_height']) ."')"); |
| 119 | } |
| 120 | else{ |
| 121 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 122 | option_value='". sanitize_text_field($_POST['isimb_6310_tab_menu_height']) ."' |
| 123 | where option_name = 'isimb_6310_tab_menu_height'"); |
| 124 | } |
| 125 | $tabMenuHeight = $_POST['isimb_6310_tab_menu_height']; |
| 126 | |
| 127 | //Mobile Menu Height |
| 128 | $isimb_6310_mobile_menu_height = isimb_6310_get_option('isimb_6310_mobile_menu_height'); |
| 129 | if(!$isimb_6310_mobile_menu_height){ |
| 130 | $wpdb->query("DELETE FROM {$wpdb->prefix}options where option_name='isimb_6310_mobile_menu_height'"); |
| 131 | $wpdb->query("INSERT INTO {$wpdb->prefix}options(option_name, option_value) VALUES ('isimb_6310_mobile_menu_height', '". sanitize_text_field($_POST['isimb_6310_mobile_menu_height']) ."')"); |
| 132 | } |
| 133 | else{ |
| 134 | $wpdb->query("UPDATE {$wpdb->prefix}options set |
| 135 | option_value='". sanitize_text_field($_POST['isimb_6310_mobile_menu_height']) ."' |
| 136 | where option_name = 'isimb_6310_mobile_menu_height'"); |
| 137 | } |
| 138 | $mobileMenuHeight = $_POST['isimb_6310_mobile_menu_height']; |
| 139 | } |
| 140 | } |
| 141 | ?> |
| 142 | <form action="" method="post"> |
| 143 | <?php wp_nonce_field("isimb-6310-nonce-update") ?> |
| 144 | <div class="isimb-6310-modal-body-form"> |
| 145 | <table width="100%" cellpadding="10" cellspacing="0"> |
| 146 | <tr> |
| 147 | <td width="200px"> |
| 148 | <b>Font Awesome Activation:</b><br /> |
| 149 | |
| 150 | </td> |
| 151 | <td width="500px" colspan="2"> |
| 152 | <input type="radio" name="font_awesome" value="2" checked> Active |
| 153 | <input type="radio" name="font_awesome" value="1" <?php echo ($font_awesome == 1) ? ' checked':'' ?>> Inactive |
| 154 | </td> |
| 155 | </tr> |
| 156 | <tr> |
| 157 | <td width="200px"><b>Change Close Icon</b></td> |
| 158 | <td width="500px"> |
| 159 | <input type="text" required name="isimb_6310_close_icon" id="close-icon-src" value="<?php echo esc_attr($closeIcon) ?>" class="isimb-form-input lg"> |
| 160 | <input type="button" id="close-icon" value="Change Image" class="isimb-6310-btn-success"> |
| 161 | </td> |
| 162 | <td> |
| 163 | <img src="<?php echo esc_attr($closeIcon) ?>" width="40" /> |
| 164 | </td> |
| 165 | </tr> |
| 166 | <tr> |
| 167 | <td width="200px"><b>Close Icon Size in Desktop</b></td> |
| 168 | <td width="500px"> |
| 169 | <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"> |
| 170 | </td> |
| 171 | </tr> |
| 172 | <tr> |
| 173 | <td width="200px"><b>Close Icon Size in Mobile</b></td> |
| 174 | <td width="500px"> |
| 175 | <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"> |
| 176 | </td> |
| 177 | </tr> |
| 178 | <tr> |
| 179 | <td width="200px"><b>Tab Class</b></td> |
| 180 | <td width="500px"> |
| 181 | <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"> |
| 182 | <p>If multiple class, then add comma between them. <br />For example, <b>".elementor-tab-title, .content-tab"</b></p> |
| 183 | </td> |
| 184 | </tr> |
| 185 | <tr> |
| 186 | <td width="200px"><b>Desktop Menu Height</b></td> |
| 187 | <td width="500px"> |
| 188 | <input type="number" required min="0" name="isimb_6310_desktop_menu_height" id="close-icon-src" value="<?php echo esc_attr($desktopMenuHeight) ?>" class="isimb-form-input lg"> |
| 189 | </td> |
| 190 | </tr> |
| 191 | <tr> |
| 192 | <td width="200px"><b>Tab Menu Height</b></td> |
| 193 | <td width="500px"> |
| 194 | <input type="number" required min="0" name="isimb_6310_tab_menu_height" id="close-icon-src" value="<?php echo esc_attr($tabMenuHeight) ?>" class="isimb-form-input lg"> |
| 195 | </td> |
| 196 | </tr> |
| 197 | <tr> |
| 198 | <td width="200px"><b>Mobile Menu Height</b></td> |
| 199 | <td width="500px"> |
| 200 | <input type="number" required min="0" name="isimb_6310_mobile_menu_height" id="close-icon-src" value="<?php echo esc_attr($mobileMenuHeight) ?>" class="isimb-form-input lg"> |
| 201 | </td> |
| 202 | </tr> |
| 203 | <tr> |
| 204 | <td colspan="3"> |
| 205 | <input type="submit" name="update" class="isimb-6310-btn-primary isimb-margin-right-10" value="Update" /> |
| 206 | </td> |
| 207 | </tr> |
| 208 | </table> |
| 209 | </div> |
| 210 | <br class="isimb-6310-clear" /> |
| 211 | </form> |
| 212 | <script type="text/javascript"> |
| 213 | jQuery(document).ready(function(){ |
| 214 | jQuery("body").on("click", "#close-icon", function (e) { |
| 215 | e.preventDefault(); |
| 216 | var image = wp |
| 217 | .media({ |
| 218 | title: "Upload Image", |
| 219 | multiple: false, |
| 220 | }) |
| 221 | .open() |
| 222 | .on("select", function (e) { |
| 223 | var uploaded_image = image.state().get("selection").first(); |
| 224 | var image_url = uploaded_image.toJSON().url; |
| 225 | jQuery("#close-icon-src").val(image_url); |
| 226 | }); |
| 227 | |
| 228 | jQuery("#isimb_6310_add_new_media").css({ |
| 229 | "overflow-x": "hidden", |
| 230 | "overflow-y": "auto", |
| 231 | }); |
| 232 | }); |
| 233 | }) |
| 234 | </script> |