| 1 |
<?php |
| 2 |
|
| 3 |
namespace Codelight\GDPR\Installer\Steps; |
| 4 |
|
| 5 |
use Codelight\GDPR\Installer\InstallerStep; |
| 6 |
use Codelight\GDPR\Installer\InstallerStepInterface; |
| 7 |
|
| 8 |
class ConfigurationSettings extends InstallerStep implements InstallerStepInterface |
| 9 |
{ |
| 10 |
protected $slug = 'configuration-settings'; |
| 11 |
|
| 12 |
protected $type = 'wizard'; |
| 13 |
|
| 14 |
protected $template = 'installer/steps/configuration-settings'; |
| 15 |
|
| 16 |
protected $activeSteps = 1; |
| 17 |
|
| 18 |
protected function renderContent() |
| 19 |
{ |
| 20 |
global $gdpr; |
| 21 |
$privacyToolsPageUrl = get_permalink($gdpr->Options->get('tools_page')); |
| 22 |
$deleteAction = $gdpr->Options->get('delete_action'); |
| 23 |
$deleteActionEmail = $gdpr->Options->get('delete_action_email'); |
| 24 |
|
| 25 |
$exportAction = $gdpr->Options->get('export_action'); |
| 26 |
$exportActionEmail = $gdpr->Options->get('export_action_email'); |
| 27 |
|
| 28 |
$reassign = $gdpr->Options->get('delete_action_reassign'); |
| 29 |
$reassignUser = $gdpr->Options->get('delete_action_reassign_user'); |
| 30 |
|
| 31 |
echo gdpr('view')->render( |
| 32 |
$this->template, |
| 33 |
compact( |
| 34 |
'deleteAction', |
| 35 |
'deleteActionEmail', |
| 36 |
'exportAction', |
| 37 |
'exportActionEmail', |
| 38 |
'privacyToolsPageUrl', |
| 39 |
'reassign', |
| 40 |
'reassignUser' |
| 41 |
) |
| 42 |
); |
| 43 |
} |
| 44 |
|
| 45 |
public function submit() |
| 46 |
{ |
| 47 |
global $gdpr; |
| 48 |
if (isset($_POST['gdpr_export_action'])) { |
| 49 |
$gdpr->Options->set('export_action', sanitize_text_field($_POST['gdpr_export_action'])); |
| 50 |
} |
| 51 |
|
| 52 |
if (isset($_POST['gdpr_export_action_email'])) { |
| 53 |
$gdpr->Options->set('export_action_email', sanitize_email($_POST['gdpr_export_action_email'])); |
| 54 |
} |
| 55 |
|
| 56 |
if (isset($_POST['gdpr_delete_action'])) { |
| 57 |
$gdpr->Options->set('delete_action', sanitize_text_field($_POST['gdpr_delete_action'])); |
| 58 |
} |
| 59 |
|
| 60 |
if (isset($_POST['gdpr_delete_action_email'])) { |
| 61 |
$gdpr->Options->set('delete_action_email', sanitize_email($_POST['gdpr_delete_action_email'])); |
| 62 |
} |
| 63 |
|
| 64 |
if (isset($_POST['gdpr_delete_action_reassign'])) { |
| 65 |
$gdpr->Options->set('delete_action_reassign', sanitize_text_field($_POST['gdpr_delete_action_reassign'])); |
| 66 |
} |
| 67 |
|
| 68 |
if (isset($_POST['gdpr_delete_action_reassign_user'])) { |
| 69 |
$gdpr->Options->set('delete_action_reassign_user', sanitize_text_field($_POST['gdpr_delete_action_reassign_user'])); |
| 70 |
} |
| 71 |
} |
| 72 |
} |
| 73 |
|