settings-tabs
10 months ago
admin-content.php
7 months ago
email-signup.php
10 months ago
folder-deactivate-form.php
10 months ago
folder-popup.php
1 year ago
general-settings.php
10 months ago
help.php
1 month ago
media-cleaning.php
1 year ago
media-replace.php
8 months ago
modals.php
8 months ago
recommended-plugins.php
1 year ago
update.php
10 months ago
upgrade-table.php
1 year ago
upgrade-to-pro.php
1 year ago
help.php
185 lines
| 1 | <?php |
| 2 | if (! defined('ABSPATH')) { |
| 3 | exit; |
| 4 | } |
| 5 | $data = WCP_FOLDER_FOOTER_HELP_DATA; |
| 6 | ?> |
| 7 | |
| 8 | <div class="premio-footer-help"> |
| 9 | <div class="premio-help-wrap"> |
| 10 | |
| 11 | <div class="premio-help-menu"> |
| 12 | |
| 13 | <?php foreach($data['footer_menu'] as $key => $value): ?> |
| 14 | <?php if($value['status'] == 1): ?> |
| 15 | <a target="_blank" href="<?php echo esc_url($value['link']) ?>"><?php echo esc_html($value['title']) ?></a> |
| 16 | <?php endif; ?> |
| 17 | <?php endforeach; ?> |
| 18 | </div> |
| 19 | <div class="premio-help-content"> |
| 20 | <p><?php esc_html_e("Powered by ", "folders") ?><a target="_blank" href="<?php echo esc_url($data['premio_site_info']) ?>"><?php esc_html_e("Premio", "folders") ?></a></p> |
| 21 | </div> |
| 22 | </div> |
| 23 | <div class="premio-help-button-wrap"> |
| 24 | <!-- Free/Pro Only URL Change --> |
| 25 | <a class="premio-help-button" href="#"><img src="<?php echo esc_url($data['help_icon']) ?>" alt="<?php esc_html_e("Need help?", 'folders'); ?>" /></a> |
| 26 | <a class="premio-help-close-btn" href="#"><img src="<?php echo esc_url($data['close_icon']) ?>" alt="<?php esc_html_e("Close", 'folders'); ?>" /></a> |
| 27 | |
| 28 | <?php |
| 29 | $option = get_option("hide_folders_cta"); |
| 30 | if ($option !== "yes") { ?> |
| 31 | <span class="tooltiptext"><?php esc_html_e("Support", "folders") ?></span> |
| 32 | <?php } ?> |
| 33 | <div class="premio-help-absulate-content"> |
| 34 | <?php foreach($data['support_widget'] as $key => $value): |
| 35 | $link = $value['link'] == false ? '#' : esc_url($value['link']); |
| 36 | $class = $key == 'contact' ? 'contact-us-btn' : 'premio-click-to-close'; |
| 37 | $target = $key == 'contact' ? '' : '_blank'; |
| 38 | $pro_class = $key == 'upgrade_to_pro' ? ' pro' : ''; |
| 39 | ?> |
| 40 | <a target="<?php echo esc_attr($target); ?>" href="<?php echo esc_attr( $link ) ?>" class="premio-help-absulate-content-single <?php echo esc_attr($class); ?>"> |
| 41 | <span class="text"><?php echo esc_html($value['title']) ?></span> |
| 42 | <span class="icon-img <?php echo esc_attr($pro_class); ?>"><img src="<?php echo esc_url($value['icon']) ?>" alt=""></span> |
| 43 | </a> |
| 44 | <?php endforeach; ?> |
| 45 | </div> |
| 46 | |
| 47 | </div> |
| 48 | <div class="premio-help-form"> |
| 49 | |
| 50 | <form action="<?php echo esc_url(admin_url('admin-ajax.php')) ?>" method="post" id="premio-help-form"> |
| 51 | <div class="premio-help-header"> |
| 52 | <?php esc_html_e("Contact Us", "folders") ?> |
| 53 | </div> |
| 54 | <div class="premio-help-content"> |
| 55 | <p><?php esc_html_e("Are you experiencing any issues with Folders? Please let us know, we’d be happy to help 🙏", 'folders'); ?></p> |
| 56 | <br> |
| 57 | <div class="premio-form-field"> |
| 58 | <input type="text" name="user_email" id="user_email" placeholder="<?php esc_html_e("Email", 'folders'); ?>"> |
| 59 | </div> |
| 60 | <div class="premio-form-field"> |
| 61 | <textarea type="text" name="textarea_text" id="textarea_text" placeholder="<?php esc_html_e("How can we help you?", 'folders'); ?>"></textarea> |
| 62 | </div> |
| 63 | <div class="form-button"> |
| 64 | <button type="submit" class="premio-help-button-submit" ><?php esc_html_e("Chat", 'folders') ?></button> |
| 65 | <input type="hidden" name="action" value="wcp_folder_send_message_to_owner" > |
| 66 | <input type="hidden" id="nonce" name="nonce" value="<?php echo esc_attr(wp_create_nonce('wcp_folder_help_nonce')) ?>" > |
| 67 | </div> |
| 68 | </div> |
| 69 | </form> |
| 70 | <div class="premio-form-response"></div> |
| 71 | </div> |
| 72 | </div> |
| 73 | |
| 74 | <script> |
| 75 | jQuery(document).ready(function(){ |
| 76 | |
| 77 | // Prevent default behavior of anchor tags with href="#" |
| 78 | jQuery("a[href='#']").click(function(e){ |
| 79 | e.preventDefault(); |
| 80 | }); |
| 81 | |
| 82 | |
| 83 | jQuery(".premio-help-button").click(function(e){ |
| 84 | e.stopPropagation(); |
| 85 | jQuery(".premio-help-button-wrap .tooltiptext").hide(); |
| 86 | jQuery(".premio-help-close-btn").addClass('show'); |
| 87 | jQuery(".premio-help-button").addClass('hide'); |
| 88 | jQuery(".premio-help-absulate-content").addClass('active'); |
| 89 | jQuery(".premio-help-absulate-content").removeClass('hide'); |
| 90 | |
| 91 | }); |
| 92 | jQuery(".premio-help-close-btn").click(function(e){ |
| 93 | e.stopPropagation(); |
| 94 | jQuery(".premio-help-close-btn").removeClass('show'); |
| 95 | jQuery(".premio-help-button").removeClass('hide'); |
| 96 | jQuery(".premio-help-absulate-content").removeClass('active'); |
| 97 | jQuery(".premio-help-absulate-content").addClass('hide'); |
| 98 | jQuery(".premio-help-form").hide(); |
| 99 | |
| 100 | }); |
| 101 | jQuery(".premio-click-to-close").click(function(e){ |
| 102 | jQuery(".premio-help-close-btn").removeClass('show'); |
| 103 | jQuery(".premio-help-button").removeClass('hide'); |
| 104 | jQuery(".premio-help-absulate-content").removeClass('active'); |
| 105 | jQuery(".premio-help-absulate-content").addClass('hide'); |
| 106 | |
| 107 | }); |
| 108 | jQuery("#premio-help-form").submit(function(){ |
| 109 | jQuery(".premio-help-button-submit").attr("disabled",true); |
| 110 | jQuery(".premio-help-button-submit").text("<?php esc_html_e("Sending Request...", "folders") ?>"); |
| 111 | formData = jQuery(this).serialize(); |
| 112 | jQuery.ajax({ |
| 113 | url: "<?php echo esc_url(admin_url('admin-ajax.php')) ?>", |
| 114 | data: formData, |
| 115 | type: "post", |
| 116 | success: function(responseArray){ |
| 117 | jQuery("#premio-help-form").find(".error-message").remove(); |
| 118 | jQuery("#premio-help-form").find(".input-error").removeClass("input-error"); |
| 119 | if(responseArray.error == 1) { |
| 120 | jQuery(".premio-help-button-submit").attr("disabled",false); |
| 121 | jQuery(".premio-help-button-submit").text("<?php esc_html_e("Chat", 'folders'); ?>"); |
| 122 | for(i=0;i<responseArray.errors.length;i++) { |
| 123 | jQuery("#"+responseArray.errors[i]['key']).addClass("input-error"); |
| 124 | jQuery("#"+responseArray.errors[i]['key']).after('<span class="error-message">'+responseArray.errors[i]['message']+'</span>'); |
| 125 | } |
| 126 | } else if(responseArray.status == 1) { |
| 127 | jQuery(".premio-help-button-submit").text("<?php esc_html_e("Done!", 'folders'); ?>"); |
| 128 | setTimeout(function(){ |
| 129 | jQuery("#user_email").val(""); |
| 130 | jQuery("#textarea_text").val(""); |
| 131 | jQuery("#premio-help-form").hide(); |
| 132 | jQuery(".premio-help-header").hide(); |
| 133 | jQuery(".help-form-footer").hide(); |
| 134 | jQuery(".premio-form-response").html("<p class='success-p'><?php esc_html_e("Your message is sent successfully.", 'folders'); ?></p>"); |
| 135 | },1000); |
| 136 | } else if(responseArray.status == 0) { |
| 137 | jQuery("#premio-help-form").hide(); |
| 138 | jQuery(".premio-help-header").hide(); |
| 139 | jQuery(".help-form-footer").hide(); |
| 140 | jQuery(".premio-form-response").html("<p class='error-p'><?php printf(esc_html__("There is some problem in sending request. Please send us mail on %1\$s", 'folders'), "<a href='mailto:contact@premio.io'>contact@premio.io</a>"); ?></p>"); |
| 141 | } |
| 142 | } |
| 143 | }); |
| 144 | return false; |
| 145 | }); |
| 146 | jQuery(".contact-us-btn").click(function(e){ |
| 147 | e.stopPropagation(); |
| 148 | jQuery(".premio-help-form").show(); |
| 149 | jQuery(".premio-help-form").addClass('active'); |
| 150 | jQuery(".premio-help-absulate-content").removeClass('active'); |
| 151 | jQuery(".premio-help-absulate-content").addClass('hide'); |
| 152 | if(jQuery(".premio-help-button-wrap .tooltiptext").length) { |
| 153 | jQuery(".premio-help-button-wrap .tooltiptext").remove(); |
| 154 | jQuery.ajax({ |
| 155 | url: "<?php echo esc_url(admin_url('admin-ajax.php')) ?>", |
| 156 | data: { |
| 157 | nonce: "<?php echo esc_attr(wp_create_nonce("hide_folders_cta")) ?>", |
| 158 | action: "hide_folders_cta" |
| 159 | }, |
| 160 | type: "post", |
| 161 | success: function (responseText) { |
| 162 | |
| 163 | } |
| 164 | }); |
| 165 | } |
| 166 | |
| 167 | }); |
| 168 | |
| 169 | jQuery(".premio-help-form").click(function(e){ |
| 170 | e.stopPropagation(); |
| 171 | }); |
| 172 | jQuery("body").click(function(){ |
| 173 | if(jQuery(".premio-help-form").hasClass("active")) { |
| 174 | jQuery(".premio-help-button").addClass('show'); |
| 175 | jQuery(".premio-help-button").removeClass('hide'); |
| 176 | |
| 177 | jQuery(".premio-help-close-btn").addClass('hide'); |
| 178 | jQuery(".premio-help-close-btn").removeClass('show'); |
| 179 | } |
| 180 | |
| 181 | jQuery(".premio-help-form").removeClass("active"); |
| 182 | }); |
| 183 | }); |
| 184 | </script> |
| 185 |