| 1 |
<?php |
| 2 |
namespace EmailKit\Promotional; |
| 3 |
defined('ABSPATH') || exit; |
| 4 |
class ProConsent{ |
| 5 |
public function get_consent_form(){ |
| 6 |
?> |
| 7 |
|
| 8 |
<style> |
| 9 |
.emailkit-user-consent-for-banner{ |
| 10 |
margin: 0 0 15px 0!important; |
| 11 |
width: 842px; |
| 12 |
max-width: 1350px; |
| 13 |
} |
| 14 |
.emailkit-success-notice { |
| 15 |
position: fixed; |
| 16 |
top: 50px; |
| 17 |
right: 20px; |
| 18 |
background-color: #14c87c; |
| 19 |
color: white; |
| 20 |
padding: 10px; |
| 21 |
border-radius: 5px; |
| 22 |
display: none; |
| 23 |
} |
| 24 |
|
| 25 |
</style> |
| 26 |
<script> |
| 27 |
jQuery(document).ready(function ($) { |
| 28 |
"use strict"; |
| 29 |
$('#emailkit-admin-switch__emailkit-user-consent-for-banner').on('change', function(){ |
| 30 |
let val = ($(this).prop("checked") ? $(this).val() : 'no'); |
| 31 |
let data = { |
| 32 |
'settings' : { |
| 33 |
'emailkit_user_consent_for_banner' : val, |
| 34 |
}, |
| 35 |
'nonce': "<?php echo esc_html(wp_create_nonce( 'ajax-nonce' )); ?>" |
| 36 |
}; |
| 37 |
|
| 38 |
$.post( ajaxurl + '?action=emailkit_admin_action', data, function( data ) { |
| 39 |
$('#success-notice').fadeIn().delay(1000).slideUp(); |
| 40 |
}); |
| 41 |
}); |
| 42 |
}); // end ready function |
| 43 |
</script> |
| 44 |
|
| 45 |
|
| 46 |
<div id="success-notice" class="emailkit-success-notice"><?php esc_html_e( 'Success! Your action was completed.', 'emailkit' ); ?></div> |
| 47 |
<div class="emailkit-user-consent-for-banner notice notice-error"> |
| 48 |
<p> |
| 49 |
<input type="checkbox" <?php echo esc_attr( \EmailKit\Promotional\Util::get_settings( 'emailkit_user_consent_for_banner', 'yes' ) == 'yes' ? 'checked' : '' ); ?> value="yes" class="emailkit-admin-control-input" name="emailkit-user-consent-for-banner" id="emailkit-admin-switch__emailkit-user-consent-for-banner"> |
| 50 |
<label for="emailkit-admin-switch__emailkit-user-consent-for-banner"><?php esc_html_e( 'Show update & fix related important messages, essential tutorials and promotional images on WP Dashboard', 'emailkit' ); ?></label> |
| 51 |
|
| 52 |
</p> |
| 53 |
</div> |
| 54 |
<?php |
| 55 |
} |
| 56 |
} |