PluginProbe
The GDPR Framework By Data443 / trunk
The GDPR Framework By Data443 vtrunk
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 trunk, at src/Components/PrivacySafe/AdminTabPrivacySafe.php

119 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 if ( ! defined( 'ABSPATH' ) ) exit;
6
7 use Codelight\GDPR\Admin\AdminTab;
8 use Codelight\GDPR\Components\WHMCS\WHMCS;
9
10 class AdminTabPrivacySafe extends AdminTab {
11
12 /* @var string */
13 protected $slug = 'privacy-safe';
14
15 /* @var PolicyGenerator */
16 protected $policyGenerator;
17
18 public function __construct() {
19 $this->title = _x( 'Privacy Safe', '(Admin)', 'gdpr-framework' );
20 $this->registerSetting( 'gdpr_privacy_safe_params' );
21 $this->registerSetting( 'gdpr_privacy_safe_imagecode' );
22 $this->registerSetting( 'gdpr_privacy_safe_backlink_selected' );
23 $this->registerSetting( 'gdpr_privacy_safe_backlink' );
24
25 add_action( 'gdpr/admin/action/PrivacyManager/generate', array( $this, 'generatePrivacySafe' ) );
26
27 }
28
29 public function init() {
30 /**
31 * Privacy Safe settings
32 */
33 $this->registerSettingSection(
34 'gdpr_about_privacy_safe_section',
35 _x( 'Privacy Safe by Data443', '(Admin)', 'gdpr-framework' ),
36 array( $this, 'renderAboutHeader' )
37 );
38 $this->registerSettingSection(
39 'gdpr_link_privacy_safe_section',
40 _x( 'Register for Privacy Safe', '(Admin)', 'gdpr-framework' ),
41 array( $this, 'renderLinkHeader' )
42 );
43
44 $this->registerSettingSection(
45 'gdpr_privacy_safe_section',
46 _x( 'Privacy Safe Settings', '(Admin)', 'gdpr-framework' ),
47 array( $this, 'renderGuideHeader' )
48 );
49
50 $this->registerSettingField(
51 'gdpr_privacy_safe_params',
52 _x( 'Seal Code', '(Admin)', 'gdpr-framework' ),
53 array( $this, 'params' ),
54 'gdpr_privacy_safe_section'
55 );
56 $this->registerSettingField(
57 'gdpr_privacy_safe_imagecode',
58 _x( 'Image Code', '(Admin)', 'gdpr-framework' ),
59 array( $this, 'imagecode' ),
60 'gdpr_privacy_safe_section'
61 );
62 $this->registerSettingField(
63 'gdpr_privacy_safe_shortcode',
64 _x( 'Shortcode', '(Admin)', 'gdpr-framework' ),
65 array( $this, 'shortcode' ),
66 'gdpr_privacy_safe_section'
67 );
68 $this->registerSettingField(
69 'gdpr_privacy_safe_shortcodephp',
70 _x( 'Shortcode for PHP', '(Admin)', 'gdpr-framework' ),
71 array( $this, 'shortcodephp' ),
72 'gdpr_privacy_safe_section'
73 );
74 $this->registerSettingField(
75 'gdpr_privacy_safe_backlink',
76 _x( 'Support Data443', '(Admin)', 'gdpr-framework' ),
77 array( $this, 'backlinkphp' ),
78 'gdpr_privacy_safe_section'
79 );
80
81
82 }
83
84 public function renderAboutHeader() {
85 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>';
86 }
87 public function renderLinkHeader() {
88 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>';
89 }
90 public function renderGuideHeader() {
91 echo '<p>' . esc_html_x('Embed the shortcode provided to display your privacy safe seal.', '(Admin)', 'gdpr-framework') . '</p>';
92 }
93 public function params() {
94 echo "<input type='text' name='gdpr_privacy_safe_params' placeholder='' value='" . get_option( 'gdpr_privacy_safe_params' ) . "'>";
95 }
96 public function imagecode() {
97 echo "<input type='text' name='gdpr_privacy_safe_imagecode' placeholder='' value='" . get_option( 'gdpr_privacy_safe_imagecode' ) . "'>";
98 }
99 public function shortcode() {
100 echo "<code>[data443_privacy_safe]</code>";
101 }
102 public function shortcodephp() {
103 echo "<code>echo do_shortcode('[data443_privacy_safe]');</code>";
104 }
105 public function backlinkphp() {
106
107 if ( get_option( 'gdpr_privacy_safe_backlink_selected' ) === '1' ) {
108 $checked = get_option( 'gdpr_privacy_safe_backlink' );
109 }else{
110 $checked = 1;
111 }
112 echo gdpr( 'view' )->render( 'admin/privacy-safe/enable-backlink' , compact( 'checked' ) );
113 }
114
115 public function renderSubmitButton() {
116 submit_button( esc_html_x( 'Save', '(Admin)', 'gdpr-framework' ) );
117 }
118 }
119