| 1 |
<?php |
| 2 |
namespace Codelight\GDPR; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 5 |
|
| 6 |
use Codelight\GDPR\DataSubject\DataSubjectIdentificator; |
| 7 |
use Codelight\GDPR\DataSubject\DataSubjectAuthenticator; |
| 8 |
use Codelight\GDPR\Modules\WPML\WPML; |
| 9 |
use Codelight\GDPR\DataSubject\DataExporter; |
| 10 |
|
| 11 |
class Singleton { |
| 12 |
var $View; |
| 13 |
var $Options; |
| 14 |
var $Consent; |
| 15 |
var $Helpers; |
| 16 |
var $Themes; |
| 17 |
var $DataSubject; |
| 18 |
var $AdminNotice; |
| 19 |
var $AdminError; |
| 20 |
var $AdminInstallerNotice; |
| 21 |
var $PrivacySafe; |
| 22 |
var $AdminModal; |
| 23 |
var $AdminPage; |
| 24 |
var $AdminTabGeneral; |
| 25 |
var $PluginUrl; |
| 26 |
var $PluginPath; |
| 27 |
var $PluginTemplatePath; |
| 28 |
var $InstallerWizardUrl; |
| 29 |
var $DataSubjectAuthenticator; |
| 30 |
var $DataSubjectIdentificator; |
| 31 |
var $DataExporter; |
| 32 |
var $UserConsentModel; |
| 33 |
var $DataManager; |
| 34 |
var $Controller; |
| 35 |
var $HelpUrl; |
| 36 |
|
| 37 |
function init($path) { |
| 38 |
$this->PluginUrl = plugin_dir_url($path); |
| 39 |
$this->PluginPath = plugin_dir_path($path); |
| 40 |
$this->PluginTemplatePath = plugin_dir_path($path) . 'views/'; |
| 41 |
$this->HelpUrl = 'https://www.data443.com/gdpr-framework/'; |
| 42 |
|
| 43 |
$this->InstallerWizardUrl = self_admin_url("index.php?page=gdpr-setup&gdpr-step="); |
| 44 |
|
| 45 |
$this->View = new View(); |
| 46 |
$this->Options = new Options\Options(); |
| 47 |
$model = new Components\Consent\UserConsentModel(); |
| 48 |
$this->UserConsentModel = $model; |
| 49 |
$this->Consent = new Components\Consent\ConsentManager($model); |
| 50 |
$this->Helpers = new Helpers(); |
| 51 |
$this->Themes = new Components\Themes\Themes(); |
| 52 |
$this->DataSubject = new DataSubject\DataSubjectManager($this->Consent); |
| 53 |
|
| 54 |
new WPML(); |
| 55 |
$identificator = new DataSubjectIdentificator($this->DataSubject, $this->Options, $model); |
| 56 |
$authenticator = new DataSubjectAuthenticator($this->DataSubject, $identificator); |
| 57 |
new Router($authenticator); |
| 58 |
$this->DataSubjectAuthenticator = $authenticator; |
| 59 |
$this->DataSubjectIdentificator = $identificator; |
| 60 |
$this->DataExporter = new DataExporter(); |
| 61 |
new Components\PrivacyToolsPage\PrivacyToolsPage(); |
| 62 |
new Components\WordpressComments\WordpressComments($this->DataSubject); |
| 63 |
$this->DataManager = new Components\WordpressUser\DataManager(); |
| 64 |
new Components\WordpressUser\WordpressUser($this->DataSubject, $this->DataManager); |
| 65 |
new Components\Themes\Themes(); |
| 66 |
|
| 67 |
if (defined('WPCF7_VERSION')) { |
| 68 |
new Modules\ContactForm7\ContactForm7($this->DataSubject, $this->Consent); |
| 69 |
} |
| 70 |
|
| 71 |
if (defined('FLAMINGO_VERSION')) { |
| 72 |
new Modules\ContactForm7\Flamingo(); |
| 73 |
} |
| 74 |
|
| 75 |
if ( defined('WC_VERSION') ) { |
| 76 |
new Modules\WooCommerceGdpr\WooCommerceGdpr($this->DataSubject, $this->Consent); |
| 77 |
} |
| 78 |
|
| 79 |
if ( defined('EDD_VERSION') ) { |
| 80 |
new Modules\EddGdpr\EddGdpr($this->DataSubject, $this->Consent); |
| 81 |
} |
| 82 |
|
| 83 |
if ( defined('ES_PLUGIN_VERSION') ) { |
| 84 |
new Modules\NewsletterGdpr\NewsletterGdpr($this->DataSubject, $this->Consent); |
| 85 |
} |
| 86 |
} |
| 87 |
} |