settings-tabs
1 year ago
admin-content.php
1 year ago
email-signup.php
1 year ago
folder-deactivate-form.php
1 year ago
folder-popup.php
1 year ago
general-settings.php
1 year ago
help.php
1 year ago
media-cleaning.php
1 year ago
media-replace.php
1 year ago
modals.php
1 year ago
recommended-plugins.php
1 year ago
update.php
1 year ago
upgrade-table.php
1 year ago
upgrade-to-pro.php
1 year ago
folder-deactivate-form.php
136 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin folders deactiavte form |
| 4 | * |
| 5 | * @author : Premio <contact@premio.io> |
| 6 | * @license : GPL2 |
| 7 | * */ |
| 8 | |
| 9 | if (! defined('ABSPATH')) { |
| 10 | exit; |
| 11 | } |
| 12 | |
| 13 | ?> |
| 14 | <style> |
| 15 | .folder-hidden{overflow:hidden}.folder-popup-overlay .folder-internal-message{margin:3px 0 3px 22px;display:none}.folder-reason-input{margin:3px 0 3px 22px;display:none}.folder-reason-input input[type=text]{width:100%;display:block}.folder-popup-overlay{background:rgba(0,0,0,.8);position:fixed;top:0;left:0;height:100%;width:100%;z-index:1000;overflow:auto;visibility:hidden;opacity:0;transition:opacity .3s ease-in-out :}.folder-popup-overlay.folder-active{opacity:1;visibility:visible}.folder-serveypanel{width:600px;background:#fff;margin:65px auto 0}.folder-popup-header{background:#f1f1f1;padding:20px;border-bottom:1px solid #ccc}.folder-popup-header h2{margin:0}.folder-popup-body{padding:10px 20px}.folder-popup-footer{background:#f9f3f3;padding:10px 20px;border-top:1px solid #ccc}.folder-popup-footer:after{content:"";display:table;clear:both}.action-btns{float:right}.folder-anonymous{display:none}.attention,.error-message{color:red;font-weight:600;display:none}.folder-spinner{display:none}.folder-spinner img{margin-top:3px}.folder-hidden-input{padding:10px 0 0;display:none}.folder-hidden-input input[type=text]{padding:0 10px;width:100%;height:26px;line-height:26px}.folder-hidden-input textarea{padding:10px;width:100%;height:100px;margin:0 0 10px 0}span.folder-error-message{color:#d00;font-weight:600}.form-control textarea{width:100%;height:100px;margin-bottom:10px}td.plugin-title {display: table-cell;} |
| 16 | </style> |
| 17 | |
| 18 | <div class="folder-popup-overlay"> |
| 19 | <div class="folder-serveypanel"> |
| 20 | <form action="#" method="post" id="folder-deactivate-form"> |
| 21 | <div class="folder-popup-header"> |
| 22 | <h2><?php esc_html_e('Quick feedback about Folders', 'folders'); ?> 🙏</h2> |
| 23 | </div> |
| 24 | <div class="folder-popup-body"> |
| 25 | <h3><?php esc_html_e('Your feedback will help us improve the product, please tell us why did you decide to deactivate Folders :)', 'folders'); ?></h3> |
| 26 | <div class="form-control"> |
| 27 | <input type="email" value="<?php echo esc_attr(get_option('admin_email')) ?>" placeholder="<?php esc_html_e("Email address", 'folders'); ?>" id="folder-deactivate-email_id"> |
| 28 | </div> |
| 29 | <div class="form-control"> |
| 30 | <label></label> |
| 31 | <textarea placeholder="<?php esc_html_e("Your comment", 'folders'); ?>" id="folder-comment"></textarea> |
| 32 | </div> |
| 33 | <?php esc_html_e("Having any problem with the Folders plugins?", 'folders'); ?><a class='folder-deactivate-button' href='javascript:;'><?php esc_html_e("Click here", 'folders'); ?></a><?php esc_html_e(" to contact our support now", 'folders'); ?> |
| 34 | </div> |
| 35 | <div class="folder-popup-footer"> |
| 36 | <label class="folder-anonymous"><input type="checkbox"/><?php esc_html_e('Anonymous feedback', 'folders'); ?> |
| 37 | </label> |
| 38 | <input type="button" class="button button-secondary button-skip folder-popup-skip-feedback" value="Skip & Deactivate"> |
| 39 | |
| 40 | <div class="action-btns"> |
| 41 | <span class="folder-spinner"> |
| 42 | <img src="<?php echo esc_url(admin_url('/images/spinner.gif')); ?>" alt=""> |
| 43 | </span> |
| 44 | <input type="submit" class="button button-secondary button-deactivate folder-popup-allow-deactivate" value="Submit & Deactivate" disabled="disabled"> |
| 45 | <a href="#" class="button button-primary folder-popup-button-close"><?php esc_attr_e('Cancel', 'folders'); ?></a> |
| 46 | </div> |
| 47 | </div> |
| 48 | </form> |
| 49 | </div> |
| 50 | </div> |
| 51 | |
| 52 | |
| 53 | <script> |
| 54 | (function ($) { |
| 55 | |
| 56 | $(function () { |
| 57 | |
| 58 | $(document).on("click", ".folder-deactivate-button", function(e){ |
| 59 | e.stopPropagation(); |
| 60 | jQuery(".folder-popup-button-close").trigger("click"); |
| 61 | jQuery(".folder-help-btn").toggle(); |
| 62 | jQuery(".folder-help-form").toggleClass("active"); |
| 63 | jQuery("#user_email").focus(); |
| 64 | }); |
| 65 | |
| 66 | /* Diffrent folder slug for Free/Pro */ |
| 67 | var folderPluginSlug = 'folders'; |
| 68 | // Code to fire when the DOM is ready. |
| 69 | |
| 70 | $(document).on('click', 'tr[data-slug="' + folderPluginSlug + '"] .deactivate', function (e) { |
| 71 | e.preventDefault(); |
| 72 | |
| 73 | $('.folder-popup-overlay').addClass('folder-active'); |
| 74 | $('body').addClass('folder-hidden'); |
| 75 | }); |
| 76 | $(document).on('click', '.folder-popup-button-close', function () { |
| 77 | close_popup(); |
| 78 | }); |
| 79 | $(document).on('click', ".folder-serveypanel,tr[data-slug='" + folderPluginSlug + "'] .deactivate", function (e) { |
| 80 | e.stopPropagation(); |
| 81 | }); |
| 82 | |
| 83 | $(document).click(function () { |
| 84 | close_popup(); |
| 85 | }); |
| 86 | $(document).on("keyup", "#folder-comment", function(){ |
| 87 | if($.trim($(this).val()) == "") { |
| 88 | $(".folder-popup-allow-deactivate").attr("disabled", true); |
| 89 | } else { |
| 90 | $(".folder-popup-allow-deactivate").attr("disabled", false); |
| 91 | } |
| 92 | }); |
| 93 | $(document).on('submit', '#folder-deactivate-form', function (event) { |
| 94 | event.preventDefault(); |
| 95 | |
| 96 | var _reason = jQuery('#folder-comment').val(); |
| 97 | var _email_id = jQuery('#folder-deactivate-email_id').val(); |
| 98 | |
| 99 | $.ajax({ |
| 100 | url: ajaxurl, |
| 101 | type: 'POST', |
| 102 | data: { |
| 103 | action: 'folder_plugin_deactivate', |
| 104 | reason: _reason, |
| 105 | email_id: _email_id, |
| 106 | nonce: '<?php echo esc_attr(wp_create_nonce('wcp_folder_deactivate_nonce')) ?>' |
| 107 | }, |
| 108 | beforeSend: function () { |
| 109 | $(".folder-spinner").show(); |
| 110 | $(".folder-popup-allow-deactivate").attr("disabled", "disabled"); |
| 111 | } |
| 112 | }).done(function (res) { |
| 113 | $(".folder-spinner").hide(); |
| 114 | $(".folder-popup-allow-deactivate").removeAttr("disabled"); |
| 115 | window.location.href = $("tr[data-slug='" + folderPluginSlug + "'] .deactivate a").attr('href'); |
| 116 | }); |
| 117 | }); |
| 118 | |
| 119 | $('.folder-popup-skip-feedback').on('click', function (e) { |
| 120 | window.location.href = $("tr[data-slug='" + folderPluginSlug + "'] .deactivate a").attr('href'); |
| 121 | }); |
| 122 | |
| 123 | function close_popup() { |
| 124 | $('.folder-popup-overlay').removeClass('folder-active'); |
| 125 | $('#folder-deactivate-form').trigger("reset"); |
| 126 | $(".folder-popup-allow-deactivate").attr('disabled', 'disabled'); |
| 127 | $(".folder-reason-input").hide(); |
| 128 | $('body').removeClass('folder-hidden'); |
| 129 | $('.message.error-message').hide(); |
| 130 | } |
| 131 | }); |
| 132 | |
| 133 | })(jQuery); // This invokes the function above and allows us to use '$' in place of 'jQuery' in our code. |
| 134 | </script> |
| 135 | <?php require_once dirname(__FILE__)."/help.php"; |
| 136 |