| 1 |
<?php |
| 2 |
|
| 3 |
namespace Codelight\GDPR\Admin; |
| 4 |
|
| 5 |
class AdminTabGeneral extends AdminTab |
| 6 |
{ |
| 7 |
protected $slug = 'general'; |
| 8 |
|
| 9 |
public function __construct() |
| 10 |
{ |
| 11 |
$this->title = _x('General', '(Admin)', 'gdpr-framework'); |
| 12 |
/** |
| 13 |
* Register settings |
| 14 |
*/ |
| 15 |
$this->registerSetting('gdpr_enable'); |
| 16 |
$this->registerSetting('gdpr_enable_tac'); |
| 17 |
$this->registerSetting('gdpr_comment_checkbox'); |
| 18 |
$this->registerSetting('gdpr_register_checkbox'); |
| 19 |
|
| 20 |
$this->registerSetting('gdpr_tools_page'); |
| 21 |
$this->registerSetting('gdpr_custom_tools_page'); |
| 22 |
$this->registerSetting('gdpr_custom_terms_page'); |
| 23 |
$this->registerSetting('gdpr_policy_page'); |
| 24 |
$this->registerSetting('gdpr_custom_policy_page'); |
| 25 |
$this->registerSetting('gdpr_terms_page'); |
| 26 |
$this->registerSetting('gdpr_name_from'); |
| 27 |
$this->registerSetting('gdpr_email_from'); |
| 28 |
$this->registerSetting('gdpr_export_action'); |
| 29 |
$this->registerSetting('gdpr_export_action_email'); |
| 30 |
$this->registerSetting('gdpr_unknown_user_message'); |
| 31 |
|
| 32 |
$this->registerSetting('gdpr_delete_action'); |
| 33 |
$this->registerSetting('gdpr_delete_action_reassign'); |
| 34 |
$this->registerSetting('gdpr_delete_action_reassign_user'); |
| 35 |
$this->registerSetting('gdpr_delete_action_email'); |
| 36 |
|
| 37 |
$this->registerSetting('gdpr_enable_stylesheet'); |
| 38 |
$this->registerSetting('gdpr_enable_theme_compatibility'); |
| 39 |
if (class_exists( 'WooCommerce' )) { |
| 40 |
$this->registerSetting('gdpr_enable_woo_compatibility'); |
| 41 |
$this->registerSetting('gdpr_disable_checkbox_woo_compatibility'); |
| 42 |
$this->registerSetting('gdpr_disable_register_checkbox_woo_compatibility'); |
| 43 |
} |
| 44 |
if (class_exists( 'Easy_Digital_Downloads')) { |
| 45 |
$this->registerSetting('gdpr_enable_edd_compatibility'); |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
public function init() |
| 50 |
{ |
| 51 |
/** |
| 52 |
* General |
| 53 |
*/ |
| 54 |
$this->registerSettingSection( |
| 55 |
'gdpr_section_general', |
| 56 |
_x('General Settings', '(Admin)', 'gdpr-framework') |
| 57 |
); |
| 58 |
|
| 59 |
$this->registerSettingField( |
| 60 |
'gdpr_enable', |
| 61 |
_x('Enable Privacy Tools', '(Admin)', 'gdpr-framework'), |
| 62 |
[$this, 'renderEnableCheckbox'], |
| 63 |
'gdpr_section_general' |
| 64 |
); |
| 65 |
|
| 66 |
$this->registerSettingField( |
| 67 |
'gdpr_enable_tac', |
| 68 |
_x('Enable Term and Conditions', '(Admin)', 'gdpr-framework'), |
| 69 |
[$this, 'renderEnableCheckboxtac'], |
| 70 |
'gdpr_section_general' |
| 71 |
); |
| 72 |
|
| 73 |
$this->registerSettingField( |
| 74 |
'gdpr_comment_checkbox', |
| 75 |
_x('Disable Comment Checkbox', '(Admin)', 'gdpr-framework'), |
| 76 |
[$this, 'renderCommentCheckbox'], |
| 77 |
'gdpr_section_general' |
| 78 |
); |
| 79 |
|
| 80 |
$this->registerSettingField( |
| 81 |
'gdpr_register_checkbox', |
| 82 |
_x('Disable Register Form Checkbox', '(Admin)', 'gdpr-framework'), |
| 83 |
[$this, 'renderRegisterCheckbox'], |
| 84 |
'gdpr_section_general' |
| 85 |
); |
| 86 |
|
| 87 |
/** |
| 88 |
* GDPR Email setting |
| 89 |
*/ |
| 90 |
$this->registerSettingSection( |
| 91 |
'gdpr_email_section', |
| 92 |
_x('Email Setting', '(Admin)', 'gdpr-framework') |
| 93 |
); |
| 94 |
|
| 95 |
$this->registerSettingField( |
| 96 |
'gdpr_name_from', |
| 97 |
_x('From Name', '(Admin)', 'gdpr-framework'), |
| 98 |
[$this, 'renderNameFrom'], |
| 99 |
'gdpr_email_section' |
| 100 |
); |
| 101 |
|
| 102 |
$this->registerSettingField( |
| 103 |
'gdpr_email_from', |
| 104 |
_x('From Email', '(Admin)', 'gdpr-framework'), |
| 105 |
[$this, 'renderEmailFrom'], |
| 106 |
'gdpr_email_section' |
| 107 |
); |
| 108 |
/** |
| 109 |
* GDPR system pages |
| 110 |
*/ |
| 111 |
$this->registerSettingSection( |
| 112 |
'gdpr_section_pages', |
| 113 |
_x('Pages', '(Admin)', 'gdpr-framework') |
| 114 |
); |
| 115 |
|
| 116 |
$this->registerSettingField( |
| 117 |
'gdpr_tools_page', |
| 118 |
_x('Privacy Tools Page', '(Admin)', 'gdpr-framework'), |
| 119 |
[$this, 'renderPrivacyToolsPageSelector'], |
| 120 |
'gdpr_section_pages' |
| 121 |
); |
| 122 |
|
| 123 |
$this->registerSettingField( |
| 124 |
'gdpr_custom_tools_page', |
| 125 |
_x('Privacy Tools Custom URL', '(Admin)', 'gdpr-framework'), |
| 126 |
[$this, 'renderToolsCustomPageSelector'], |
| 127 |
'gdpr_section_pages' |
| 128 |
); |
| 129 |
|
| 130 |
$this->registerSettingField( |
| 131 |
'gdpr_policy_page', |
| 132 |
_x('Privacy Policy Page', '(Admin)', 'gdpr-framework'), |
| 133 |
[$this, 'renderPolicyPageSelector'], |
| 134 |
'gdpr_section_pages' |
| 135 |
); |
| 136 |
|
| 137 |
$this->registerSettingField( |
| 138 |
'gdpr_custom_policy_page', |
| 139 |
_x('Privacy Policy Custom URL', '(Admin)', 'gdpr-framework'), |
| 140 |
[$this, 'renderPolicyCustomPageSelector'], |
| 141 |
'gdpr_section_pages' |
| 142 |
); |
| 143 |
|
| 144 |
$this->registerSettingField( |
| 145 |
'gdpr_terms_page', |
| 146 |
_x('Terms & Conditions Page', '(Admin)', 'gdpr-framework'), |
| 147 |
[$this, 'renderTermsPageSelector'], |
| 148 |
'gdpr_section_pages' |
| 149 |
); |
| 150 |
|
| 151 |
$this->registerSettingField( |
| 152 |
'gdpr_custom_terms_page', |
| 153 |
_x('Terms & Conditions Custom URL', '(Admin)', 'gdpr-framework'), |
| 154 |
[$this, 'renderCustomTermsPageSelector'], |
| 155 |
'gdpr_section_pages' |
| 156 |
); |
| 157 |
|
| 158 |
/** |
| 159 |
* View & Export |
| 160 |
*/ |
| 161 |
$this->registerSettingSection( |
| 162 |
'gdpr_section_export', |
| 163 |
_x('View & Export Data', '(Admin)', 'gdpr-framework') |
| 164 |
); |
| 165 |
|
| 166 |
$this->registerSettingField( |
| 167 |
'gdpr_export_action', |
| 168 |
_x('Export action', '(Admin)', 'gdpr-framework'), |
| 169 |
[$this, 'renderExportActionSelector'], |
| 170 |
'gdpr_section_export' |
| 171 |
); |
| 172 |
|
| 173 |
$this->registerSettingField( |
| 174 |
'gdpr_export_action_email', |
| 175 |
_x('Email to notify', '(Admin)', 'gdpr-framework'), |
| 176 |
[$this, 'renderExportActionEmail'], |
| 177 |
'gdpr_section_export', |
| 178 |
['class' => 'js-gdpr-export-action-email hidden'] |
| 179 |
); |
| 180 |
|
| 181 |
$this->registerSettingField( |
| 182 |
'gdpr_unknown_user_message', |
| 183 |
_x('Unknown Data Subject Message', '(Admin)', 'gdpr-framework'), |
| 184 |
[$this, 'renderUnknownUserField'], |
| 185 |
'gdpr_section_export' |
| 186 |
); |
| 187 |
|
| 188 |
/** |
| 189 |
* Delete data |
| 190 |
*/ |
| 191 |
$this->registerSettingSection( |
| 192 |
'gdpr_section_delete', |
| 193 |
_x('Delete & Anonymize Data', '(Admin)', 'gdpr-framework') |
| 194 |
); |
| 195 |
|
| 196 |
$this->registerSettingField( |
| 197 |
'gdpr_delete_action', |
| 198 |
_x('Delete action', '(Admin)', 'gdpr-framework'), |
| 199 |
[$this, 'renderDeleteActionSelector'], |
| 200 |
'gdpr_section_delete' |
| 201 |
); |
| 202 |
|
| 203 |
$this->registerSettingField( |
| 204 |
'gdpr_delete_action_reassign', |
| 205 |
_x('Delete or reassign content?', '(Admin)', 'gdpr-framework'), |
| 206 |
[$this, 'renderDeleteActionReassign'], |
| 207 |
'gdpr_section_delete', |
| 208 |
['class' => 'js-gdpr-delete-action-reassign hidden'] |
| 209 |
); |
| 210 |
|
| 211 |
$this->registerSettingField( |
| 212 |
'gdpr_delete_action_reassign_user', |
| 213 |
_x('Reassign content to', '(Admin)', 'gdpr-framework'), |
| 214 |
[$this, 'renderDeleteActionReassignUser'], |
| 215 |
'gdpr_section_delete', |
| 216 |
['class' => 'js-gdpr-delete-action-reassign-user hidden'] |
| 217 |
); |
| 218 |
|
| 219 |
$this->registerSettingField( |
| 220 |
'gdpr_delete_action_email', |
| 221 |
_x('Email to notify', '(Admin)', 'gdpr-framework'), |
| 222 |
[$this, 'renderDeleteActionEmail'], |
| 223 |
'gdpr_section_delete', |
| 224 |
['class' => 'js-gdpr-delete-action-email hidden'] |
| 225 |
); |
| 226 |
|
| 227 |
/** |
| 228 |
* Stylesheet |
| 229 |
*/ |
| 230 |
|
| 231 |
$this->registerSettingSection( |
| 232 |
'gdpr_section_stylesheet', |
| 233 |
_x('Styling', '(Admin)', 'gdpr-framework') |
| 234 |
); |
| 235 |
|
| 236 |
$this->registerSettingField( |
| 237 |
'gdpr_enable_theme_compatibility', |
| 238 |
_x('Enable basic styling on Privacy Tools page', '(Admin)', 'gdpr-framework'), |
| 239 |
[$this, 'renderStylesheetSelector'], |
| 240 |
'gdpr_section_stylesheet' |
| 241 |
); |
| 242 |
|
| 243 |
if (gdpr('themes')->isCurrentThemeSupported()) { |
| 244 |
|
| 245 |
/** |
| 246 |
* Compatibility settings |
| 247 |
*/ |
| 248 |
$this->registerSettingSection( |
| 249 |
'gdpr_section_compatibility', |
| 250 |
_x('Compatibility', '(Admin)', 'gdpr-framework') |
| 251 |
); |
| 252 |
|
| 253 |
$this->registerSettingField( |
| 254 |
'gdpr_enable_theme_compatibility', |
| 255 |
_x('Enable automatic theme compatibility', '(Admin)', 'gdpr-framework'), |
| 256 |
[$this, 'renderThemeCompatibilitySelector'], |
| 257 |
'gdpr_section_compatibility' |
| 258 |
); |
| 259 |
} |
| 260 |
if (class_exists( 'WooCommerce' )) { |
| 261 |
|
| 262 |
/** |
| 263 |
* Woocommerce Compatibility settings |
| 264 |
*/ |
| 265 |
$this->registerSettingSection( |
| 266 |
'gdpr_woo_compatibility', |
| 267 |
_x('Woocommerce Integration', '(Admin)', 'gdpr-framework') |
| 268 |
); |
| 269 |
|
| 270 |
$this->registerSettingField( |
| 271 |
'gdpr_enable_woo_compatibility', |
| 272 |
_x('Enable WooCommerce Compatibility', '(Admin)', 'gdpr-framework'), |
| 273 |
[$this, 'renderwooCompatibilitySelector'], |
| 274 |
'gdpr_woo_compatibility' |
| 275 |
); |
| 276 |
|
| 277 |
$this->registerSettingField( |
| 278 |
'gdpr_disable_checkbox_woo_compatibility', |
| 279 |
_x('Disable WooCommerce Privacy Checkbox', '(Admin)', 'gdpr-framework'), |
| 280 |
[$this, 'renderwoodisablewooSelector'], |
| 281 |
'gdpr_woo_compatibility' |
| 282 |
); |
| 283 |
|
| 284 |
$this->registerSettingField( |
| 285 |
'gdpr_disable_register_checkbox_woo_compatibility', |
| 286 |
_x('Disable WooCommerce Register Privacy Checkbox', '(Admin)', 'gdpr-framework'), |
| 287 |
[$this, 'renderwooregisterdisablewooSelector'], |
| 288 |
'gdpr_woo_compatibility' |
| 289 |
); |
| 290 |
} |
| 291 |
|
| 292 |
if (class_exists( 'Easy_Digital_Downloads')) { |
| 293 |
/** |
| 294 |
* Easy Digital Downloads Compatibility settings |
| 295 |
*/ |
| 296 |
$this->registerSettingSection( |
| 297 |
'gdpr_edd_compatibility', |
| 298 |
_x('Easy Digital Download Integration', '(Admin)', 'gdpr-framework') |
| 299 |
); |
| 300 |
|
| 301 |
$this->registerSettingField( |
| 302 |
'gdpr_enable_edd_compatibility', |
| 303 |
_x('Enable EDD Compatibility', '(Admin)', 'gdpr-framework'), |
| 304 |
[$this, 'rendereddCompatibilitySelector'], |
| 305 |
'gdpr_edd_compatibility' |
| 306 |
); |
| 307 |
} |
| 308 |
} |
| 309 |
|
| 310 |
/** |
| 311 |
* Rendering Views |
| 312 |
*/ |
| 313 |
|
| 314 |
public function renderEnableCheckbox() |
| 315 |
{ |
| 316 |
global $gdpr; |
| 317 |
$enabled = $gdpr->Options->get('enable'); |
| 318 |
echo gdpr('view')->render('admin/general/enable', compact('enabled')); |
| 319 |
} |
| 320 |
|
| 321 |
public function renderEnableCheckboxtac() |
| 322 |
{ |
| 323 |
global $gdpr; |
| 324 |
$enabled = $gdpr->Options->get('enable_tac'); |
| 325 |
echo gdpr('view')->render('admin/general/enable-tac', compact('enabled')); |
| 326 |
} |
| 327 |
|
| 328 |
public function renderCommentCheckbox() |
| 329 |
{ |
| 330 |
global $gdpr; |
| 331 |
$content['option_name'] = 'comment_checkbox'; |
| 332 |
$content['value'] = $gdpr->Options->get('comment_checkbox'); |
| 333 |
$content['option'] = _x('Disable Checkbox For Comments', '(Admin)', 'gdpr-framework'); |
| 334 |
echo gdpr('view')->render('admin/general/disble-checkbox', compact('content')); |
| 335 |
} |
| 336 |
|
| 337 |
public function renderRegisterCheckbox() |
| 338 |
{ |
| 339 |
global $gdpr; |
| 340 |
$content['option_name'] = 'register_checkbox'; |
| 341 |
$content['value'] = $gdpr->Options->get('register_checkbox'); |
| 342 |
$content['option'] = _x('Disable Checkbox For Register Form', '(Admin)', 'gdpr-framework'); |
| 343 |
echo gdpr('view')->render('admin/general/disble-checkbox', compact('content')); |
| 344 |
} |
| 345 |
|
| 346 |
public function renderEnableCheckboxpopup() |
| 347 |
{ |
| 348 |
global $gdpr; |
| 349 |
$enabled = $gdpr->Options->get('enable_popup'); |
| 350 |
echo gdpr('view')->render('admin/general/enable-popup', compact('enabled')); |
| 351 |
} |
| 352 |
|
| 353 |
public function renderEnableOneTimeCheckboxpopup() |
| 354 |
{ |
| 355 |
global $gdpr; |
| 356 |
$enabled = $gdpr->Options->get('onetime_popup'); |
| 357 |
echo gdpr('view')->render('admin/general/enable-onetime-popup', compact('enabled')); |
| 358 |
} |
| 359 |
|
| 360 |
public function renderheaderCheckboxpopup() |
| 361 |
{ |
| 362 |
global $gdpr; |
| 363 |
$content = $gdpr->Options->get('header'); |
| 364 |
echo gdpr('view')->render('admin/general/enable_popup_header', compact('content')); |
| 365 |
} |
| 366 |
public function rendercontentCheckboxpopup() |
| 367 |
{ |
| 368 |
global $gdpr; |
| 369 |
$content = $gdpr->Options->get('popup_content'); |
| 370 |
echo gdpr('view')->render('admin/general/enable_popup_content', compact('content')); |
| 371 |
} |
| 372 |
|
| 373 |
public function renderNameFrom() |
| 374 |
{ |
| 375 |
global $gdpr; |
| 376 |
$content = $gdpr->Options->get('name_from'); |
| 377 |
echo gdpr('view')->render('admin/general/name_from', compact('content')); |
| 378 |
} |
| 379 |
|
| 380 |
public function renderEmailFrom() |
| 381 |
{ |
| 382 |
global $gdpr; |
| 383 |
$content = $gdpr->Options->get('email_from'); |
| 384 |
echo gdpr('view')->render('admin/general/email_from', compact('content')); |
| 385 |
} |
| 386 |
|
| 387 |
public function renderpopupBackgroundcolor() |
| 388 |
{ |
| 389 |
global $gdpr; |
| 390 |
$content['value'] = $gdpr->Options->get('popup_background'); |
| 391 |
$content['option'] = 'background'; |
| 392 |
echo gdpr('view')->render('admin/general/popup_background_color_picker', compact('content')); |
| 393 |
} |
| 394 |
|
| 395 |
public function renderpopupTextcolor() |
| 396 |
{ |
| 397 |
global $gdpr; |
| 398 |
$content['value'] = $gdpr->Options->get('popup_text'); |
| 399 |
$content['option'] = 'text'; |
| 400 |
echo gdpr('view')->render('admin/general/popup_background_color_picker', compact('content')); |
| 401 |
} |
| 402 |
|
| 403 |
public function renderbuttonBackgroundcolor() |
| 404 |
{ |
| 405 |
global $gdpr; |
| 406 |
$content['value'] = $gdpr->Options->get('popup_button_background'); |
| 407 |
$content['option'] = 'button_background'; |
| 408 |
echo gdpr('view')->render('admin/general/popup_background_color_picker', compact('content')); |
| 409 |
} |
| 410 |
public function renderbuttonTextcolor() |
| 411 |
{ |
| 412 |
global $gdpr; |
| 413 |
$content['value'] = $gdpr->Options->get('popup_button_text'); |
| 414 |
$content['option'] = 'button_text'; |
| 415 |
echo gdpr('view')->render('admin/general/popup_background_color_picker', compact('content')); |
| 416 |
} |
| 417 |
|
| 418 |
public function renderborderTextcolor() |
| 419 |
{ |
| 420 |
global $gdpr; |
| 421 |
$content['value'] = $gdpr->Options->get('popup_border_text'); |
| 422 |
$content['option'] = 'border_text'; |
| 423 |
echo gdpr('view')->render('admin/general/popup_background_color_picker', compact('content')); |
| 424 |
} |
| 425 |
|
| 426 |
public function renderPrivacyToolsPageSelector() |
| 427 |
{ |
| 428 |
global $gdpr; |
| 429 |
wp_dropdown_pages([ |
| 430 |
'name' => 'gdpr_tools_page', |
| 431 |
'show_option_none' => _x('— Select —', '(Admin)', 'gdpr-framework'), |
| 432 |
'option_none_value' => '0', |
| 433 |
'selected' => $gdpr->Options->get('tools_page'), |
| 434 |
'class' => 'js-gdpr-select2 gdpr-select', |
| 435 |
'post_status' => 'publish,draft', |
| 436 |
]); |
| 437 |
echo gdpr('view')->render('admin/general/description-data-page'); |
| 438 |
} |
| 439 |
|
| 440 |
/** |
| 441 |
* Render the GDPR policy page selector dropdown |
| 442 |
*/ |
| 443 |
public function renderPolicyPageSelector() |
| 444 |
{ |
| 445 |
global $gdpr; |
| 446 |
wp_dropdown_pages([ |
| 447 |
'name' => 'gdpr_policy_page', |
| 448 |
'show_option_none' => _x('— Select —', '(Admin)', 'gdpr-framework'), |
| 449 |
'option_none_value' => '0', |
| 450 |
'selected' => $gdpr->Options->get('policy_page'), |
| 451 |
'class' => 'js-gdpr-select2 gdpr-select', |
| 452 |
'post_status' => 'publish,draft', |
| 453 |
]); |
| 454 |
echo gdpr('view')->render('admin/privacy-policy/description-policy-page'); |
| 455 |
} |
| 456 |
|
| 457 |
public function renderPolicyCustomPageSelector() |
| 458 |
{ |
| 459 |
global $gdpr; |
| 460 |
$content = $gdpr->Options->get('custom_policy_page'); |
| 461 |
echo gdpr('view')->render('admin/general/custom-policy-url', compact('content')); |
| 462 |
} |
| 463 |
|
| 464 |
public function renderToolsCustomPageSelector() |
| 465 |
{ |
| 466 |
global $gdpr; |
| 467 |
$content = $gdpr->Options->get('custom_tools_page'); |
| 468 |
echo gdpr('view')->render('admin/general/custom-tools-url', compact('content')); |
| 469 |
} |
| 470 |
|
| 471 |
public function renderTermsPageSelector() |
| 472 |
{ |
| 473 |
global $gdpr; |
| 474 |
wp_dropdown_pages([ |
| 475 |
'name' => 'gdpr_terms_page', |
| 476 |
'show_option_none' => _x('— Select —', '(Admin)', 'gdpr-framework'), |
| 477 |
'option_none_value' => '0', |
| 478 |
'selected' => $gdpr->Options->get('terms_page'), |
| 479 |
'class' => 'js-gdpr-select2 gdpr-select', |
| 480 |
'post_status' => 'publish,draft', |
| 481 |
]); |
| 482 |
echo gdpr('view')->render('admin/general/description-terms-page'); |
| 483 |
} |
| 484 |
|
| 485 |
public function renderCustomTermsPageSelector() |
| 486 |
{ |
| 487 |
global $gdpr; |
| 488 |
$content = $gdpr->Options->get('custom_terms_page'); |
| 489 |
echo gdpr('view')->render('admin/general/custom-terms-url', compact('content')); |
| 490 |
} |
| 491 |
|
| 492 |
public function renderExportActionSelector() |
| 493 |
{ |
| 494 |
global $gdpr; |
| 495 |
$exportAction = $gdpr->Options->get('export_action'); |
| 496 |
echo gdpr('view')->render('admin/general/export-action', compact('exportAction')); |
| 497 |
echo gdpr('view')->render('admin/general/description-export-action'); |
| 498 |
} |
| 499 |
|
| 500 |
public function renderUnknownUserField() |
| 501 |
{ |
| 502 |
$content = gdpr('options')->get('unknown_user_message', GDPR_DEFAULT_UNKNOWN_USER_MESSAGE); |
| 503 |
if (empty(trim($content))) { |
| 504 |
$content = GDPR_DEFAULT_UNKNOWN_USER_MESSAGE; |
| 505 |
gdpr('options')->set('unknown_user_message', $content); |
| 506 |
} |
| 507 |
echo gdpr('view')->render('admin/general/unknown-user-message', compact('content')); |
| 508 |
} |
| 509 |
|
| 510 |
public function renderPopupThemeSelector() |
| 511 |
{ |
| 512 |
global $gdpr; |
| 513 |
$themeAction = $gdpr->Options->get('popup_theme'); |
| 514 |
echo gdpr('view')->render('admin/general/theme-action', compact('themeAction')); |
| 515 |
echo gdpr('view')->render('admin/general/description-theme-action'); |
| 516 |
} |
| 517 |
public function renderPopupPositionSelector() |
| 518 |
{ |
| 519 |
global $gdpr; |
| 520 |
$positionAction = $gdpr->Options->get('popup_position'); |
| 521 |
echo gdpr('view')->render('admin/general/position-action', compact('positionAction')); |
| 522 |
echo gdpr('view')->render('admin/general/description-position-action'); |
| 523 |
} |
| 524 |
|
| 525 |
public function renderExportActionEmail() |
| 526 |
{ |
| 527 |
global $gdpr; |
| 528 |
$exportActionEmail = $gdpr->Options->get('export_action_email'); |
| 529 |
echo gdpr('view')->render('admin/general/export-action-email', compact('exportActionEmail')); |
| 530 |
} |
| 531 |
|
| 532 |
public function renderDeleteActionSelector() |
| 533 |
{ |
| 534 |
global $gdpr; |
| 535 |
$deleteAction = $gdpr->Options->get('delete_action'); |
| 536 |
echo gdpr('view')->render('admin/general/delete-action', compact('deleteAction')); |
| 537 |
echo gdpr('view')->render('admin/general/description-delete-action'); |
| 538 |
} |
| 539 |
|
| 540 |
public function renderDeleteActionReassign() |
| 541 |
{ |
| 542 |
global $gdpr; |
| 543 |
$reassign = $gdpr->Options->get('delete_action_reassign'); |
| 544 |
echo gdpr('view')->render('admin/general/delete-action-reassign', compact('reassign')); |
| 545 |
} |
| 546 |
|
| 547 |
public function renderDeleteActionReassignUser() |
| 548 |
{ |
| 549 |
global $gdpr; |
| 550 |
wp_dropdown_users([ |
| 551 |
'name' => 'gdpr_delete_action_reassign_user', |
| 552 |
'show_option_none' => _x('— Select —', '(Admin)', 'gdpr-framework'), |
| 553 |
'option_none_value' => '0', |
| 554 |
'selected' => $gdpr->Options->get('delete_action_reassign_user'), |
| 555 |
'class' => 'js-gdpr-select2 gdpr-select', |
| 556 |
'role__in' => apply_filters('gdpr/options/reassign/roles', ['administrator', 'editor']), |
| 557 |
]); |
| 558 |
} |
| 559 |
|
| 560 |
public function renderDeleteActionEmail() |
| 561 |
{ |
| 562 |
global $gdpr; |
| 563 |
$deleteActionEmail = $gdpr->Options->get('delete_action_email'); |
| 564 |
echo gdpr('view')->render('admin/general/delete-action-email', compact('deleteActionEmail')); |
| 565 |
} |
| 566 |
|
| 567 |
public function renderStylesheetSelector() |
| 568 |
{ |
| 569 |
global $gdpr; |
| 570 |
$enabled = $gdpr->Options->get('enable_stylesheet'); |
| 571 |
echo gdpr('view')->render('admin/general/stylesheet', compact('enabled')); |
| 572 |
} |
| 573 |
|
| 574 |
public function renderThemeCompatibilitySelector() |
| 575 |
{ |
| 576 |
global $gdpr; |
| 577 |
$enabled = $gdpr->Options->get('enable_theme_compatibility'); |
| 578 |
echo gdpr('view')->render('admin/general/theme-compatibility', compact('enabled')); |
| 579 |
} |
| 580 |
|
| 581 |
public function renderwooCompatibilitySelector() |
| 582 |
{ |
| 583 |
global $gdpr; |
| 584 |
$enabled = $gdpr->Options->get('enable_woo_compatibility'); |
| 585 |
echo gdpr('view')->render('admin/general/woo-compatibility', compact('enabled')); |
| 586 |
} |
| 587 |
public function renderwoodisablewooSelector() |
| 588 |
{ |
| 589 |
global $gdpr; |
| 590 |
$enabled = $gdpr->Options->get('disable_checkbox_woo_compatibility'); |
| 591 |
echo gdpr('view')->render('admin/general/woo-disable_checkbox', compact('enabled')); |
| 592 |
} |
| 593 |
public function renderwooregisterdisablewooSelector() |
| 594 |
{ |
| 595 |
global $gdpr; |
| 596 |
$enabled = $gdpr->Options->get('disable_register_checkbox_woo_compatibility'); |
| 597 |
echo gdpr('view')->render('admin/general/woo-disable_register_checkbox', compact('enabled')); |
| 598 |
} |
| 599 |
public function rendereddCompatibilitySelector() |
| 600 |
{ |
| 601 |
global $gdpr; |
| 602 |
$enabled = $gdpr->Options->get('enable_edd_compatibility'); |
| 603 |
echo gdpr('view')->render('admin/general/edd-compatibility', compact('enabled')); |
| 604 |
} |
| 605 |
} |
| 606 |
|