| 1 |
<?php |
| 2 |
|
| 3 |
namespace Codelight\GDPR\Components\PrivacySafe; |
| 4 |
|
| 5 |
use Codelight\GDPR\Admin\AdminTab; |
| 6 |
use Codelight\GDPR\Components\WHMCS\WHMCS; |
| 7 |
|
| 8 |
class AdminTabPrivacySafe extends AdminTab { |
| 9 |
|
| 10 |
/* @var string */ |
| 11 |
protected $slug = 'privacy-safe'; |
| 12 |
|
| 13 |
/* @var PolicyGenerator */ |
| 14 |
protected $policyGenerator; |
| 15 |
|
| 16 |
public function __construct() { |
| 17 |
$this->title = _x( 'Privacy Safe', '(Admin)', 'gdpr-framework' ); |
| 18 |
$this->registerSetting( 'gdpr_privacy_safe_params' ); |
| 19 |
$this->registerSetting( 'gdpr_privacy_safe_imagecode' ); |
| 20 |
$this->registerSetting( 'gdpr_privacy_safe_backlink_selected' ); |
| 21 |
$this->registerSetting( 'gdpr_privacy_safe_backlink' ); |
| 22 |
|
| 23 |
add_action( 'gdpr/admin/action/PrivacyManager/generate', array( $this, 'generatePrivacySafe' ) ); |
| 24 |
|
| 25 |
} |
| 26 |
|
| 27 |
public function init() { |
| 28 |
/** |
| 29 |
* Privacy Safe settings |
| 30 |
*/ |
| 31 |
$this->registerSettingSection( |
| 32 |
'gdpr_about_privacy_safe_section', |
| 33 |
_x( 'Privacy Safe by Data443', '(Admin)', 'gdpr-framework' ), |
| 34 |
array( $this, 'renderAboutHeader' ) |
| 35 |
); |
| 36 |
$this->registerSettingSection( |
| 37 |
'gdpr_link_privacy_safe_section', |
| 38 |
_x( 'Register for Privacy Safe', '(Admin)', 'gdpr-framework' ), |
| 39 |
array( $this, 'renderLinkHeader' ) |
| 40 |
); |
| 41 |
|
| 42 |
$this->registerSettingSection( |
| 43 |
'gdpr_privacy_safe_section', |
| 44 |
_x( 'Privacy Safe Settings', '(Admin)', 'gdpr-framework' ), |
| 45 |
array( $this, 'renderGuideHeader' ) |
| 46 |
); |
| 47 |
|
| 48 |
$this->registerSettingField( |
| 49 |
'gdpr_privacy_safe_params', |
| 50 |
_x( 'Seal Code', '(Admin)', 'gdpr-framework' ), |
| 51 |
array( $this, 'params' ), |
| 52 |
'gdpr_privacy_safe_section' |
| 53 |
); |
| 54 |
$this->registerSettingField( |
| 55 |
'gdpr_privacy_safe_imagecode', |
| 56 |
_x( 'Image Code', '(Admin)', 'gdpr-framework' ), |
| 57 |
array( $this, 'imagecode' ), |
| 58 |
'gdpr_privacy_safe_section' |
| 59 |
); |
| 60 |
$this->registerSettingField( |
| 61 |
'gdpr_privacy_safe_shortcode', |
| 62 |
_x( 'Shortcode', '(Admin)', 'gdpr-framework' ), |
| 63 |
array( $this, 'shortcode' ), |
| 64 |
'gdpr_privacy_safe_section' |
| 65 |
); |
| 66 |
$this->registerSettingField( |
| 67 |
'gdpr_privacy_safe_shortcodephp', |
| 68 |
_x( 'Shortcode for PHP', '(Admin)', 'gdpr-framework' ), |
| 69 |
array( $this, 'shortcodephp' ), |
| 70 |
'gdpr_privacy_safe_section' |
| 71 |
); |
| 72 |
$this->registerSettingField( |
| 73 |
'gdpr_privacy_safe_backlink', |
| 74 |
_x( 'Support Data443', '(Admin)', 'gdpr-framework' ), |
| 75 |
array( $this, 'backlinkphp' ), |
| 76 |
'gdpr_privacy_safe_section' |
| 77 |
); |
| 78 |
|
| 79 |
|
| 80 |
} |
| 81 |
|
| 82 |
public function renderAboutHeader() { |
| 83 |
echo '<img src="' . esc_url( plugins_url( 'PrivacySafe/Privacy-Safe-Brand.png', dirname(__FILE__) ) ) . '" style="float:right;margin:15px;"/><p>'. esc_html_x('Strengthen your reputation. The privacy safe seal assures your customers that your business is in compliance with privacy laws and regulations. The privacy safe seal will verify that the GDPR Framework plugin is installed.', '(Admin)', 'gdpr-framework') . '</p>'; |
| 84 |
} |
| 85 |
public function renderLinkHeader() { |
| 86 |
echo '<p>'. esc_html_x('Register now to activate your Privacy Safe seal. Visit the link below, complete the complete the checkout process. Once approved you will recieve notice to get your seal code and image code. Enter those here and save. You can then place the seal where you would like on your site.', '(Admin)', 'gdpr-framework') . '</p><p><a href="https://orders.data443.com/cart.php?a=add&pid=31&carttpl=standard_cart" target="_blank" class="button button-primary">' . esc_html_x('Register Here', '(Admin)', 'gdpr-framework') . '</a></p>'; |
| 87 |
} |
| 88 |
public function renderGuideHeader() { |
| 89 |
echo '<p>' . esc_html_x('Embed the shortcode provided to display your privacy safe seal.', '(Admin)', 'gdpr-framework') . '</p>'; |
| 90 |
} |
| 91 |
public function params() { |
| 92 |
echo "<input type='text' name='gdpr_privacy_safe_params' placeholder='' value='" . get_option( 'gdpr_privacy_safe_params' ) . "'>"; |
| 93 |
} |
| 94 |
public function imagecode() { |
| 95 |
echo "<input type='text' name='gdpr_privacy_safe_imagecode' placeholder='' value='" . get_option( 'gdpr_privacy_safe_imagecode' ) . "'>"; |
| 96 |
} |
| 97 |
public function shortcode() { |
| 98 |
echo "<code>[data443_privacy_safe]</code>"; |
| 99 |
} |
| 100 |
public function shortcodephp() { |
| 101 |
echo "<code>echo do_shortcode('[data443_privacy_safe]');</code>"; |
| 102 |
} |
| 103 |
public function backlinkphp() { |
| 104 |
|
| 105 |
if ( get_option( 'gdpr_privacy_safe_backlink_selected' ) === '1' ) { |
| 106 |
$checked = get_option( 'gdpr_privacy_safe_backlink' ); |
| 107 |
}else{ |
| 108 |
$checked = 1; |
| 109 |
} |
| 110 |
echo gdpr( 'view' )->render( 'admin/privacy-safe/enable-backlink' , compact( 'checked' ) ); |
| 111 |
} |
| 112 |
|
| 113 |
public function renderSubmitButton() { |
| 114 |
submit_button( esc_html_x( 'Save', '(Admin)', 'gdpr-framework' ) ); |
| 115 |
} |
| 116 |
} |
| 117 |
|