129 lines
3.5 KiB
PHP
129 lines
3.5 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Provide a admin area view for the plugin
|
|
*
|
|
* This file is used to markup the admin-facing aspects of the plugin.
|
|
*
|
|
* @link http://secureprivacy.ai/
|
|
* @since 1.0.0
|
|
*
|
|
* @package Secureprivacy
|
|
* @subpackage Secureprivacy/admin/partials
|
|
*/
|
|
?>
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
|
<style>
|
|
.switch {
|
|
position: relative;
|
|
display: inline-block;
|
|
width: 55px;
|
|
height: 24px;
|
|
}
|
|
|
|
.switch input {
|
|
opacity: 0;
|
|
width: 0;
|
|
height: 0;
|
|
}
|
|
|
|
.slider {
|
|
position: absolute;
|
|
cursor: pointer;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background-color: #ccc;
|
|
-webkit-transition: .4s;
|
|
transition: .4s;
|
|
}
|
|
|
|
.slider:before {
|
|
position: absolute;
|
|
content: "";
|
|
height: 24px;
|
|
width: 24px;
|
|
left: 1px;
|
|
bottom: 0px;
|
|
background-color: white;
|
|
transition: .4s;
|
|
box-shadow: 0 0 0px 1px #cccccc;
|
|
}
|
|
|
|
input:checked + .slider {
|
|
background-color: #2ecc71;
|
|
}
|
|
|
|
|
|
input:checked + .slider:before {
|
|
-webkit-transform: translateX(31px);
|
|
-ms-transform: translateX(31px);
|
|
transform: translateX(31px);
|
|
}
|
|
|
|
/* Rounded sliders */
|
|
.slider.round {
|
|
border-radius: 34px;
|
|
}
|
|
|
|
.slider.round:before {
|
|
border-radius: 50%;
|
|
}
|
|
|
|
</style>
|
|
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
|
|
<div class="wrap _s" style="display:none;" id="page_settings_page">
|
|
|
|
|
|
<div class="col-sm-12">
|
|
<div style="display:none;" id="scanning-message">
|
|
<h2 class="text-center" style="margin:25px;"> Scanning your website...</h2>
|
|
<h4 class="text-center"> It might take a while, we will automatically create your banners on complete scan.</h4>
|
|
</div>
|
|
<div class="success-page" style="display: block;">
|
|
<div class="container ng-tns-c0-0 ng-star-inserted">
|
|
<div class="text-center">
|
|
<a class="text-center ng-tns-c0-0 ng-star-inserted" href="https://secureprivacy.ai" target="_self" title="Secure Privacy">
|
|
<img class="img logo-sp" src="<?php echo plugin_dir_url( __FILE__ ) . '../images/logo-black.png'; ?>">
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="success-wrap">
|
|
<img src="<?php echo plugin_dir_url( __FILE__ ) . '../images/payment_successful.png'; ?>" alt="success">
|
|
</div>
|
|
|
|
<h2 class="text-center success-message-title">Secure privacy is running on your website</h2>
|
|
|
|
<div class="success-button">
|
|
<span>To change your settings open our admin app</span>
|
|
<button id="launch_admin_app" onclick="launchAdminapp()" class="btn-success btn">Launch admin app</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<form id="saveValueForm" action="options.php" method="post">
|
|
<?php
|
|
settings_fields( $this->plugin_name );
|
|
do_settings_sections( $this->plugin_name );
|
|
?>
|
|
</form>
|
|
<script>
|
|
//case of a fresh install check if anything is blank
|
|
if (document.getElementById('outdated_notice_adminId').value === '' ||
|
|
document.getElementById('outdated_notice_sessionId').value === '' ||
|
|
document.getElementById('outdated_notice_domainId').value === '' ||
|
|
document.getElementById('outdated_notice_client_id').value === '' ||
|
|
document.getElementById('outdated_notice_client_secret').value === ''
|
|
) {
|
|
window.location.href = '<?php echo admin_url('admin.php?page=welcome'); ?>';
|
|
} else {
|
|
document.getElementById('page_settings_page').style.display ='block';
|
|
}
|
|
|
|
function launchAdminapp() {
|
|
window.open('https://app.secureprivacy.ai/#/login/wplogin/' + document.getElementById('outdated_notice_sessionId').value, '_blank');
|
|
}
|
|
</script>
|