PluginProbe ʕ •ᴥ•ʔ
GDPR Cookie Compliance – Cookie Banner, Cookie Consent, Cookie Notice for CCPA, EU Cookie Law / 4.9.1
GDPR Cookie Compliance – Cookie Banner, Cookie Consent, Cookie Notice for CCPA, EU Cookie Law v4.9.1
5.0.14 5.0.13 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.2.0 3.2.1 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.10.0 4.10.1 4.10.2 4.10.3 4.10.4 4.10.5 4.10.6 4.11.0 4.11.1 4.11.2 4.12.0 4.12.1 4.12.2 4.12.3 4.12.4 4.12.5 4.12.6 4.12.7 4.12.8 4.13.0 4.13.1 4.13.2 4.13.3 4.13.4 4.14.0 4.15.0 4.15.1 4.15.10 4.15.2 4.15.3 4.15.4 4.15.5 4.15.6 4.15.7 4.15.8 4.15.9 4.16.1 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.5.0 4.5.1 4.5.10 4.5.11 4.5.12 4.5.13 4.5.2 4.5.3 4.5.4 4.5.5 4.5.6 4.5.7 4.5.8 4.5.9 4.6.0 4.6.1 4.6.2 4.6.3 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.8.0 4.8.1 4.8.10 4.8.11 4.8.12 4.8.13 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 5.0.0 5.0.1 5.0.10 5.0.11 5.0.12 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2
gdpr-cookie-compliance / class-gdpr-modules.php
gdpr-cookie-compliance Last commit date
controllers 3 years ago dist 3 years ago gdpr-modules 3 years ago languages 3 years ago views 3 years ago class-gdpr-modules-view.php 3 years ago class-gdpr-modules.php 3 years ago class-gdpr-view.php 3 years ago class-moove-gdpr-actions.php 3 years ago class-moove-gdpr-content.php 3 years ago class-moove-gdpr-options.php 3 years ago gdpr-functions.php 3 years ago moove-gdpr.php 3 years ago readme.txt 3 years ago
class-gdpr-modules.php
439 lines
1 <?php
2 /**
3 * GDPR_Modules File Doc Comment
4 *
5 * @category GDPR_Modules
6 * @package gdpr-cookie-compliance
7 * @author Moove Agency
8 */
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit;
12 } // Exit if accessed directly
13
14 /**
15 * GDPR_Modules Class Doc Comment
16 *
17 * @category Class
18 * @package Moove_Modules
19 * @author Moove Agency
20 */
21 class GDPR_Modules {
22 /**
23 * GDPR Options.
24 *
25 * @var array $gdpr_options GDPR Options.
26 */
27 protected $gdpr_options;
28
29 /**
30 * Language code.
31 *
32 * @var string $wpml_lang Language code.
33 */
34 protected $wpml_lang;
35
36 /**
37 * Construct function
38 */
39 public function __construct() {
40 $gdpr_default_content = new Moove_GDPR_Content();
41 $option_name = $gdpr_default_content->moove_gdpr_get_option_name();
42 $modal_options = get_option( $option_name );
43 $wpml_lang = $gdpr_default_content->moove_gdpr_get_wpml_lang();
44 $this->gdpr_options = $modal_options;
45 $this->wpml_lang = $wpml_lang;
46 }
47
48 /**
49 * GDPR Module - Floating Button view & content
50 */
51 public function get_floating_button() {
52 $view_controller = new GDPR_Modules_View();
53 $modal_options = $this->gdpr_options;
54 $wpml_lang = $this->wpml_lang;
55 $floating_button_visibility = 'display: none;';
56 $floating_button_class = '';
57 $infobar_hidden = isset( $modal_options['moove_gdpr_infobar_visibility'] ) && 'hidden' === $modal_options['moove_gdpr_infobar_visibility'] ? true : false;
58 if ( $infobar_hidden ) :
59 $floating_button_class = 'button-visible';
60 endif;
61 $floating_button_position = isset( $modal_options['moove_gdpr_floating_button_position'] ) ? $modal_options['moove_gdpr_floating_button_position'] : '';
62 $data = new stdClass();
63 $data->options = $modal_options;
64 $data->wpml_lang = $wpml_lang;
65 $data->is_enabled = ( isset( $modal_options['moove_gdpr_floating_button_enable'] ) && 1 === intval( $modal_options['moove_gdpr_floating_button_enable'] ) ) ? true : false;
66 if ( defined( 'IFRAME_REQUEST' ) && IFRAME_REQUEST ) :
67 $data->is_enabled = false;
68 endif;
69 $data->is_enabled = apply_filters( 'gdpr_template_html_load', $data->is_enabled );
70 $data->styles = $floating_button_visibility . $floating_button_position;
71 $data->class = $floating_button_class;
72 if ( $floating_button_position ) :
73 $data->class = $floating_button_class .= ' gdpr-floating-button-custom-position';
74 endif;
75
76 $mobile_hide = ( isset( $modal_options['moove_gdpr_floating_mobile'] ) && 1 === intval( $modal_options['moove_gdpr_floating_mobile'] ) ) ? true : false;
77 if ( $mobile_hide ) :
78 $data->class = $floating_button_class .= ' gdpr-fb-hide-mobile';
79 endif;
80
81 $data->label = ( isset( $modal_options[ 'moove_gdpr_floating_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_floating_button_label' . $wpml_lang ] ) ? $modal_options[ 'moove_gdpr_floating_button_label' . $wpml_lang ] : __( 'Change cookie settings', 'gdpr-cookie-compliance' );
82 return $view_controller->load( 'infobar.floating-button', $data );
83 }
84
85 /**
86 * GDPR Module - Base structure
87 */
88 public function get_modal_base() {
89 $view_controller = new GDPR_Modules_View();
90 $modal_options = $this->gdpr_options;
91 $wpml_lang = $this->wpml_lang;
92 $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
93 $tab_title = isset( $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] : __( 'Privacy Overview', 'gdpr-cookie-compliance' );
94 $data = new stdClass();
95 $data->logo_position = isset( $modal_options['moove_gdpr_logo_position'] ) ? $modal_options['moove_gdpr_logo_position'] : 'left';
96 $data->theme = 'moove_gdpr_modal_theme_' . $layout;
97 $modal_theme = 'moove_gdpr_modal_theme_' . $layout;
98 $data->modal_title = 'v1' === $layout ? false : $tab_title;
99 $view_type = 'v1' === $layout ? 'tabs' : 'onepage';
100 $close_button_v = true;
101
102 $gdpr_gs_buttons_order = isset( $modal_options['gdpr_gs_buttons_order'] ) ? json_decode( $modal_options['gdpr_gs_buttons_order'], true ) : array( 'enable', 'reject', 'save', 'close' );
103
104 if ( is_array( $gdpr_gs_buttons_order ) && in_array( 'close', $gdpr_gs_buttons_order ) && isset( $modal_options['moove_gdpr_cb_close_button_enable'] ) && 0 === intval( $modal_options['moove_gdpr_cb_close_button_enable'] ) ) :
105 $close_button_v = false;
106 endif;
107 $data->show = true;
108 if ( defined( 'IFRAME_REQUEST' ) && IFRAME_REQUEST ) :
109 $data->show = false;
110 endif;
111 $data->show = apply_filters( 'gdpr_template_html_load', $data->show );
112 $data->close = $close_button_v;
113 return $view_controller->load( 'modal.modal-base-' . $view_type, $data );
114 }
115
116 /**
117 * GDPR Module - Infobar structure
118 */
119 public function get_infobar_base() {
120 $view_controller = new GDPR_Modules_View();
121 $modal_options = $this->gdpr_options;
122 $wpml_lang = $this->wpml_lang;
123 $data = new stdClass();
124 $infobar_classes = array(
125 'moove-gdpr-info-bar-hidden',
126 'moove-gdpr-align-center',
127 );
128 $modal_scheme = isset( $modal_options['moove_gdpr_colour_scheme'] ) ? ( ( 1 === intval( $modal_options['moove_gdpr_colour_scheme'] ) || 2 === intval( $modal_options['moove_gdpr_colour_scheme'] ) ) ? intval( $modal_options['moove_gdpr_colour_scheme'] ) : 1 ) : 1;
129
130 $scheme_class = 2 === $modal_scheme ? 'moove-gdpr-light-scheme' : 'moove-gdpr-dark-scheme';
131 $infobar_position = isset( $modal_options['moove_gdpr_infobar_position'] ) ? $modal_options['moove_gdpr_infobar_position'] : 'bottom';
132 $infobar_classes[] = $scheme_class;
133 $infobar_classes[] = 'gdpr_infobar_postion_' . $infobar_position;
134 $infobar_classes = apply_filters( 'gdpr_info_bar_class_extension', $infobar_classes );
135 $infobar_hidden = isset( $modal_options['moove_gdpr_infobar_visibility'] ) && 'hidden' === $modal_options['moove_gdpr_infobar_visibility'] ? true : false;
136 $data->show = $infobar_hidden ? false : true;
137 if ( defined( 'IFRAME_REQUEST' ) && IFRAME_REQUEST ) :
138 $data->show = false;
139 endif;
140
141 $data->show = apply_filters( 'gdpr_template_html_load', $data->show );
142 $data->class = implode( ' ', $infobar_classes );
143 $infobar_content = apply_filters( 'gdpr_info_bar_popup_content', $view_controller->load( 'infobar.infobar-base', $data ) );
144 return $infobar_content;
145
146 }
147
148 /**
149 * GDPR Module - Infobar Main Content
150 */
151 public function get_infobar_content() {
152 $view_controller = new GDPR_Modules_View();
153 $modal_options = $this->gdpr_options;
154 $wpml_lang = $this->wpml_lang;
155 $_content = '<p>' . esc_html__( 'We are using cookies to give you the best experience on our website.', 'gdpr-cookie-compliance' ) .'</p>';
156 $_content .= '<p>' . sprintf( esc_html__( 'You can find out more about which cookies we are using or switch them off in [%s]settings[/%s].', 'gdpr-cookie-compliance' ), 'setting', 'setting' ) . '</p>';
157
158 $content = isset( $modal_options[ 'moove_gdpr_info_bar_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_info_bar_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_info_bar_content' . $wpml_lang ] : $_content;
159 $tabindex = apply_filters('gdpr_tabindex_attribute', '', '1' );
160 $content = str_replace( '[setting]', '<span role="link" ' . $tabindex . ' data-href="#moove_gdpr_cookie_modal" class="change-settings-button">', $content );
161 $content = str_replace( '[/setting]', '</span>', $content );
162 $content = apply_filters( 'gdpr_info_bar_notice_content', $content );
163 $data = new stdClass();
164 $data->text_content = $content;
165 return $view_controller->load( 'infobar.infobar-content', $data );
166 }
167
168 /**
169 * GDPR Module - Infobar button & extensions
170 */
171 public function get_infobar_buttons() {
172 $view_controller = new GDPR_Modules_View();
173 $modal_options = $this->gdpr_options;
174 $wpml_lang = $this->wpml_lang;
175 $data = new stdClass();
176 $has_accept = isset( $modal_options['moove_gdpr_accept_button_enable'] ) ? ( intval( $modal_options['moove_gdpr_accept_button_enable'] ) === 1 ? true : ( ! isset( $modal_options['moove_gdpr_accept_button_enable'] ) ? true : false ) ) : true;
177 $data->has_accept = $has_accept;
178 $data->button_label = isset( $modal_options[ 'moove_gdpr_infobar_accept_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_infobar_accept_button_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_infobar_accept_button_label' . $wpml_lang ] : __( 'Accept', 'gdpr-cookie-compliance' );
179 $buttons_order = isset( $modal_options['gdpr_bs_buttons_order'] ) ? json_decode( $modal_options['gdpr_bs_buttons_order'], true ) : array('accept', 'reject', 'settings', 'close');
180 $data->accept_order = in_array( 'accept', $buttons_order ) ? array_search( 'accept', $buttons_order ) : 'auto';
181 return $view_controller->load( 'infobar.infobar-buttons', $data );
182
183 }
184
185 /**
186 * GDPR Module - Company Logo
187 */
188 public function get_company_logo() {
189 $view_controller = new GDPR_Modules_View();
190 $modal_options = $this->gdpr_options;
191 $wpml_lang = $this->wpml_lang;
192 $data = new stdClass();
193 $data->options = $modal_options;
194 $data->wpml_lang = $wpml_lang;
195 $data->logo_url = isset( $modal_options['moove_gdpr_company_logo'] ) && $modal_options['moove_gdpr_company_logo'] ? $modal_options['moove_gdpr_company_logo'] : plugin_dir_url( __FILE__ ) . 'dist/images/gdpr-logo.png';
196 $data->logo_url = str_replace( plugin_dir_url( __FILE__ ) . 'dist/images/moove-logo.png', plugin_dir_url( __FILE__ ) . 'dist/images/gdpr-logo.png', $data->logo_url );
197 $logo_details = gdpr_get_logo_details( $data->logo_url, $modal_options );
198 $data->logo_alt = gdpr_get_logo_alt( $data->logo_url, $modal_options );
199 $data->logo_width = isset( $logo_details['width'] ) ? $logo_details['width'] : false;
200 $data->logo_height = isset( $logo_details['height'] ) ? $logo_details['height'] : false;
201 $data->logo_url = isset( $logo_details['logo_url'] ) ? $logo_details['logo_url'] : $data->logo_url;
202 $data->logo_url = apply_filters( 'gdpr_cc_modal_logo_url', $data->logo_url );
203 return $view_controller->load( 'modal.company-logo', $data );
204 }
205
206 /**
207 * GDPR Module - Branding Options
208 */
209 public function get_gdpr_branding() {
210 $view_controller = new GDPR_Modules_View();
211 $moove_actions_cnt = new Moove_GDPR_Actions();
212 $modal_options = $this->gdpr_options;
213 $wpml_lang = $this->wpml_lang;
214 $data = new stdClass();
215 $data->options = $modal_options;
216 $data->wpml_lang = $wpml_lang;
217 $data->text = $moove_actions_cnt->moove_gdpr_footer_branding_content();
218 $data->is_enabled = isset( $modal_options['moove_gdpr_modal_powered_by_disable'] ) && 1 === intval( $modal_options['moove_gdpr_modal_powered_by_disable'] ) ? false : true;
219 return $view_controller->load( 'modal.gdpr-branding', $data );
220 }
221
222 /**
223 * GDPR Module - Privacy Overview Content
224 */
225 public function get_section_overview() {
226 $view_controller = new GDPR_Modules_View();
227 $modal_options = $this->gdpr_options;
228 $wpml_lang = $this->wpml_lang;
229 $gdpr_default_content = new Moove_GDPR_Content();
230 $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
231 $tab_title = isset( $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] : __( 'Privacy Overview', 'gdpr-cookie-compliance' );
232 $tab_content = isset( $modal_options[ 'moove_gdpr_privacy_overview_tab_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_privacy_overview_tab_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_privacy_overview_tab_content' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_privacy_overview_content();
233 $data = new stdClass();
234 $data->options = $modal_options;
235 $data->wpml_lang = $wpml_lang;
236 $data->tab_title = 'v1' === $layout ? $tab_title : false;
237 $data->tab_content = wpautop( $tab_content );
238 $data->visibility = 'v1' === $layout ? 'style="display:none"' : '';
239
240 return $view_controller->load( 'modal.content-sections.overview', $data );
241
242 }
243
244 /**
245 * GPDR Module - Strictly Necessary Cookies
246 */
247 public function get_section_strictly() {
248 $view_controller = new GDPR_Modules_View();
249 $modal_options = $this->gdpr_options;
250 $wpml_lang = $this->wpml_lang;
251 $gdpr_default_content = new Moove_GDPR_Content();
252 $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
253 $tab_title = isset( $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] : __( 'Strictly Necessary Cookies', 'gdpr-cookie-compliance' );
254 $tab_content = isset( $modal_options[ 'moove_gdpr_strict_necessary_cookies_tab_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_strict_necessary_cookies_tab_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_strict_necessary_cookies_tab_content' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_strict_necessary_content();
255 $strictly = isset( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) && intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) ? intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) : 1;
256 $warning_msg = isset( $modal_options[ 'moove_gdpr_strictly_necessary_cookies_warning' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_strictly_necessary_cookies_warning' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_strictly_necessary_cookies_warning' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_strict_necessary_warning();
257 $data = new stdClass();
258 $data->options = $modal_options;
259 $data->wpml_lang = $wpml_lang;
260 $data->tab_title = $tab_title;
261 $data->tab_content = wpautop( $tab_content );
262 $data->show = 3 !== $strictly;
263 $data->is_checked = 1 !== $strictly ? 'disabled checked="checked" ' : '';
264 $data->text_enable = isset( $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] : __( 'Enabled', 'gdpr-cookie-compliance' );
265 $data->text_disable = isset( $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] : __( 'Disabled', 'gdpr-cookie-compliance' );
266 $data->warning_message_top = 'v2' === $layout && 1 === $strictly ? wpautop( $warning_msg ) : false;
267 $data->warning_message_bottom = 'v1' === $layout ? wpautop( $warning_msg ) : false;
268 $data->checkbox_state = 1 !== $strictly ? 'gdpr-checkbox-disabled checkbox-selected' : '';
269 $data->visibility = 'v1' === $layout ? 'style="display:none"' : '';
270 return $view_controller->load( 'modal.content-sections.strictly', $data );
271 }
272
273 /**
274 * GDPR Module - Advanced Cookies
275 */
276 public function get_section_advanced() {
277 $view_controller = new GDPR_Modules_View();
278 $modal_options = $this->gdpr_options;
279 $wpml_lang = $this->wpml_lang;
280 $gdpr_default_content = new Moove_GDPR_Content();
281
282 $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
283 $tab_title = isset( $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] : __( 'Additional Cookies', 'gdpr-cookie-compliance' );
284 $tab_content = isset( $modal_options[ 'moove_gdpr_advanced_cookies_tab_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_advanced_cookies_tab_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_advanced_cookies_tab_content' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_advanced_cookies_content();
285 $strictly = isset( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) && intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) ? intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) : 1;
286 $data = new stdClass();
287 $data->options = $modal_options;
288 $data->wpml_lang = $wpml_lang;
289 $data->tab_title = $tab_title;
290 $data->tab_content = wpautop( $tab_content );
291 $data->show = isset( $modal_options['moove_gdpr_advanced_cookies_enable'] ) && 1 === intval( $modal_options['moove_gdpr_advanced_cookies_enable'] ) ? true : false;
292 $data->is_checked = 1 !== $strictly ? '' : 'disabled';
293 $data->fieldset = 1 !== $strictly ? 'fl-strenabled' : 'fl-disabled';
294 $data->text_enable = isset( $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] : __( 'Enabled', 'gdpr-cookie-compliance' );
295 $data->text_disable = isset( $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] : __( 'Disabled', 'gdpr-cookie-compliance' );
296 $data->warning_message = isset( $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_secondary_notice();
297 $data->warning_message = wpautop( $data->warning_message );
298 $data->visibility = 'v1' === $layout ? 'style="display:none"' : '';
299 return $view_controller->load( 'modal.content-sections.advanced', $data );
300 }
301
302 /**
303 * GDPR Module - Third Party Cookies
304 */
305 public function get_section_third_party() {
306 $view_controller = new GDPR_Modules_View();
307 $modal_options = $this->gdpr_options;
308 $wpml_lang = $this->wpml_lang;
309 $gdpr_default_content = new Moove_GDPR_Content();
310 $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
311 $tab_title = isset( $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] : __( '3rd Party Cookies', 'gdpr-cookie-compliance' );
312 $tab_content = isset( $modal_options[ 'moove_gdpr_performance_cookies_tab_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_performance_cookies_tab_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_performance_cookies_tab_content' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_third_party_content();
313 $strictly = isset( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) && intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) ? intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) : 1;
314 $data = new stdClass();
315 $data->options = $modal_options;
316 $data->wpml_lang = $wpml_lang;
317 $data->tab_title = $tab_title;
318 $data->tab_content = wpautop( $tab_content );
319 $data->show = isset( $modal_options['moove_gdpr_third_party_cookies_enable'] ) && 1 === intval( $modal_options['moove_gdpr_third_party_cookies_enable'] ) ? true : false;
320 $data->is_checked = 1 !== $strictly ? '' : 'disabled';
321 $data->fieldset = 1 !== $strictly ? 'fl-strenabled' : 'fl-disabled';
322 $data->text_enable = isset( $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_enabled_checkbox_label' . $wpml_lang ] : __( 'Enabled', 'gdpr-cookie-compliance' );
323 $data->text_disable = isset( $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_disabled_checkbox_label' . $wpml_lang ] : __( 'Disabled', 'gdpr-cookie-compliance' );
324 $data->warning_message = isset( $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_secondary_notice();
325 $data->warning_message = wpautop( $data->warning_message );
326 $data->visibility = 'v1' === $layout ? 'style="display:none"' : '';
327 return $view_controller->load( 'modal.content-sections.third_party', $data );
328 }
329
330 /**
331 * GDPR Module - Custom CSS for branding
332 */
333 public function get_branding_styles() {
334 $view_controller = new GDPR_Modules_View();
335 $modal_options = $this->gdpr_options;
336 $wpml_lang = $this->wpml_lang;
337 $font_family = false;
338 if ( isset( $modal_options['moove_gdpr_plugin_font_type'] ) ) :
339 if ( '1' === $modal_options['moove_gdpr_plugin_font_type'] ) :
340 $font_family = "'Nunito', sans-serif";
341 elseif ( '2' === $modal_options['moove_gdpr_plugin_font_type'] ) :
342 $font_family = 'inherit';
343 else :
344 $font_family = isset( $modal_options['moove_gdpr_plugin_font_family'] ) && $modal_options['moove_gdpr_plugin_font_family'] ? $modal_options['moove_gdpr_plugin_font_family'] : "'Nunito', sans-serif";
345 endif;
346 endif;
347 $font_family = $font_family ? $font_family : ( isset( $modal_options['moove_gdpr_plugin_font_family'] ) && $modal_options['moove_gdpr_plugin_font_family'] ? $modal_options['moove_gdpr_plugin_font_family'] : "'Nunito', sans-serif" );
348 $data = new stdClass();
349 $data->primary_colour = isset( $modal_options['moove_gdpr_brand_colour'] ) && $modal_options['moove_gdpr_brand_colour'] ? $modal_options['moove_gdpr_brand_colour'] : '#0C4DA2';
350 $data->secondary_colour = '#000000';
351 $data->button_bg = isset( $modal_options['moove_gdpr_floating_button_background_colour'] ) && $modal_options['moove_gdpr_floating_button_background_colour'] ? $modal_options['moove_gdpr_floating_button_background_colour'] : '#373737';
352 $data->button_hover_bg = isset( $modal_options['moove_gdpr_floating_button_hover_background_colour'] ) && $modal_options['moove_gdpr_floating_button_hover_background_colour'] ? $modal_options['moove_gdpr_floating_button_hover_background_colour'] : '#000000';
353 $data->button_font = isset( $modal_options['moove_gdpr_floating_button_font_colour'] ) && $modal_options['moove_gdpr_floating_button_font_colour'] ? $modal_options['moove_gdpr_floating_button_font_colour'] : '#ffffff';
354 $data->font_family = $font_family;
355 return $view_controller->load( 'branding-styles', $data );
356
357 }
358
359 /**
360 * GDPR Module - Cookie Policy Page
361 */
362 public function get_section_cookiepolicy() {
363 $view_controller = new GDPR_Modules_View();
364 $modal_options = $this->gdpr_options;
365 $wpml_lang = $this->wpml_lang;
366 $gdpr_default_content = new Moove_GDPR_Content();
367 $layout = isset( $modal_options['moove_gdpr_plugin_layout'] ) ? $modal_options['moove_gdpr_plugin_layout'] : 'v1';
368 $tab_title = isset( $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] : __( 'Cookie Policy', 'gdpr-cookie-compliance' );
369 $tab_content = isset( $modal_options[ 'moove_gdpr_cookies_policy_tab_content' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_cookies_policy_tab_content' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_cookies_policy_tab_content' . $wpml_lang ] : $gdpr_default_content->moove_gdpr_get_cookie_policy_content();
370 $data = new stdClass();
371 $data->options = $modal_options;
372 $data->wpml_lang = $wpml_lang;
373 $data->tab_title = $tab_title;
374 $data->tab_content = wpautop( $tab_content );
375 $data->show = isset( $modal_options['moove_gdpr_cookie_policy_enable'] ) && 1 === intval( $modal_options['moove_gdpr_cookie_policy_enable'] ) ? true : false;
376 $data->visibility = 'v1' === $layout ? 'style="display:none"' : '';
377 return $view_controller->load( 'modal.content-sections.cookiepolicy', $data );
378 }
379
380 /**
381 * GDPR Module - Footer Button inside the Modal
382 */
383 public function get_tab_footer_buttons() {
384 $view_controller = new GDPR_Modules_View();
385 $modal_options = $this->gdpr_options;
386 $wpml_lang = $this->wpml_lang;
387 $data = new stdClass();
388 $data->settings_v = isset( $modal_options['moove_gdpr_save_settings_button_enable'] ) ? ( intval( $modal_options['moove_gdpr_save_settings_button_enable'] ) === 1 ? true : ( ! isset( $modal_options['moove_gdpr_save_settings_button_enable'] ) ? true : false ) ) : true;
389 $data->settings_label = isset( $modal_options[ 'moove_gdpr_modal_save_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_save_button_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_save_button_label' . $wpml_lang ] : __( 'Save Settings', 'gdpr-cookie-compliance' );
390
391 $data->allow_v = isset( $modal_options['moove_gdpr_enable_all_button_enable'] ) ? ( intval( $modal_options['moove_gdpr_enable_all_button_enable'] ) === 1 ? true : ( ! isset( $modal_options['moove_gdpr_enable_all_button_enable'] ) ? true : false ) ) : true;
392 $data->allow_label = isset( $modal_options[ 'moove_gdpr_modal_allow_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_allow_button_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_allow_button_label' . $wpml_lang ] : __( 'Enable All', 'gdpr-cookie-compliance' );
393
394 $data->reject_v = isset( $modal_options['moove_gdpr_reject_all_button_enable'] ) ? ( intval( $modal_options['moove_gdpr_reject_all_button_enable'] ) === 1 ? true : ( ! isset( $modal_options['moove_gdpr_reject_all_button_enable'] ) ? false : false ) ) : false;
395 $data->reject_label = isset( $modal_options[ 'moove_gdpr_modal_reject_button_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_modal_reject_button_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_modal_reject_button_label' . $wpml_lang ] : __( 'Reject All', 'gdpr-cookie-compliance' );
396 $data->buttons_order = isset( $modal_options['gdpr_gs_buttons_order'] ) ? json_decode( $modal_options['gdpr_gs_buttons_order'], true ) : array( 'enable', 'reject', 'save', 'close' );
397
398 return $view_controller->load( 'modal.tab-footer-buttons', $data );
399 }
400
401 /**
402 * GDPR Module - Navigation inside the modal
403 */
404 public function get_tab_navigation() {
405 $view_controller = new GDPR_Modules_View();
406 $modal_options = $this->gdpr_options;
407 $wpml_lang = $this->wpml_lang;
408 $strictly = isset( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) && intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) ? intval( $modal_options['moove_gdpr_strictly_necessary_cookies_functionality'] ) : 1;
409 $data = new stdClass();
410 $data->overview = new stdClass();
411 $data->strictly = new stdClass();
412 $data->advanced = new stdClass();
413 $data->third_party = new stdClass();
414 $data->cookiepolicy = new stdClass();
415
416 // OVERVIEW.
417 $data->overview->nav_label = isset( $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_privacy_overview_tab_title' . $wpml_lang ] : __( 'Privacy Overview', 'gdpr-cookie-compliance' );
418
419 // STRICTLY.
420 $data->strictly->show = 3 !== $strictly;
421 $data->strictly->nav_label = isset( $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_strictly_necessary_cookies_tab_title' . $wpml_lang ] : __( 'Strictly Necessary Cookies', 'gdpr-cookie-compliance' );
422
423 // THIRD PARTY.
424 $data->third_party->show = isset( $modal_options['moove_gdpr_third_party_cookies_enable'] ) && 1 === intval( $modal_options['moove_gdpr_third_party_cookies_enable'] ) ? true : false;
425 $data->third_party->nav_label = isset( $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_performance_cookies_tab_title' . $wpml_lang ] : __( '3rd Party Cookies', 'gdpr-cookie-compliance' );
426
427 // ADVANCED.
428 $data->advanced->show = isset( $modal_options['moove_gdpr_advanced_cookies_enable'] ) && 1 === intval( $modal_options['moove_gdpr_advanced_cookies_enable'] ) ? true : false;
429 $data->advanced->nav_label = isset( $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_advanced_cookies_tab_title' . $wpml_lang ] : __( 'Additional Cookies', 'gdpr-cookie-compliance' );
430
431 // COOKIEPOLICY.
432 $data->cookiepolicy->show = isset( $modal_options['moove_gdpr_cookie_policy_enable'] ) && 1 === intval( $modal_options['moove_gdpr_cookie_policy_enable'] ) ? true : false;
433 $data->cookiepolicy->nav_label = isset( $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] ) && $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] ? $modal_options[ 'moove_gdpr_cookie_policy_tab_nav_label' . $wpml_lang ] : __( 'Cookie Policy', 'gdpr-cookie-compliance' );
434
435 return $view_controller->load( 'modal.tab-navigation', $data );
436 }
437
438 }
439