diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..b6349d9 --- /dev/null +++ b/composer.json @@ -0,0 +1,13 @@ +{ + "name": "seers_cookie_consent_privacy_policy", + "type": "drupal-module", + "description": "Seers cookie consent fulfils the requirements of transparency, consent and documentation under ePrivacy Directive and GDPR.", + "keywords": [ + ], + "homepage": "https://www.drupal.org/project/seers_cookie_consent_privacy_policy", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/seers_cookie_consent_privacy_policy", + "source": "http://cgit.drupalcode.org/seers_cookie_consent_privacy_policy" + } +} diff --git a/config/install/seers_cookie_consent_privacy_policy.seercookieconsent.yml b/config/install/seers_cookie_consent_privacy_policy.seercookieconsent.yml new file mode 100644 index 0000000..6d7f9d0 --- /dev/null +++ b/config/install/seers_cookie_consent_privacy_policy.seercookieconsent.yml @@ -0,0 +1 @@ +seers_cookie_consent_privacy_policy: diff --git a/css/cookie-style.css b/css/cookie-style.css new file mode 100644 index 0000000..67f9a05 --- /dev/null +++ b/css/cookie-style.css @@ -0,0 +1,7 @@ + +/* +* For Cookie Policy & Cookie Declarations +*/ +.cx-policy-container, .cx-table-container { + width: 100% !important; +} diff --git a/seers_cookie_consent_privacy_policy.info.yml b/seers_cookie_consent_privacy_policy.info.yml new file mode 100644 index 0000000..5b0c077 --- /dev/null +++ b/seers_cookie_consent_privacy_policy.info.yml @@ -0,0 +1,6 @@ +name: 'Seers Cookie Consent Banner Privacy Policy' +type: module +description: 'Seers cookie consent fulfils the requirements of transparency, consent and documentation under ePrivacy Directive and GDPR.' +core: 8.x +core_version_requirement: ^7 || ^8 || ^9 +package: 'Custom' diff --git a/seers_cookie_consent_privacy_policy.libraries.yml b/seers_cookie_consent_privacy_policy.libraries.yml new file mode 100644 index 0000000..ef7931d --- /dev/null +++ b/seers_cookie_consent_privacy_policy.libraries.yml @@ -0,0 +1,5 @@ +global: + version: VERSION + css: + theme: + css/cookie-style.css: {} diff --git a/seers_cookie_consent_privacy_policy.links.menu.yml b/seers_cookie_consent_privacy_policy.links.menu.yml new file mode 100644 index 0000000..12c551f --- /dev/null +++ b/seers_cookie_consent_privacy_policy.links.menu.yml @@ -0,0 +1,6 @@ +seers_cookie_consent_privacy_policy.seer_cookie_consent_form: + title: 'SeerCookieConsentForm' + route_name: seers_cookie_consent_privacy_policy.seer_cookie_consent_form + description: 'Enter your cookie id' + parent: system.admin_config_system + weight: 99 diff --git a/seers_cookie_consent_privacy_policy.module b/seers_cookie_consent_privacy_policy.module new file mode 100644 index 0000000..6c48565 --- /dev/null +++ b/seers_cookie_consent_privacy_policy.module @@ -0,0 +1,81 @@ +doActiveInactive(1, $modulename); + +} + + +/** + * Implements hook_preprocess(). + */ +function seers_cookie_consent_privacy_policy_preprocess_page(&$variables, $hook) +{ + + $variables['#attached']['library'][] = 'seers_cookie_consent_privacy_policy/global'; + +} + +/** + * Implements hook_page_attachments(). + */ +function seers_cookie_consent_privacy_policy_page_attachments(&$page) +{ + $config = \Drupal::config('seers_cookie_consent_privacy_policy.seercookieconsent')->getRawData(); + /** + * Initial JS. + */ + if (!empty($config["cookie_id"])) { + $page['#attached']['html_head'][] = [ + [ + // Add a