PluginProbe
The GDPR Framework By Data443 / 2.1.0
The GDPR Framework By Data443 v2.1.0
2.5.0 2.4.0 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.3 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 All 41 releases
gdpr-framework / src / Components / PrivacySafe / AdminTabPrivacySafe.php

AdminTabPrivacySafe.php in The GDPR Framework By Data443 2.1.0, at src/Components/PrivacySafe/AdminTabPrivacySafe.php

117 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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