| 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 Integrations extends InstallerStep implements InstallerStepInterface |
| 9 |
{ |
| 10 |
protected $slug = 'integrations'; |
| 11 |
|
| 12 |
protected $type = 'wizard'; |
| 13 |
|
| 14 |
protected $template = 'installer/steps/integrations'; |
| 15 |
|
| 16 |
protected $activeSteps = 4; |
| 17 |
|
| 18 |
protected function renderContent() |
| 19 |
{ |
| 20 |
global $gdpr; |
| 21 |
$enableThemeCompatibility = $gdpr->Options->get('enable_theme_compatibility'); |
| 22 |
$currentTheme = gdpr('themes')->getCurrentThemeName(); |
| 23 |
$isThemeSupported = gdpr('themes')->isCurrentThemeSupported(); |
| 24 |
|
| 25 |
$hasWooCommerce = false; |
| 26 |
$hasEDD = false; |
| 27 |
$hasSendGrid = class_exists('\Sendgrid_Tools'); |
| 28 |
|
| 29 |
echo gdpr('view')->render( |
| 30 |
$this->template, |
| 31 |
compact( |
| 32 |
'enableThemeCompatibility', |
| 33 |
'hasEDD', |
| 34 |
'hasWooCommerce', |
| 35 |
'currentTheme', |
| 36 |
'isThemeSupported', |
| 37 |
'hasSendGrid' |
| 38 |
) |
| 39 |
); |
| 40 |
} |
| 41 |
|
| 42 |
public function submit() |
| 43 |
{ |
| 44 |
global $gdpr; |
| 45 |
if (isset($_POST['gdpr_enable_theme_compatibility']) && 'yes' === $_POST['gdpr_enable_theme_compatibility']) { |
| 46 |
$gdpr->Options->set('enable_theme_compatibility', true); |
| 47 |
} else { |
| 48 |
$gdpr->Options->set('enable_theme_compatibility', false); |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
|