From 627fb85cc7a95742696ea290034b832a923038e9 Mon Sep 17 00:00:00 2001 From: Erwin Steinbinder Date: Tue, 18 Aug 2020 15:11:10 +0200 Subject: [PATCH] first commit --- Classes/Controller/BackendController.php | 213 ++++++ Classes/Controller/ConsentController.php | 206 +++++ Classes/Domain/Model/Cookie.php | 136 ++++ Classes/Domain/Model/Service.php | 703 ++++++++++++++++++ .../Domain/Repository/ServiceRepository.php | 28 + Classes/Hook/AfterSaveHook.php | 38 + Classes/ViewHelpers/AbstractViewHelper.php | 23 + Classes/ViewHelpers/Format/JsonViewHelper.php | 32 + Classes/ViewHelpers/ScriptTagViewHelper.php | 28 + Classes/ViewHelpers/VariableViewHelper.php | 30 + Configuration/FlexForms/flexform_pi1.xml | 48 ++ Configuration/TCA/Overrides/pages.php | 10 + Configuration/TCA/Overrides/sys_template.php | 4 + Configuration/TCA/Overrides/tt_content.php | 14 + ...tx_wecookieconsent_domain_model_cookie.php | 30 + ...x_wecookieconsent_domain_model_service.php | 46 ++ ...tx_wecookieconsent_domain_model_cookie.php | 173 +++++ ...x_wecookieconsent_domain_model_service.php | 440 +++++++++++ .../TSConfig/ContentElementWizard.typoscript | 13 + Configuration/TypoScript/constants.ts | 60 ++ Configuration/TypoScript/constants.typoscript | 7 + Configuration/TypoScript/setup.ts | 116 +++ Configuration/TypoScript/setup.typoscript | 7 + .../Private/Backend/Layouts/Default.html | 35 + .../Backend/Partials/Service/Table.html | 8 + .../Backend/Templates/Backend/GtmWizard.html | 37 + .../Templates/Backend/JsonDownload.html | 3 + Resources/Private/Language/de.locallang.xlf | 96 +++ .../Private/Language/de.locallang_db.xlf | 226 ++++++ .../Private/Language/de.locallang_mod1.xlf | 39 + Resources/Private/Language/locallang.xlf | 96 +++ Resources/Private/Language/locallang_db.xlf | 226 ++++++ Resources/Private/Language/locallang_mod1.xlf | 39 + Resources/Private/Layouts/Default.html | 5 + Resources/Private/Partials/Cookie/Table.html | 7 + Resources/Private/Partials/Klaro/App.html | 24 + .../Private/Partials/Service/facebook.html | 18 + .../Service/google-analytics-universal.html | 16 + .../Partials/Service/google-analytics.html | 13 + .../Service/google-tagmanager-service.html | 7 + .../Partials/Service/google-tagmanager.html | 11 + .../Private/Partials/Service/matomo.html | 16 + Resources/Private/Partials/Service/other.html | 15 + .../Private/Templates/Consent/Consent.html | 30 + Resources/Private/Templates/Consent/List.html | 26 + Resources/Public/Icons/sysfolder.png | Bin 0 -> 1437 bytes ...tx_wecookieconsent_domain_model_cookie.svg | 11 + ...x_wecookieconsent_domain_model_service.svg | 11 + Resources/Public/Icons/user_mod_mod1.svg | 11 + Resources/Public/Icons/user_plugin_pi1.svg | 11 + .../Controller/ConsentController.js | 110 +++ Resources/Public/Library/klaro/getLatest.txt | 1 + Resources/Public/Library/klaro/klaro.js | 1 + Resources/Public/Stylesheet/style.css | 126 ++++ changelog.txt | 48 ++ composer.json | 47 ++ ext_emconf.php | 40 + ext_icon.svg | 11 + ext_localconf.php | 62 ++ ext_tables.php | 27 + ext_tables.sql | 105 +++ 61 files changed, 4020 insertions(+) create mode 100755 Classes/Controller/BackendController.php create mode 100755 Classes/Controller/ConsentController.php create mode 100755 Classes/Domain/Model/Cookie.php create mode 100755 Classes/Domain/Model/Service.php create mode 100755 Classes/Domain/Repository/ServiceRepository.php create mode 100755 Classes/Hook/AfterSaveHook.php create mode 100755 Classes/ViewHelpers/AbstractViewHelper.php create mode 100755 Classes/ViewHelpers/Format/JsonViewHelper.php create mode 100755 Classes/ViewHelpers/ScriptTagViewHelper.php create mode 100755 Classes/ViewHelpers/VariableViewHelper.php create mode 100755 Configuration/FlexForms/flexform_pi1.xml create mode 100755 Configuration/TCA/Overrides/pages.php create mode 100755 Configuration/TCA/Overrides/sys_template.php create mode 100755 Configuration/TCA/Overrides/tt_content.php create mode 100755 Configuration/TCA/Overrides/tx_wecookieconsent_domain_model_cookie.php create mode 100755 Configuration/TCA/Overrides/tx_wecookieconsent_domain_model_service.php create mode 100755 Configuration/TCA/tx_wecookieconsent_domain_model_cookie.php create mode 100755 Configuration/TCA/tx_wecookieconsent_domain_model_service.php create mode 100755 Configuration/TSConfig/ContentElementWizard.typoscript create mode 100755 Configuration/TypoScript/constants.ts create mode 100755 Configuration/TypoScript/constants.typoscript create mode 100755 Configuration/TypoScript/setup.ts create mode 100755 Configuration/TypoScript/setup.typoscript create mode 100755 Resources/Private/Backend/Layouts/Default.html create mode 100755 Resources/Private/Backend/Partials/Service/Table.html create mode 100755 Resources/Private/Backend/Templates/Backend/GtmWizard.html create mode 100755 Resources/Private/Backend/Templates/Backend/JsonDownload.html create mode 100755 Resources/Private/Language/de.locallang.xlf create mode 100755 Resources/Private/Language/de.locallang_db.xlf create mode 100755 Resources/Private/Language/de.locallang_mod1.xlf create mode 100755 Resources/Private/Language/locallang.xlf create mode 100755 Resources/Private/Language/locallang_db.xlf create mode 100755 Resources/Private/Language/locallang_mod1.xlf create mode 100755 Resources/Private/Layouts/Default.html create mode 100755 Resources/Private/Partials/Cookie/Table.html create mode 100755 Resources/Private/Partials/Klaro/App.html create mode 100755 Resources/Private/Partials/Service/facebook.html create mode 100755 Resources/Private/Partials/Service/google-analytics-universal.html create mode 100755 Resources/Private/Partials/Service/google-analytics.html create mode 100755 Resources/Private/Partials/Service/google-tagmanager-service.html create mode 100755 Resources/Private/Partials/Service/google-tagmanager.html create mode 100755 Resources/Private/Partials/Service/matomo.html create mode 100755 Resources/Private/Partials/Service/other.html create mode 100755 Resources/Private/Templates/Consent/Consent.html create mode 100755 Resources/Private/Templates/Consent/List.html create mode 100755 Resources/Public/Icons/sysfolder.png create mode 100755 Resources/Public/Icons/tx_wecookieconsent_domain_model_cookie.svg create mode 100755 Resources/Public/Icons/tx_wecookieconsent_domain_model_service.svg create mode 100755 Resources/Public/Icons/user_mod_mod1.svg create mode 100755 Resources/Public/Icons/user_plugin_pi1.svg create mode 100755 Resources/Public/JavaScript/Controller/ConsentController.js create mode 100755 Resources/Public/Library/klaro/getLatest.txt create mode 100755 Resources/Public/Library/klaro/klaro.js create mode 100755 Resources/Public/Stylesheet/style.css create mode 100755 changelog.txt create mode 100755 composer.json create mode 100755 ext_emconf.php create mode 100755 ext_icon.svg create mode 100755 ext_localconf.php create mode 100755 ext_tables.php create mode 100755 ext_tables.sql diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php new file mode 100755 index 0000000..92481d1 --- /dev/null +++ b/Classes/Controller/BackendController.php @@ -0,0 +1,213 @@ +, websedit AG + * + ***/ + +/** + * ServiceController + */ +class BackendController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController +{ + /** + * serviceRepository + * + * @var \Websedit\WeCookieConsent\Domain\Repository\ServiceRepository + */ + protected $serviceRepository = null; + + /** + * Inject a service repository + * + * @param \Websedit\WeCookieConsent\Domain\Repository\ServiceRepository $serviceRepository + */ + public function injectServiceRepository(\Websedit\WeCookieConsent\Domain\Repository\ServiceRepository $serviceRepository) + { + $this->serviceRepository = $serviceRepository; + } + + /** + * Action initializer + * + * @return void + */ + protected function initializeAction() + { + $pageId = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'); + $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); + $persistenceConfiguration = array('persistence' => array('storagePid' => $pageId)); + $this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $persistenceConfiguration)); + } + + /** + * Preview the config + * + * @return void + */ + public function gtmWizardAction() + { + $services = $this->serviceRepository->findByProvider('google-tagmanager-service'); + + $blocks = ['tags' => 1, 'triggers' => 1, 'variables' => 1]; + + $this->view->assignMultiple([ + 'services' => $services, + 'gtmArray' => $this->createGtmArray($services, $blocks) + ]); + } + + /** + * Download the config as JSON File + * + * @param array $blocks + * + * @return void + */ + public function jsonDownloadAction($blocks) + { + $this->response->setHeader('Content-type', 'application/json'); + $this->response->setHeader('Content-Disposition', 'attachment; filename=import-this-to-gtm.json'); + + $services = $this->serviceRepository->findByProvider('google-tagmanager-service'); + $this->view->assignMultiple([ + 'gtmArray' => $this->createGtmArray($services, $blocks) + ]); + } + + /** + * Process the JSON for the Google Tag Manager + * + * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $services + * @param array $blocks + * @return array + */ + private function createGtmArray($services, $blocks) + { + $gtmArray = [ + "exportFormatVersion" => 2, + "containerVersion" => [ + "tag" => [], + "trigger" => [], + "variable" => [], + "folder" => [ + [ + "accountId" => "0", + "containerId" => "0", + "folderId" => "0", + "name" => "we_cookie_consent" + ] + ] + ] + ]; + + foreach ($services as $service) { + //Build Tag + if ($blocks['tags']) { + $gtmArray['containerVersion']['tag'][] = [ + "accountId" => "0", + "containerId" => "0", + "tagId" => $service->getUid(), + "name" => $service->getGtmTagTitle(), + "type" => "html", + "parameter" => [ + [ + "type" => "TEMPLATE", + "key" => "html", + "value" => "" + ] + ], + "firingTriggerId" => [ + $service->getUid() + ], + "parentFolderId" => "0" + ]; + } + + //Build Trigger + if ($blocks['triggers']) { + $gtmArray['containerVersion']['trigger'][] = [ + "accountId" => "0", + "containerId" => "0", + "triggerId" => $service->getUid(), + "name" => $service->getGtmTriggerTitle(), + "type" => "CUSTOM_EVENT", + "customEventFilter" => [ + [ + "type" => "EQUALS", + "parameter" => [ + [ + "type" => "TEMPLATE", + "key" => "arg0", + "value" => "{{_event}}" + ], + [ + "type" => "TEMPLATE", + "key" => "arg1", + "value" => $service->getGtmTriggerName() + ] + ] + ] + ], + "filter" => [ + [ + "type" => "EQUALS", + "parameter" => [ + [ + "type" => "TEMPLATE", + "key" => "arg0", + "value" => "{{" . $service->getGtmVariableTitle() . "}}" + ], + [ + "type" => "TEMPLATE", + "key" => "arg1", + "value" => "true" + ] + ] + ] + ], + "parentFolderId" => "0" + ]; + } + + //Build Variable + if ($blocks['variables']) { + $gtmArray['containerVersion']['variable'][] = [ + "accountId" => "0", + "containerId" => "0", + "variableId" => $service->getUid(), + "name" => $service->getGtmVariableTitle(), + "type" => "v", + "parameter" => [ + [ + "type" => "INTEGER", + "key" => "dataLayerVersion", + "value" => "2" + ], + [ + "type" => "BOOLEAN", + "key" => "setDefaultValue", + "value" => "false" + ], + [ + "type" => "TEMPLATE", + "key" => "name", + "value" => $service->getGtmVariableName() + ] + ], + "parentFolderId" => "0" + ]; + } + } + + return $gtmArray; + } +} diff --git a/Classes/Controller/ConsentController.php b/Classes/Controller/ConsentController.php new file mode 100755 index 0000000..817156a --- /dev/null +++ b/Classes/Controller/ConsentController.php @@ -0,0 +1,206 @@ +, websedit AG + * + ***/ + +/** + * ConsentController + */ +class ConsentController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController +{ + /** + * serviceRepository + * + * @var \Websedit\WeCookieConsent\Domain\Repository\ServiceRepository + */ + protected $serviceRepository = null; + + /** + * Inject a service repository + * + * @param \Websedit\WeCookieConsent\Domain\Repository\ServiceRepository $serviceRepository + */ + public function injectServiceRepository(\Websedit\WeCookieConsent\Domain\Repository\ServiceRepository $serviceRepository) + { + $this->serviceRepository = $serviceRepository; + } + + /** + * Generate JSON data for the consent Modal + * + * @param Websedit\WeCookieConsent\Domain\Model\Service + * @return void + */ + public function consentAction() + { + $services = $this->serviceRepository->findAll(); + + //These two lines are only required for TYPO3 7 backwards compatibility. in TYPO3 >=8 renderAssetsForRequest is used + $klaroConfig = $this->klaroConfigBuild($services); + $typo3Version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version); + + $this->view->assignMultiple([ + 'services' => $services, + 'klaroConfig' => $klaroConfig, + 'typo3Version' => $typo3Version + ]); + } + + /** + * Show used cookies at the data privacy page + * + * @param Websedit\WeCookieConsent\Domain\Model\Service + * @return void + */ + public function listAction() + { + $servicesUids = explode(',', $this->settings['flexforms']['services']); + + $services = []; + foreach ($servicesUids as $uid) { + //No custom findByUids function to keep the sorting + $services[] = $this->serviceRepository->findByUid($uid); + } + + $this->view->assignMultiple([ + 'services' => $services + ]); + } + + /** + * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request + */ + protected function renderAssetsForRequest($request) + { + if (!$this->view instanceof \TYPO3Fluid\Fluid\View\TemplateView) { + return; + } + + $services = $this->serviceRepository->findAll(); + $klaroConfig = $this->klaroConfigBuild($services); + + $pageRenderer = $this->objectManager->get(\TYPO3\CMS\Core\Page\PageRenderer::class); + $variables = [ + 'request' => $request, + 'arguments' => $this->arguments, + 'services' => $services, + 'klaroConfig' => $klaroConfig + ]; + + $headerAssets = $this->view->renderSection('HeaderAssets', $variables, true); + $footerAssets = $this->view->renderSection('FooterAssets', $variables, true); + + if (!empty(trim($headerAssets))) { + $pageRenderer->addHeaderData($headerAssets); + } + if (!empty(trim($footerAssets))) { + $pageRenderer->addFooterData($footerAssets); + } + } + + /** + * Build the klaro config object used in frontend + * + * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $services + * @return array + */ + private function klaroConfigBuild(\TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $services) + { + if (is_numeric($this->settings['klaro']['privacyPolicy'])) { + $privacyPage = $this->uriBuilder + ->reset() + ->setTargetPageUid((int) $this->settings['klaro']['privacyPolicy']) + ->setCreateAbsoluteUri(true) + ->build(); + } else { + $privacyPage = $this->settings['klaro']['privacyPolicy']; + } + + if (is_numeric($this->settings['klaro']['poweredBy'])) { + $poweredByPage = $this->uriBuilder + ->reset() + ->setTargetPageUid((int) $this->settings['klaro']['poweredBy']) + ->setCreateAbsoluteUri(true) + ->build(); + } else { + $poweredByPage = $this->settings['klaro']['poweredBy']; + } + + $klaroConfig = [ + 'elementID' => $this->settings['klaro']['elementID'], + 'storageMethod' => $this->settings['klaro']['storageMethod'], + 'cookieName' => $this->settings['klaro']['cookieName'], + 'cookieExpiresAfterDays' => $this->settings['klaro']['cookieExpiresAfterDays'], + 'privacyPolicy' => $privacyPage, + 'default' => $this->settings['klaro']['default'] === '1', + 'mustConsent' => $this->settings['klaro']['mustConsent'] === '1', + 'hideDeclineAll' => $this->settings['klaro']['hideDeclineAll'] === '1', + 'hideLearnMore' => $this->settings['klaro']['hideLearnMore'] === '1', + 'lang' => $this->settings['klaro']['lang'], + 'poweredBy' => $poweredByPage, + 'translations' => [ + 'en' => [ + 'consentModal' => [ + 'title' => LocalizationUtility::translate('klaro.consentModal.title', 'we_cookie_consent'), + 'description' => LocalizationUtility::translate('klaro.consentModal.description', 'we_cookie_consent'), + 'privacyPolicy' => [ + 'text' => LocalizationUtility::translate('klaro.consentModal.privacyPolicy.text', 'we_cookie_consent'), + 'name' => LocalizationUtility::translate('klaro.consentModal.privacyPolicy.name', 'we_cookie_consent') + ] + ], + 'consentNotice' => [ + 'description' => LocalizationUtility::translate('klaro.consentNotice.description', 'we_cookie_consent'), + 'changeDescription' => LocalizationUtility::translate('klaro.consentNotice.changeDescription', 'we_cookie_consent'), + 'learnMore' => LocalizationUtility::translate('klaro.consentNotice.learnMore', 'we_cookie_consent') + ], + 'app' => [ + 'disableAll' => [ + 'title' => LocalizationUtility::translate('klaro.app.disableAll.title', 'we_cookie_consent'), + 'description' => LocalizationUtility::translate('klaro.app.disableAll.description', 'we_cookie_consent') + ], + 'optOut' => [ + 'title' => LocalizationUtility::translate('klaro.app.optOut.title', 'we_cookie_consent'), + 'description' => LocalizationUtility::translate('klaro.app.optOut.description', 'we_cookie_consent') + ], + 'required' => [ + 'title' => LocalizationUtility::translate('klaro.app.required.title', 'we_cookie_consent'), + 'description' => LocalizationUtility::translate('klaro.app.required.description', 'we_cookie_consent') + ], + 'purpose' => LocalizationUtility::translate('klaro.app.purpose', 'we_cookie_consent'), + 'purposes' => LocalizationUtility::translate('klaro.app.purposes', 'we_cookie_consent') + ], + 'purposes' => [ + 'unknown' => LocalizationUtility::translate('klaro.purposes.unknown', 'we_cookie_consent') + ], + 'ok' => LocalizationUtility::translate('klaro.ok', 'we_cookie_consent'), + 'save' => LocalizationUtility::translate('klaro.save', 'we_cookie_consent'), + 'acceptSelected' => LocalizationUtility::translate('klaro.save', 'we_cookie_consent'), + 'decline' => LocalizationUtility::translate('klaro.decline', 'we_cookie_consent'), + 'close' => LocalizationUtility::translate('klaro.close', 'we_cookie_consent'), + 'poweredBy' => LocalizationUtility::translate('klaro.poweredBy', 'we_cookie_consent') + ] + ], + 'apps' => [] + ]; + + foreach ($services as $service) { + foreach ($service->getCategories() as $category) { + $klaroConfig['translations']['en']['purposes'][strtolower($category->getTitle())] = $category->getTitle(); + } + } + + return $klaroConfig; + } +} diff --git a/Classes/Domain/Model/Cookie.php b/Classes/Domain/Model/Cookie.php new file mode 100755 index 0000000..9855265 --- /dev/null +++ b/Classes/Domain/Model/Cookie.php @@ -0,0 +1,136 @@ +, websedit AG + * + ***/ + +/** + * Cookie + */ +class Cookie extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +{ + /** + * Name des Cookies + * String oder RegEx des Cookie Namens. Diese Cookies werden automatisch gelöscht, + * wenn der Besucher der Verwendung dieser App nicht zustimmt (z. B. /^_ga_.*$/ + * oder custom_tracker_cookie) + * + * @var string + */ + protected $title = ''; + + /** + * regex + * + * @var string + */ + protected $regex = ''; + + /** + * Beschreibung + * + * @var string + */ + protected $description = ''; + + /** + * maxAge + * + * @var string + */ + protected $maxAge = ''; + + /** + * Returns the title + * + * @return string title + */ + public function getTitle() + { + return $this->title; + } + + /** + * Sets the title + * + * @param string $title + * @return void + */ + public function setTitle($title) + { + $this->title = $title; + } + + /** + * Returns the description + * + * @return string description + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the description + * + * @param string $description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * Returns the maxAge + * + * @return string maxAge + */ + public function getMaxAge() + { + return $this->maxAge; + } + + /** + * Sets the maxAge + * + * @param string $maxAge + * @return void + */ + public function setMaxAge($maxAge) + { + $this->maxAge = $maxAge; + } + + /** + * Returns the regex + * + * @return string $regex + */ + public function getRegex() + { + return $this->regex; + } + + /** + * Sets the regex + * + * @param string $regex + * @return void + */ + public function setRegex($regex) + { + $this->regex = $regex; + } +} \ No newline at end of file diff --git a/Classes/Domain/Model/Service.php b/Classes/Domain/Model/Service.php new file mode 100755 index 0000000..644ab32 --- /dev/null +++ b/Classes/Domain/Model/Service.php @@ -0,0 +1,703 @@ +, websedit AG + * + ***/ + +/** + * Service like Google Analytics, Facebook, Matomo, ... + */ +class Service extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +{ + /** + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> + */ + protected $categories = null; + + /** + * Der Anbieter des Services + * + * @var string + */ + protected $provider = ''; + + /** + * ID des ScriptTages + * + * @var string + */ + protected $name = ''; + + /** + * Ein einfacher und kurzer Name (z. B. google-analytics) + * + * @var string + */ + protected $title = ''; + + /** + * Beschreibung fürs Frontend + * + * @var string + */ + protected $description = ''; + + /** + * Kategorie + * + * @var string + */ + protected $purpose = ''; + + /** + * Zustand ohne Zustimmung + * + * @var bool + */ + protected $state = false; + + /** + * Ob diese App standardmässig aktiviert sein soll. Diese Option überschreibt die + * globale Einstellung. + * + * @var bool + */ + protected $preselected = false; + + /** + * Die Zustimmung für diese App kann vom Kunden nicht deaktiviert werden + * + * @var bool + */ + protected $required = false; + + /** + * Die Scripts dieser App werden beim ersten Seitenaufruf geladen. Der Kunde muss + * die Verwendung explizit verweigern. + * + * @var bool + */ + protected $optOut = false; + + /** + * Die Scripts dieser App nur einmal laden, auch wenn der Besucher die Zustimmung + * mehrfach de- und wieder aktiviert. + * + * @var bool + */ + protected $onlyOnce = false; + + /** + * JavaScript Snippet für unbekannte Dienste + * + * @var string + */ + protected $snippet = ''; + + /** + * Diese JavaScript Funktion wird immer dann ausgeführt, wenn diese App vom Kunden + * zugelassen wird. function (consent, app) { // ... } + * + * @var string + */ + protected $callback = ''; + + /** + * Die Domain unter der, der Service läuft. + * + * @var string + */ + protected $domain = ''; + + /** + * Der API Key, falls zur Identifizierung notwendig. + * + * @var string + */ + protected $apiKey = ''; + + /** + * gtmTagTitle + * + * @var string + */ + protected $gtmTagTitle = ''; + + /** + * Google Tag Manager Trigger Name + * + * @var string + */ + protected $gtmTriggerTitle = ''; + + /** + * gtmTriggerName + * + * @var string + */ + protected $gtmTriggerName = ''; + + /** + * Google Tag Manager Variablenname + * + * @var string + */ + protected $gtmVariableTitle = ''; + + /** + * gtmVariableName + * + * @var string + */ + protected $gtmVariableName = ''; + + /** + * Cookies die von diesem Service eingesetzt werden + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Websedit\WeCookieConsent\Domain\Model\Cookie> + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade remove + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $cookies = null; + + /** + * __construct + */ + public function __construct() + { + + //Do not remove the next line: It would break the functionality + $this->initStorageObjects(); + } + + /** + * Initializes all ObjectStorage properties + * Do not modify this method! + * It will be rewritten on each save in the extension builder + * You may modify the constructor of this class instead + * + * @return void + */ + protected function initStorageObjects() + { + $this->cookies = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + } + + /** + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage + */ + public function getCategories() + { + return $this->categories; + } + + /** + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $categories + */ + public function setCategories(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $categories) + { + $this->categories = $categories; + } + + /** + * Returns the provider + * + * @return string provider + */ + public function getProvider() + { + return $this->provider; + } + + /** + * Sets the provider + * + * @param string $provider + * @return void + */ + public function setProvider($provider) + { + $this->provider = $provider; + } + + /** + * Returns the name + * + * @return string name + */ + public function getName() + { + return $this->name; + } + + /** + * Sets the name + * + * @param string $name + * @return void + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * Returns the title + * + * @return string title + */ + public function getTitle() + { + return $this->title; + } + + /** + * Sets the title + * + * @param string $title + * @return void + */ + public function setTitle($title) + { + $this->title = $title; + } + + /** + * Returns the description + * + * @return string description + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the description + * + * @param string $description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * Returns the purpose + * + * @return string purpose + */ + public function getPurpose() + { + return $this->purpose; + } + + /** + * Sets the purpose + * + * @param string $purpose + * @return void + */ + public function setPurpose($purpose) + { + $this->purpose = $purpose; + } + + /** + * Returns the state + * + * @return bool state + */ + public function getState() + { + return $this->state; + } + + /** + * Sets the state + * + * @param bool $state + * @return void + */ + public function setState($state) + { + $this->state = $state; + } + + /** + * Returns the boolean state of state + * + * @return bool state + */ + public function isState() + { + return $this->state; + } + + /** + * Returns the preselected + * + * @return bool preselected + */ + public function getPreselected() + { + return $this->preselected; + } + + /** + * Sets the preselected + * + * @param bool $preselected + * @return void + */ + public function setPreselected($preselected) + { + $this->preselected = $preselected; + } + + /** + * Returns the boolean state of preselected + * + * @return bool preselected + */ + public function isPreselected() + { + return $this->preselected; + } + + /** + * Returns the required + * + * @return bool required + */ + public function getRequired() + { + return $this->required; + } + + /** + * Sets the required + * + * @param bool $required + * @return void + */ + public function setRequired($required) + { + $this->required = $required; + } + + /** + * Returns the boolean state of required + * + * @return bool required + */ + public function isRequired() + { + return $this->required; + } + + /** + * Returns the optOut + * + * @return bool optOut + */ + public function getOptOut() + { + return $this->optOut; + } + + /** + * Sets the optOut + * + * @param bool $optOut + * @return void + */ + public function setOptOut($optOut) + { + $this->optOut = $optOut; + } + + /** + * Returns the boolean state of optOut + * + * @return bool optOut + */ + public function isOptOut() + { + return $this->optOut; + } + + /** + * Returns the onlyOnce + * + * @return bool onlyOnce + */ + public function getOnlyOnce() + { + return $this->onlyOnce; + } + + /** + * Sets the onlyOnce + * + * @param bool $onlyOnce + * @return void + */ + public function setOnlyOnce($onlyOnce) + { + $this->onlyOnce = $onlyOnce; + } + + /** + * Returns the boolean state of onlyOnce + * + * @return bool onlyOnce + */ + public function isOnlyOnce() + { + return $this->onlyOnce; + } + + /** + * Returns the callback + * + * @return string callback + */ + public function getCallback() + { + return $this->callback; + } + + /** + * Sets the callback + * + * @param string $callback + * @return void + */ + public function setCallback($callback) + { + $this->callback = $callback; + } + + /** + * Returns the domain + * + * @return string domain + */ + public function getDomain() + { + return $this->domain; + } + + /** + * Sets the domain + * + * @param string $domain + * @return void + */ + public function setDomain($domain) + { + $this->domain = $domain; + } + + /** + * Returns the apiKey + * + * @return string apiKey + */ + public function getApiKey() + { + return $this->apiKey; + } + + /** + * Sets the apiKey + * + * @param string $apiKey + * @return void + */ + public function setApiKey($apiKey) + { + $this->apiKey = $apiKey; + } + + /** + * Returns the snippet + * + * @return string snippet + */ + public function getSnippet() + { + return $this->snippet; + } + + /** + * Sets the snippet + * + * @param string $snippet + * @return void + */ + public function setSnippet($snippet) + { + $this->snippet = $snippet; + } + + /** + * Returns the gtmVariableTitle + * + * @return string gtmVariableTitle + */ + public function getGtmVariableTitle() + { + return $this->gtmVariableTitle; + } + + /** + * Sets the gtmVariableTitle + * + * @param string $gtmVariableTitle + * @return void + */ + public function setGtmVariableTitle($gtmVariableTitle) + { + $this->gtmVariableTitle = $gtmVariableTitle; + } + + /** + * Returns the gtmTriggerTitle + * + * @return string gtmTriggerTitle + */ + public function getGtmTriggerTitle() + { + return $this->gtmTriggerTitle; + } + + /** + * Sets the gtmTriggerTitle + * + * @param string $gtmTriggerTitle + * @return void + */ + public function setGtmTriggerTitle($gtmTriggerTitle) + { + $this->gtmTriggerTitle = $gtmTriggerTitle; + } + + /** + * Adds a Cookie + * + * @param \Websedit\WeCookieConsent\Domain\Model\Cookie $cooky + * @return void + */ + public function addCooky(\Websedit\WeCookieConsent\Domain\Model\Cookie $cooky) + { + $this->cookies->attach($cooky); + } + + /** + * Removes a Cookie + * + * @param \Websedit\WeCookieConsent\Domain\Model\Cookie $cookyToRemove The Cookie to be removed + * @return void + */ + public function removeCooky(\Websedit\WeCookieConsent\Domain\Model\Cookie $cookyToRemove) + { + $this->cookies->detach($cookyToRemove); + } + + /** + * Returns the cookies + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Websedit\WeCookieConsent\Domain\Model\Cookie> cookies + */ + public function getCookies() + { + return $this->cookies; + } + + /** + * Sets the cookies + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Websedit\WeCookieConsent\Domain\Model\Cookie> $cookies + * @return void + */ + public function setCookies(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $cookies) + { + $this->cookies = $cookies; + } + + /** + * Returns the gtmTagTitle + * + * @return string $gtmTagTitle + */ + public function getGtmTagTitle() + { + return $this->gtmTagTitle; + } + + /** + * Sets the gtmTagTitle + * + * @param string $gtmTagTitle + * @return void + */ + public function setGtmTagTitle($gtmTagTitle) + { + $this->gtmTagTitle = $gtmTagTitle; + } + + /** + * Returns the gtmTriggerName + * + * @return string $gtmTriggerName + */ + public function getGtmTriggerName() + { + return $this->gtmTriggerName; + } + + /** + * Sets the gtmTriggerName + * + * @param string $gtmTriggerName + * @return void + */ + public function setGtmTriggerName($gtmTriggerName) + { + $this->gtmTriggerName = $gtmTriggerName; + } + + /** + * Returns the gtmVariableName + * + * @return string $gtmVariableName + */ + public function getGtmVariableName() + { + return $this->gtmVariableName; + } + + /** + * Sets the gtmVariableName + * + * @param string $gtmVariableName + * @return void + */ + public function setGtmVariableName($gtmVariableName) + { + $this->gtmVariableName = $gtmVariableName; + } +} diff --git a/Classes/Domain/Repository/ServiceRepository.php b/Classes/Domain/Repository/ServiceRepository.php new file mode 100755 index 0000000..ccedc12 --- /dev/null +++ b/Classes/Domain/Repository/ServiceRepository.php @@ -0,0 +1,28 @@ +, websedit AG + * + ***/ + +/** + * The repository for Services + */ +class ServiceRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +{ + /** + * @var array + */ + protected $defaultOrderings = [ + 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING + ]; +} \ No newline at end of file diff --git a/Classes/Hook/AfterSaveHook.php b/Classes/Hook/AfterSaveHook.php new file mode 100755 index 0000000..50cae29 --- /dev/null +++ b/Classes/Hook/AfterSaveHook.php @@ -0,0 +1,38 @@ +registerArgument('value', 'mixed', 'The incoming data to convert, or null if VH children should be used'); + $this->registerArgument('forceObject', 'bool', 'Outputs an JSON object rather than an array', false, false); + } + + public function render() { + $value = $this->renderChildren(); + $options = JSON_HEX_TAG; + if ($this->arguments['forceObject'] !== false) { + $options = $options | JSON_FORCE_OBJECT; + } + return json_encode($value, $options); + } +} \ No newline at end of file diff --git a/Classes/ViewHelpers/ScriptTagViewHelper.php b/Classes/ViewHelpers/ScriptTagViewHelper.php new file mode 100755 index 0000000..362eb2c --- /dev/null +++ b/Classes/ViewHelpers/ScriptTagViewHelper.php @@ -0,0 +1,28 @@ +registerArgument('snippet', 'string', 'The snippets to make valide', true); + $this->registerArgument('name', 'string', 'The snippets name to active', true); + } + + public function render() { + $snippet = $this->arguments['snippet']; + $name = $this->arguments['name']; + + $snippet = str_replace('type="text/javascript"', '', $snippet); + $snippet = str_replace('src="', 'data-src="', $snippet); + $snippet = str_replace('registerArgument('value', 'mixed', 'Value to assign. If not in arguments then taken from tag content'); + $this->registerArgument('name', 'string', 'Name of variable to create', true); + } + + /** + * Function can be removed if TYPO3 7 support gets dropped + */ + public function render() { + $value = $this->renderChildren(); + if (!method_exists($this->renderingContext, 'getVariableProvider')) { + $this->renderingContext->getTemplateVariableContainer()->add($this->arguments['name'], $value); + } else { + $this->renderingContext->getVariableProvider()->add($this->arguments['name'], $value); + } + } +} \ No newline at end of file diff --git a/Configuration/FlexForms/flexform_pi1.xml b/Configuration/FlexForms/flexform_pi1.xml new file mode 100755 index 0000000..b002ab4 --- /dev/null +++ b/Configuration/FlexForms/flexform_pi1.xml @@ -0,0 +1,48 @@ + + + + + + Function + + array + + + + + + select + selectSingle + + + LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_we_cookie_consent_pi1.flexform.switchableControllerActions.0 + Consent->list; + + + + + + + + + + group + db + tx_wecookieconsent_domain_model_service + 5 + 1 + 999 + 1 + + + suggest + + + + + + + + + + \ No newline at end of file diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php new file mode 100755 index 0000000..79ee437 --- /dev/null +++ b/Configuration/TCA/Overrides/pages.php @@ -0,0 +1,10 @@ + 'Cookies', + 1 => 'wecookieconsent', + 2 => 'pagetree-folder-contains-cookies' +]; \ No newline at end of file diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php new file mode 100755 index 0000000..3e84e29 --- /dev/null +++ b/Configuration/TCA/Overrides/sys_template.php @@ -0,0 +1,4 @@ + 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.category.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.category.description', + 'fieldConfiguration' => [ + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.category.description', + ], + ] +); + +#TYPO3 8LTS compatibility +if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) <= 9000000) { + //Change labes back to EXT:lang + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['sys_language_uid']['label'] = 'LLL:EXT:lang/locallang_general.xlf:LGL.language'; + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['sys_language_uid']['config']['itmes'][0][0] = 'LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages'; + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['l10n_parent']['label'] = 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent'; + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['t3ver_label']['label'] = 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel'; + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['hidden']['label'] = 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden'; + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['starttime']['label'] = 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime'; + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['endtime']['label'] = 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime'; +} + +#TYPO3 7LTS compatibility +if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) <= 8000000) { + //onChange Listener + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['ctrl']['requestUpdate'] = 'provider'; + + //Start- Stop Field + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['starttime']['config']['size'] = '13'; + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['endtime']['config']['size'] = '13'; + unset($GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['starttime']['config']['renderType']); + unset($GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['endtime']['config']['renderType']); + + //L10N + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['l10n_parent']['config']['foreign_table_where'] = + 'AND tx_wecookieconsent_domain_model_service.pid=###CURRENT_PID### AND tx_wecookieconsent_domain_model_service.sys_language_uid IN (-1,0)'; + + //Richtext + $GLOBALS['TCA']['tx_wecookieconsent_domain_model_service']['columns']['description']['defaultExtras'] = 'richtext[]'; +} \ No newline at end of file diff --git a/Configuration/TCA/tx_wecookieconsent_domain_model_cookie.php b/Configuration/TCA/tx_wecookieconsent_domain_model_cookie.php new file mode 100755 index 0000000..d651af0 --- /dev/null +++ b/Configuration/TCA/tx_wecookieconsent_domain_model_cookie.php @@ -0,0 +1,173 @@ + [ + 'title' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_cookie', + 'label' => 'title', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'cruser_id' => 'cruser_id', + 'sortby' => 'sorting', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'searchFields' => 'title,regex,description,max_age', + 'iconfile' => 'EXT:we_cookie_consent/Resources/Public/Icons/tx_wecookieconsent_domain_model_cookie.svg', + 'hideTable' => true + ], + 'interface' => [ + 'showRecordFieldList' => 'title, regex, description, max_age, sys_language_uid, l10n_parent, l10n_diffsource, hidden', + ], + 'types' => [ + '1' => ['showitem' => 'title, description, max_age, + --div--;LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_cookie.tab.advanced.label, regex, + --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, hidden, sys_language_uid, l10n_parent, l10n_diffsource, starttime, endtime + '], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'special' => 'languages', + 'items' => [ + [ + 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', + -1, + 'flags-multiple' + ] + ], + 'default' => 0, + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_wecookieconsent_domain_model_cookie', + 'foreign_table_where' => 'AND {#tx_wecookieconsent_domain_model_cookie}.{#pid}=###CURRENT_PID### AND {#tx_wecookieconsent_domain_model_cookie}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 't3ver_label' => [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'max' => 255, + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + //'renderType' => 'checkboxToggle', //NOT TYPO3 8 compatible + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'range' => [ + 'upper' => mktime(0, 0, 0, 1, 1, 2038) + ], + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_cookie.title.label', + //'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_cookie.title.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim,required' + ], + ], + /* + 'regex' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_cookie.regex.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_cookie.regex.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim' + ], + ], + */ + 'description' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_cookie.description.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_cookie.description.description', + 'config' => [ + 'type' => 'text', + 'enableRichtext' => true, + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim', + ], + ], + 'max_age' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_cookie.max_age.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_cookie.max_age.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim' + ], + ], + 'service' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + ], +]; \ No newline at end of file diff --git a/Configuration/TCA/tx_wecookieconsent_domain_model_service.php b/Configuration/TCA/tx_wecookieconsent_domain_model_service.php new file mode 100755 index 0000000..0a1b5c5 --- /dev/null +++ b/Configuration/TCA/tx_wecookieconsent_domain_model_service.php @@ -0,0 +1,440 @@ + [ + 'title' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service', + 'label' => 'provider', + 'label_alt' => 'title', + 'label_alt_force' => true, + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'cruser_id' => 'cruser_id', + 'sortby' => 'sorting', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'searchFields' => 'provider,name,title,description,purpose,snippet,callback,domain,api_key,gtm_tag_title,gtm_trigger_title,gtm_trigger_name,gtm_variable_title,gtm_variable_name', + 'iconfile' => 'EXT:we_cookie_consent/Resources/Public/Icons/tx_wecookieconsent_domain_model_service.svg' + ], + 'interface' => [ + 'showRecordFieldList' => 'provider, name, title, description, purpose, state, required, preselected, opt_out, only_once, snippet, callback, domain, api_key, gtm_tag_title, gtm_trigger_title, gtm_trigger_name, gtm_variable_title, gtm_variable_name, cookies, sys_language_uid, l10n_parent, l10n_diffsource, hidden', + ], + 'types' => [ + '1' => ['showitem' => '--palette--;;service_provider, title, description, + --div--;LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.tab.cookies.label, cookies, + --div--;LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.tab.settings.label, state, required, preselected, opt_out, only_once, + --div--;LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.tab.identification.label, domain, api_key, + --div--;LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.tab.dev.label, snippet, callback, + --div--;LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.tab.gtm.label, gtm_tag_title, --palette--;;gtm_trigger, --palette--;;gtm_variable, + --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, hidden, sys_language_uid, l10n_parent, l10n_diffsource, starttime, endtime + '], + ], + 'palettes' => [ + 'service_provider' => [ + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.palette.service_provider.label', + 'showitem' => 'provider, name', + ], + 'gtm_trigger' => [ + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.palette.gtm_trigger.label', + 'showitem' => 'gtm_trigger_title, gtm_trigger_name', + ], + 'gtm_variable' => [ + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.palette.gtm_variable.label', + 'showitem' => 'gtm_variable_title, gtm_variable_name', + ], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'special' => 'languages', + 'items' => [ + [ + 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', + -1, + 'flags-multiple' + ] + ], + 'default' => 0, + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_wecookieconsent_domain_model_service', + 'foreign_table_where' => 'AND {#tx_wecookieconsent_domain_model_service}.{#pid}=###CURRENT_PID### AND {#tx_wecookieconsent_domain_model_service}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 't3ver_label' => [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'max' => 255, + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + //'renderType' => 'checkboxToggle', //NOT TYPO3 8 compatible + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'provider' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.provider.label', + //'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.provider.description', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'items' => [ + ['Google Analytics', '--div--'], + ['Google Analytics', 'google-analytics'], + ['Google Analytics Universal', 'google-analytics-universal'], + ['Google Tag Manager', '--div--'], + ['Google Tag Manager', 'google-tagmanager'], + ['Google Tag Manager - Service', 'google-tagmanager-service'], + ['LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.provider.div.other', '--div--'], + ['Facebook Tracking Pixel', 'facebook'], + ['Matomo', 'matomo'], + ['LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.provider.other', 'other'], + ], + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + 'onChange' => 'reload' + ], + /* + 'name' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.name.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.name.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim' + ], + 'displayCond' => 'FIELD:provider:=:other', + ], + */ + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.title.label', + //'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.title.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim,required' + ], + ], + 'description' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.description.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.description.description', + 'config' => [ + 'type' => 'text', + 'enableRichtext' => true, + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim,required', + ], + ], + 'state' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.state.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.state.description', + 'config' => [ + 'type' => 'check', + 'items' => [ + '1' => [ + '0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled' + ] + ], + 'default' => 1, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ] + ], + 'preselected' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.preselected.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.preselected.description', + 'config' => [ + 'type' => 'check', + 'items' => [ + '1' => [ + '0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled' + ] + ], + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ] + ], + 'required' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.required.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.required.description', + 'config' => [ + 'type' => 'check', + 'items' => [ + '1' => [ + '0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled' + ] + ], + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ] + ], + 'opt_out' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.opt_out.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.opt_out.description', + 'config' => [ + 'type' => 'check', + 'items' => [ + '1' => [ + '0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled' + ] + ], + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ] + ], + 'only_once' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.only_once.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.only_once.description', + 'config' => [ + 'type' => 'check', + 'items' => [ + '1' => [ + '0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled' + ] + ], + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ] + ], + 'snippet' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.snippet.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.snippet.description', + 'config' => [ + 'type' => 'text', + 'renderType' => 't3editor', + 'format' => 'javascript', + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim', + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + 'displayCond' => 'FIELD:provider:=:other', + ], + 'callback' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.callback.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.callback.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'domain' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.domain.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.domain.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + 'displayCond' => 'FIELD:provider:IN:matomo', + ], + 'api_key' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.api_key.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.api_key.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + 'displayCond' => 'FIELD:provider:!=:other', + ], + 'gtm_tag_title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.gtm_tag_title.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.gtm_tag_title.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + 'displayCond' => 'FIELD:provider:=:google-tagmanager-service', + ], + 'gtm_trigger_title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.gtm_trigger_title.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.gtm_trigger_title.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + 'displayCond' => 'FIELD:provider:=:google-tagmanager-service', + ], + 'gtm_trigger_name' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.gtm_trigger_name.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.gtm_trigger_name.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + 'displayCond' => 'FIELD:provider:=:google-tagmanager-service', + ], + 'gtm_variable_title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.gtm_variable_title.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.gtm_variable_title.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + 'displayCond' => 'FIELD:provider:=:google-tagmanager-service', + ], + 'gtm_variable_name' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.gtm_variable_name.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.gtm_variable_name.description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + 'displayCond' => 'FIELD:provider:=:google-tagmanager-service', + ], + 'cookies' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.cookies.label', + 'description' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.cookies.description', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'tx_wecookieconsent_domain_model_cookie', + 'foreign_field' => 'service', + 'foreign_sortby' => 'sorting', + 'maxitems' => 9999, + 'appearance' => [ + 'newRecordLinkTitle' => 'LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_wecookieconsent_domain_model_service.cookies.button', + 'collapseAll' => 1, + 'levelLinksPosition' => 'bottom', + 'useSortable' => 1, + 'enabledControls' => [ + 'info' => false, + 'new' => true, + 'dragdrop' => true, + 'sort' => false, + 'hide' => true, + 'delete' => true, + 'localize' => true, + ] + ], + ], + ], + ], +]; diff --git a/Configuration/TSConfig/ContentElementWizard.typoscript b/Configuration/TSConfig/ContentElementWizard.typoscript new file mode 100755 index 0000000..494e817 --- /dev/null +++ b/Configuration/TSConfig/ContentElementWizard.typoscript @@ -0,0 +1,13 @@ +mod.wizards.newContentElement.wizardItems.plugins { + elements { + we_cookie_consent_pi1 { + iconIdentifier = we_cookie_consent-plugin-pi1 + title = LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_we_cookie_consent_pi1.name + description = LLL:EXT:we_cookie_consent/Resources/Private/Language/locallang_db.xlf:tx_we_cookie_consent_pi1.description + tt_content_defValues { + CType = list + list_type = wecookieconsent_pi1 + } + } + } +} \ No newline at end of file diff --git a/Configuration/TypoScript/constants.ts b/Configuration/TypoScript/constants.ts new file mode 100755 index 0000000..32d6bef --- /dev/null +++ b/Configuration/TypoScript/constants.ts @@ -0,0 +1,60 @@ +plugin.tx_wecookieconsent_pi1 { + view { + # cat=plugin.tx_wecookieconsent_pi1/file; type=string; label=Path to template root (FE) + templateRootPath > + # cat=plugin.tx_wecookieconsent_pi1/file; type=string; label=Path to template partials (FE) + partialRootPath > + # cat=plugin.tx_wecookieconsent_pi1/file; type=string; label=Path to template layouts (FE) + layoutRootPath > + } + + persistence { + # cat=plugin.tx_wecookieconsent_pi1/01_WEID/100; type=string; label=Storage folder:UID of the cookie sysfolder + storagePid = + } + + settings { + klaro { + # cat=plugin.tx_wecookieconsent_pi1/03_WEOTHER/100; type=string; label=Element ID:DOM ID of klaro + elementID = klaro + # cat=plugin.tx_wecookieconsent_pi1/03_WEOTHER/101; type=options[Cookie=cookie,Local Storage=localStorage]; label=Storage Method:How Klaro should store the user's preferences. It can be either "cookie" (the default) or "localStorage" + storageMethod = cookie + # cat=plugin.tx_wecookieconsent_pi1/03_WEOTHER/102; type=string; label=Cookie Name:Cookie name of klaro + cookieName = klaro + # cat=plugin.tx_wecookieconsent_pi1/03_WEOTHER/102; type=int+; label=Lifetime:Cookie lifetime of klaro in days + cookieExpiresAfterDays = 365 + # cat=plugin.tx_wecookieconsent_pi1/01_WEID/101; type=string; label=Privacy Page:UID of the privacy page or absolute/relative URL + privacyPolicy = 1 + # cat=plugin.tx_wecookieconsent_pi1/03_WEOTHER/103; type=boolean; label=State:Defines the default state for applications + default = 0 + # cat=plugin.tx_wecookieconsent_pi1/03_WEOTHER/104; type=boolean; label=Must consent:If "mustConsent" is set to true, Klaro will directly display the consent manager modal and not allow the user to close it before having actively consented or declines the use of third-party apps + mustConsent = 0 + # cat=plugin.tx_wecookieconsent_pi1/03_WEOTHER/105; type=boolean; label=Hide Decline all:Hide the decline link + hideDeclineAll = 0 + # cat=plugin.tx_wecookieconsent_pi1/03_WEOTHER/106; type=boolean; label=Hide Learn more:Hide the customization button + hideLearnMore = 0 + # cat=plugin.tx_wecookieconsent_pi1/03_WEOTHER/107; type=string; label=Powered by:UID of the powered by page or absolute/relative URL. Link shown in consent window + poweredBy = https://consent.websedit.de + # cat=plugin.tx_wecookieconsent_pi1/03_WEOTHER/108; type=string; label=Language (obsolete):Language selection is based on the page languages. Will be removed in future versions. For language customizations see chapter 6.2 in documentation. + lang = en + # cat=plugin.tx_wecookieconsent_pi1/02_WETEMPLATE/100; type=options[Bottom=klaro we_cookie_consent,Top=klaro we_cookie_consent notice--top,Center 1=klaro we_cookie_consent notice--center,Center 2= klaro we_cookie_consent notice--center-floated]; label=Style Prefix:For Custom CSS Styling + stylePrefix = klaro we_cookie_consent + } + } +} + +module.tx_wecookieconsent_mod1 { + view { + # cat=module.tx_wecookieconsent_mod1/file; type=string; label=Path to template root (BE) + templateRootPath = EXT:we_cookie_consent/Resources/Private/Backend/Templates/ + # cat=module.tx_wecookieconsent_mod1/file; type=string; label=Path to template partials (BE) + partialRootPath = EXT:we_cookie_consent/Resources/Private/Backend/Partials/ + # cat=module.tx_wecookieconsent_mod1/file; type=string; label=Path to template layouts (BE) + layoutRootPath = EXT:we_cookie_consent/Resources/Private/Backend/Layouts/ + } + + persistence { + # cat=module.tx_wecookieconsent_mod1//a; type=string; label=Default storage PID + storagePid = + } +} \ No newline at end of file diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript new file mode 100755 index 0000000..8320c01 --- /dev/null +++ b/Configuration/TypoScript/constants.typoscript @@ -0,0 +1,7 @@ +//File renamed to .ts extension for TYPO3 7 support, if support is dropped change back to .typoscript file ending + +//TYPO3 9 Syntax +//@import 'EXT:we_cookie_consent/Configuration/TypoScript/constants.ts' + +//TYPO3 8 Syntax + \ No newline at end of file diff --git a/Configuration/TypoScript/setup.ts b/Configuration/TypoScript/setup.ts new file mode 100755 index 0000000..338cbe9 --- /dev/null +++ b/Configuration/TypoScript/setup.ts @@ -0,0 +1,116 @@ +plugin.tx_wecookieconsent_pi1 { + view { + templateRootPaths { + 0 = EXT:we_cookie_consent/Resources/Private/Templates/ + 10 = EXT:we_template/Resources/Private/Templates/we_cookie_consent/ + 20 = {$plugin.tx_wecookieconsent_pi1.view.templateRootPath} + } + + partialRootPaths { + 0 = EXT:we_cookie_consent/Resources/Private/Partials/ + 10 = EXT:we_template/Resources/Private/Partials/we_cookie_consent/ + 20 = {$plugin.tx_wecookieconsent_pi1.view.partialRootPath} + } + + layoutRootPaths { + 0 = EXT:we_cookie_consent/Resources/Private/Layouts/ + 10 = EXT:we_template/Resources/Private/Layouts/we_cookie_consent/ + 20 = {$plugin.tx_wecookieconsent_pi1.view.layoutRootPath} + } + } + + persistence { + storagePid = {$plugin.tx_wecookieconsent_pi1.persistence.storagePid} + } + + features { + skipDefaultArguments = 1 + ignoreAllEnableFieldsInBe = 0 + requireCHashArgumentForActionArguments = 1 + } + + mvc { + callDefaultActionIfActionCantBeResolved = 1 + } + + settings { + klaro { + elementID = {$plugin.tx_wecookieconsent_pi1.settings.klaro.elementID} + storageMethod = {$plugin.tx_wecookieconsent_pi1.settings.klaro.storageMethod} + cookieName = {$plugin.tx_wecookieconsent_pi1.settings.klaro.cookieName} + cookieExpiresAfterDays = {$plugin.tx_wecookieconsent_pi1.settings.klaro.cookieExpiresAfterDays} + privacyPolicy = {$plugin.tx_wecookieconsent_pi1.settings.klaro.privacyPolicy} + default = {$plugin.tx_wecookieconsent_pi1.settings.klaro.default} + mustConsent = {$plugin.tx_wecookieconsent_pi1.settings.klaro.mustConsent} + hideDeclineAll = {$plugin.tx_wecookieconsent_pi1.settings.klaro.hideDeclineAll} + hideLearnMore = {$plugin.tx_wecookieconsent_pi1.settings.klaro.hideLearnMore} + poweredBy = {$plugin.tx_wecookieconsent_pi1.settings.klaro.poweredBy} + lang = {$plugin.tx_wecookieconsent_pi1.settings.klaro.lang} + stylePrefix = {$plugin.tx_wecookieconsent_pi1.settings.klaro.stylePrefix} + } + } +} + +module.tx_wecookieconsent_web_wecookieconsentmod1 { + persistence { + storagePid = {$module.tx_wecookieconsent_mod1.persistence.storagePid} + } + + view { + templateRootPaths { + 0 = EXT:we_cookie_consent/Resources/Private/Backend/Templates/ + 10 = EXT:we_template/Resources/Private/Templates/Backend/we_cookie_consent/ + 20 = {$module.tx_wecookieconsent_mod1.view.templateRootPath} + } + + partialRootPaths { + 0 = EXT:we_cookie_consent/Resources/Private/Backend/Partials/ + 10 = EXT:we_template/Resources/Private/Partials/Backend/we_cookie_consent/ + 20 = {$module.tx_wecookieconsent_mod1.view.partialRootPath} + } + + layoutRootPaths { + 0 = EXT:we_cookie_consent/Resources/Private/Backend/Layouts/ + 10 = EXT:we_template/Resources/Private/Layouts/Backend/we_cookie_consent/ + 20 = {$module.tx_wecookieconsent_mod1.view.layoutRootPath} + } + } +} + +page { + #Include Cookie Consent on every page + 525304800 < tt_content.list.20.wecookieconsent_pi1 + + includeCSS { + we_cookie_consent_style = EXT:we_cookie_consent/Resources/Public/Stylesheet/style.css + } + + //Not compatible with the TYPO3 7 output because of the missing renderAssetsForRequest function. Can be reactivited if support for TYPO3 7 is dropped + #includeJSFooter { + # we_cookie_consent_controller = EXT:we_cookie_consent/Resources/Public/JavaScript/Controller/ConsentController.js + #} +} + +#Disable mustConsent feature on the privacy page, else the privacy policy can't be read. +//[page["uid"] == {$plugin.tx_wecookieconsent_pi1.settings.klaro.privacyPolicy}] //TYPO3 9 Condition Syntax +[page|uid = {$plugin.tx_wecookieconsent_pi1.settings.klaro.privacyPolicy}] + plugin.tx_wecookieconsent_pi1 { + settings { + klaro { + mustConsent = 0 + } + } + } +[GLOBAL] + +#Override locallang.xlf Labels +#config.tx_extbase._LOCAL_LANG { +# default { +# klaro\.poweredBy = EXT:we_cookie_consent +# klaro\.consentNotice\.description = My custom message +# } +# de { +# klaro\.poweredBy = EXT:we_cookie_consent +# klaro\.consentNotice\.description = Mein eigener Text +# } +#} \ No newline at end of file diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript new file mode 100755 index 0000000..77d53a8 --- /dev/null +++ b/Configuration/TypoScript/setup.typoscript @@ -0,0 +1,7 @@ +//File renamed to .ts extension for TYPO3 7 support, if support is dropped change back to .typoscript file ending + +//TYPO3 9 Syntax +//@import 'EXT:we_cookie_consent/Configuration/TypoScript/setup.ts' + +//TYPO3 8 Syntax + \ No newline at end of file diff --git a/Resources/Private/Backend/Layouts/Default.html b/Resources/Private/Backend/Layouts/Default.html new file mode 100755 index 0000000..16e829f --- /dev/null +++ b/Resources/Private/Backend/Layouts/Default.html @@ -0,0 +1,35 @@ + + +
+
+
+
+ + + + +
+
+ + +
+
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+ \ No newline at end of file diff --git a/Resources/Private/Backend/Partials/Service/Table.html b/Resources/Private/Backend/Partials/Service/Table.html new file mode 100755 index 0000000..66d957c --- /dev/null +++ b/Resources/Private/Backend/Partials/Service/Table.html @@ -0,0 +1,8 @@ + + {service.title} + {service.gtmTagTitle} + {service.gtmTriggerTitle} + {service.gtmTriggerName} + {service.gtmVariableTitle} + {service.gtmVariableName} + \ No newline at end of file diff --git a/Resources/Private/Backend/Templates/Backend/GtmWizard.html b/Resources/Private/Backend/Templates/Backend/GtmWizard.html new file mode 100755 index 0000000..e72097b --- /dev/null +++ b/Resources/Private/Backend/Templates/Backend/GtmWizard.html @@ -0,0 +1,37 @@ + + + +

Google Tag Manager Export Wizard

+ + + + + + + + + + + + + + + + + + +
 
+ +
{gtmArray}
+ +
+

Download JSON File

+ + +
+ + + +
+
+ \ No newline at end of file diff --git a/Resources/Private/Backend/Templates/Backend/JsonDownload.html b/Resources/Private/Backend/Templates/Backend/JsonDownload.html new file mode 100755 index 0000000..5293c3d --- /dev/null +++ b/Resources/Private/Backend/Templates/Backend/JsonDownload.html @@ -0,0 +1,3 @@ + +{gtmArray} + \ No newline at end of file diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf new file mode 100755 index 0000000..cb42427 --- /dev/null +++ b/Resources/Private/Language/de.locallang.xlf @@ -0,0 +1,96 @@ + + + +
+ + + Datenschutzeinstellungen + + + Sie können nachfolgend Ihre Datenschutzeinstellungen festlegen. + + + Datenschutzerklärung + + + Detaillierte Informationen und wie Sie Ihre Einwilligung jederzeit widerrufen können, finden Sie in unserer {privacyPolicy}. + + + Wir verwenden Cookies, um Inhalte und Anzeigen zu personalisieren, Funktionen für soziale Medien anbieten zu können und die Zugriffe auf unserer Website zu analysieren. Außerdem geben wir Informationen zu Ihrer Verwendung unserer Website an unsere Partner für soziale Medien, Werbung und Analysen weiter. Unsere Partner führen diese Informationen möglicherweise mit weiteren Daten zusammen, die Sie ihnen bereitgestellt haben oder die sie im Rahmen Ihrer Nutzung der Dienste gesammelt haben. [privacyPage] + + + Seit Ihrem letzten Besuch gab es Änderungen an den Datenschutzeinstellungen. Bitte aktualisieren Sie Ihre Einstellungen. + + + Einstellungen bearbeiten + + + Alle akzeptieren + + + Sie haben jederzeit das Recht Ihre Einwilligungen einzeln oder in Gänze zu widerrufen. Werden Einwilligungen zur Datenverarbeitung widerrufen, sind die bis zum Widerruf rechtmäßig erhobenen Daten vom Anbieter weiterhin verarbeitbar. + + + (Opt-Out)1 + + + Diese Anwendung wird standardmäßig geladen (aber Sie können sie deaktivieren) + + + (immer notwendig) + + + Diese Anwendung wird immer benötigt + + + Zweck + + + Zwecke + + + Besucher-Statistiken + + + Sicherheit + + + Live-Chat + + + Anzeigen von Werbung + + + Nicht zugeordnet + + + Akzeptieren + + + Einstellungen speichern + + + Ablehnen + + + Schließen + + + Bereitgestellt von websedit + + + + Datenschutzeinstellungen anpassen + + + Name + + + Beschreibung + + + Gültigkeit + + + + \ No newline at end of file diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf new file mode 100755 index 0000000..e7ab4cd --- /dev/null +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -0,0 +1,226 @@ + + + +
+ + + Service + + + + Authentifizierung + + + Einstellungen + + + Entwicklung + + + Cookies + + + Google Tag Manager + + + + Service Skript Auswahl + + + Trigger + + + Variable + + + + + Anbieter + + + [Hilfestellung] + + + Weitere + + + Weiterer Service + + + Name + + + Name + + + Titel des Services oder Skripts + + + [Hilfestellung] + + + Beschreibung + + + Erklärung zur Verwendung des Services oder Skripts + + + Purpose + + + [Hilfestellung] + + + Service oder Skript Zustand ohne Anpassung + + + Bei Klick auf "Alles akzeptieren" ist dies Skript automatisch akzeptiert. + + + Service oder Skript ist vorausgewählt + + + Bei Betreten der Website, ist dieses Skript vorausgewählt, jedoch noch nicht aktiv. Es kann vom Besucher angepasst werden. Unter Umständen bei geltendem DS-GVO oder EuGH nicht erlaubt. + + + Service oder Skript wird benötigt + + + Bei Betreten der Website, ist dieses Skript vorausgewählt und ist bereits geladen. Es kann vom Besucher nicht angepasst werden. Dies wird in der Regel für funktional benötigte Skripte verwendet oder wenn ein berechtigtes Interesse besteht. + + + Service oder Skript benötigt aktive Abmeldung + + + Bei Betreten der Website, ist dieses Skript vorausgewählt und ist bereits geladen. Es kann vom Besucher angepasst werden. + + + Service oder Skript nur einmal laden + + + Gewährleistet die einmalige Ausführung des Skriptes bei mehrfacher Anpassung. + + + Snippet + + + [Hilfestellung] + + + Callback + + + Funktion, die bei Änderung der Zustimmung aufgerufen wird. Nur für Entwickler relevant! + + + Domain + + + Bspw. https://consent.websedit.de/statistics/ + + + API Key + + + Bspw. Google UA-Code, Facebook-ID, Matomo SiteId, etc. + + + Tag Titel + + + [Hilfestellung] + + + Trigger Titel + + + [Hilfestellung] + + + Trigger Name + + + [Hilfestellung] + + + Variable Titel + + + [Hilfestellung] + + + Variable Name + + + [Hilfestellung] + + + Cookies + + + Ausgabe auf der Datenschutzseite mit Plugin "Cookie Liste" + + + Weiteres Cookie hinzufügen + + + Kategorien + + + [Hilfestellung] + + + + Cookie + + + Fortgeschrittene + + + [Hilfestellung] + + + Cookie Name + + + [Hilfestellung] + + + Regex + + + [Hilfestellung] + + + Cookie Zweck + + + Beschreibung des Cookies + + + Cookie Lebenszeit + + + Bspw.: 365 Tage, Session-Cookie, etc. + + + + + Cookie Liste + + + Ausgabe der angegebenen Cookies in einer Tabelle + + + Ansicht + + + Cookie Liste + + + Services Skripts + + + + \ No newline at end of file diff --git a/Resources/Private/Language/de.locallang_mod1.xlf b/Resources/Private/Language/de.locallang_mod1.xlf new file mode 100755 index 0000000..c49efac --- /dev/null +++ b/Resources/Private/Language/de.locallang_mod1.xlf @@ -0,0 +1,39 @@ + + + +
+ + + Cookie Consent Tool + + + Beschreibung + + + + Tag Title + + + Trigger Title + + + Trigger Name + + + Variable Title + + + Variable Name + + + Es befinden sich keine Google Tag Manager Services in diesem Sysordner! Bitte wäheln Sie im Seitenbaum den richtigen Ordner. + + + Download All + + + Download only Triggers Variables + + + + \ No newline at end of file diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf new file mode 100755 index 0000000..c5bcb3d --- /dev/null +++ b/Resources/Private/Language/locallang.xlf @@ -0,0 +1,96 @@ + + + +
+ + + Privacy settings + + + You can specify your privacy settings below. + + + Privacy policy + + + Detailed information and how you can withdraw your consent at any time can be found in our {privacyPolicy}. + + + We use cookies to personalize content and ads, to provide social media features, and to analyze traffic to our website. We also share information about your use of our website with our social media, advertising and analytics partners. Our partners may combine this information with other information that you have provided to them or that they have collected as part of your use of the services. + + + Since your last visit there have been changes to the privacy settings. Please update your settings. + + + Edit settings + + + Accept all + + + You have the right to revoke your consent at any time, either individually or in its entirety. If consents to data processing are revoked, the data that were legally collected up to the revocation can still be processed by the provider. + + + (Opt-Out)1 + + + This application is loaded by default (but you can disable it) + + + (always necessary) + + + This application is always required + + + Purpose + + + Purposes + + + Visitor statistics + + + Security + + + Live chat + + + Display of advertising + + + Not assigned + + + Accept + + + Save settings + + + Reject + + + Close + + + Provided by websedit + + + + Customize privacy settings + + + Name + + + Description + + + Validity + + + + \ No newline at end of file diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf new file mode 100755 index 0000000..c90beef --- /dev/null +++ b/Resources/Private/Language/locallang_db.xlf @@ -0,0 +1,226 @@ + + + +
+ + + Service + + + + Authentication + + + Settings + + + Development + + + Cookies + + + Google Tag Manager + + + + Service Script selection + + + Trigger + + + Variable + + + + + Provider + + + [Hilfestellung] + + + Others + + + Further service + + + Name + + + Name + + + Title of the service or script + + + [Hilfestellung] + + + Description + + + Declaration on the use of the service or script + + + Purpose + + + [Hilfestellung] + + + Service or script state without adaptation + + + If you click on "Accept all" this script is automatically accepted. + + + Service or script is pre-selected + + + When entering the website, this script is preselected but not yet active. It can be customized by the visitor. Under certain circumstances not permitted under current GDPR or EUGH. + + + Service or script is required + + + When entering the website, this script is preselected and already loaded. It cannot be customized by the visitor. This is usually used for functionally required scripts or if a legitimate interest exists. + + + Service or script requires active revocation + + + BWhen entering the website, this script is preselected and already loaded. It can be customized by the visitor. + + + Load service or script only once + + + Ensures that the script is executed once for multiple adjustments. + + + Snippet + + + [Hilfestellung] + + + Callback + + + Function that is called when the consent is changed. Only relevant for developers! + + + Domain + + + Bspw. https://consent.websedit.de/statistics/ + + + API key + + + For example Google UA Code, Facebook ID, Matomo SiteId, etc. + + + Tag Title + + + [Hilfestellung] + + + Trigger Title + + + [Hilfestellung] + + + Trigger Name + + + [Hilfestellung] + + + Variable Title + + + [Hilfestellung] + + + Variable Name + + + [Hilfestellung] + + + Cookies + + + Output on the privacy page with plugin "Cookie List" + + + Add another cookie + + + Categories + + + [Hilfestellung] + + + + Cookie + + + Advanced + + + [Hilfestellung] + + + Cookie Name + + + [Hilfestellung] + + + Regex + + + [Hilfestellung] + + + Cookie Purpose + + + Beschreibung des Cookies + + + Cookie lifetime + + + For example: 365 days, session cookie, etc. + + + + + Cookie list + + + Output of the specified cookies in a table + + + View + + + Cookie list + + + Services Scripts + + + + \ No newline at end of file diff --git a/Resources/Private/Language/locallang_mod1.xlf b/Resources/Private/Language/locallang_mod1.xlf new file mode 100755 index 0000000..b366045 --- /dev/null +++ b/Resources/Private/Language/locallang_mod1.xlf @@ -0,0 +1,39 @@ + + + +
+ + + Cookie Consent Tool + + + Description + + + + Tag Title + + + Trigger Title + + + Trigger Name + + + Variable Title + + + Variable Name + + + There are no Google Tag Manager Services in this system folder! Please select the correct folder in the page tree. + + + Download All + + + Download only Triggers Variables + + + + \ No newline at end of file diff --git a/Resources/Private/Layouts/Default.html b/Resources/Private/Layouts/Default.html new file mode 100755 index 0000000..54cc39e --- /dev/null +++ b/Resources/Private/Layouts/Default.html @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/Resources/Private/Partials/Cookie/Table.html b/Resources/Private/Partials/Cookie/Table.html new file mode 100755 index 0000000..4cd0012 --- /dev/null +++ b/Resources/Private/Partials/Cookie/Table.html @@ -0,0 +1,7 @@ + + + {cookie.title} + {cookie.description} + {cookie.maxAge} + + diff --git a/Resources/Private/Partials/Klaro/App.html b/Resources/Private/Partials/Klaro/App.html new file mode 100755 index 0000000..1c3f052 --- /dev/null +++ b/Resources/Private/Partials/Klaro/App.html @@ -0,0 +1,24 @@ + + + ['{cookie.title}', '/', ''], + + + '{category.title -> f:format.case(mode: 'lower')}', + + + \ No newline at end of file diff --git a/Resources/Private/Partials/Service/facebook.html b/Resources/Private/Partials/Service/facebook.html new file mode 100755 index 0000000..aad464b --- /dev/null +++ b/Resources/Private/Partials/Service/facebook.html @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/Resources/Private/Partials/Service/google-analytics-universal.html b/Resources/Private/Partials/Service/google-analytics-universal.html new file mode 100755 index 0000000..f3743d2 --- /dev/null +++ b/Resources/Private/Partials/Service/google-analytics-universal.html @@ -0,0 +1,16 @@ + + + + + + + \ No newline at end of file diff --git a/Resources/Private/Partials/Service/google-analytics.html b/Resources/Private/Partials/Service/google-analytics.html new file mode 100755 index 0000000..7d11cd7 --- /dev/null +++ b/Resources/Private/Partials/Service/google-analytics.html @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/Resources/Private/Partials/Service/google-tagmanager-service.html b/Resources/Private/Partials/Service/google-tagmanager-service.html new file mode 100755 index 0000000..0f825ab --- /dev/null +++ b/Resources/Private/Partials/Service/google-tagmanager-service.html @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/Resources/Private/Partials/Service/google-tagmanager.html b/Resources/Private/Partials/Service/google-tagmanager.html new file mode 100755 index 0000000..febf915 --- /dev/null +++ b/Resources/Private/Partials/Service/google-tagmanager.html @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/Resources/Private/Partials/Service/matomo.html b/Resources/Private/Partials/Service/matomo.html new file mode 100755 index 0000000..02aaed4 --- /dev/null +++ b/Resources/Private/Partials/Service/matomo.html @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/Resources/Private/Partials/Service/other.html b/Resources/Private/Partials/Service/other.html new file mode 100755 index 0000000..d13b428 --- /dev/null +++ b/Resources/Private/Partials/Service/other.html @@ -0,0 +1,15 @@ +{namespace we=Websedit\WeCookieConsent\ViewHelpers} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/Private/Templates/Consent/Consent.html b/Resources/Private/Templates/Consent/Consent.html new file mode 100755 index 0000000..5431251 --- /dev/null +++ b/Resources/Private/Templates/Consent/Consent.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/Private/Templates/Consent/List.html b/Resources/Private/Templates/Consent/List.html new file mode 100755 index 0000000..64cd72e --- /dev/null +++ b/Resources/Private/Templates/Consent/List.html @@ -0,0 +1,26 @@ + + + + + + {service.title} + {service.description} + + + + + + + + + + + + + +
Cookies
+
+
+ +
+ \ No newline at end of file diff --git a/Resources/Public/Icons/sysfolder.png b/Resources/Public/Icons/sysfolder.png new file mode 100755 index 0000000000000000000000000000000000000000..4aa360ffdb4646bd1fcca6402f2e94fd30b403ad GIT binary patch literal 1437 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zUV|`WQ#WrEP{HZUkcg59UmvUF{9L`nl>DSry^7odplSvNn+hu+GdHy)QK2F?C$HG5 z!d3~a!V1U+3F|8Y3;nDA{o-C@9zzrKDK}xwt{K19`Se z86_nJR{Hwo<>h+i#(Mch>H3D2mX`VkM*2oZx=P7{9O-#x!EwNQn0$BtHP)+Ft-Bj`QoGdn}ZA+`#Eu~)qH@gCKekquUTuEBJdTG;w^<7JXE~qbD zuwdIp*KV%`VqOllnQInqId);0?!^nscE3yuyw$5Rd+wPxXYRm;Uvi+TtsmUmmT?s(O9t>vK8P&V62*Nj^OX6qFy_3$M_h zmvFpx`hk@jH|)8i{oAT*+WYl!8;iBQf9}r{yV=(F?C|t;`+X$k95y}YRLqyQlzlVr zNO$3E8UEOVylhMb#>v-P0?yuw{2a)yvuKL{SqTkgIhIRZi=;vwuZSC5*O={p%=LQj zr3E{FJa;qOQ!RG$OOs9rTSj@=zDYlhyi|GIB^NoT(v_>wj=_8GNnX7So|Y=MYQ>oj z;Q~rFwUx%z-`}wPsoKqMxNK$iOhL}mnX%Q&Gi9PZ{(fF~aPldW&u^{EMB?Y~DHLdV z;WXt2vs0qcgR9HM3UcaMoul6;-8`H0e)-`qaZCBt*7BXLuU)d%QRc~)Q+IL{&z%Ti zZu+b$?Z52kKI^A-_ohXfOq#~5$vFS^3@w|sxv`&>X74*6BY!z)Yt58X|BK@$FIn^; zL$c-1^9VN%{S3F@LykLlu{s&qZ2oJ+#8*os)c~ zs;xd^+j{;Di>=g^)D^)*)Nf*6b?~0n`r}8onymYh{xRiz{)V%ue9rwrvGWx3 z7p+?VV)|Ewo0)Tpv!~oP^pv@uR$QNd{G9LQfpX>PWn1QpOt6t z+4c=iiv#_he01L1_FY&qv!%&!X~d1oVI3`p_9`4MuAThw*Au1wXp?8fav8V2yB*|} zbP?6iRa?t0+3Be<$79)rOD}r!mcK4lN?e<1bNbe?&|?J#bsXhaTHYn_?O|Lv@kxEr zHT$BfOXgXtoYxgZb3Jx?#ryB`VRmVzo;UT39(UT_-O{fQ0hO7au6{1-oD!M<^tD!% literal 0 HcmV?d00001 diff --git a/Resources/Public/Icons/tx_wecookieconsent_domain_model_cookie.svg b/Resources/Public/Icons/tx_wecookieconsent_domain_model_cookie.svg new file mode 100755 index 0000000..ed417f5 --- /dev/null +++ b/Resources/Public/Icons/tx_wecookieconsent_domain_model_cookie.svg @@ -0,0 +1,11 @@ + + + + Artboard + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/Resources/Public/Icons/tx_wecookieconsent_domain_model_service.svg b/Resources/Public/Icons/tx_wecookieconsent_domain_model_service.svg new file mode 100755 index 0000000..ed417f5 --- /dev/null +++ b/Resources/Public/Icons/tx_wecookieconsent_domain_model_service.svg @@ -0,0 +1,11 @@ + + + + Artboard + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/Resources/Public/Icons/user_mod_mod1.svg b/Resources/Public/Icons/user_mod_mod1.svg new file mode 100755 index 0000000..ed417f5 --- /dev/null +++ b/Resources/Public/Icons/user_mod_mod1.svg @@ -0,0 +1,11 @@ + + + + Artboard + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/Resources/Public/Icons/user_plugin_pi1.svg b/Resources/Public/Icons/user_plugin_pi1.svg new file mode 100755 index 0000000..ed417f5 --- /dev/null +++ b/Resources/Public/Icons/user_plugin_pi1.svg @@ -0,0 +1,11 @@ + + + + Artboard + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/Resources/Public/JavaScript/Controller/ConsentController.js b/Resources/Public/JavaScript/Controller/ConsentController.js new file mode 100755 index 0000000..c680433 --- /dev/null +++ b/Resources/Public/JavaScript/Controller/ConsentController.js @@ -0,0 +1,110 @@ +// Consent class +let ConsentApp = new function ConsentController() { + //-- global variables --- + window.dataLayer = window.dataLayer || []; + + //--- private variables --- + var cloneButttonInterval, counter = 0; + + //--- public functions --- + /** + * Callback function for GoogleTagManager Script to fire the dataLayer trigger + * @param bool state + * @param object app + */ + this.consentChanged = function (state, app) { + if (state === true) { + if (app.name.indexOf('google-tagmanager-service') !== -1) { + let tempObj = { + event: app.gtm.trigger + }; + tempObj[app.gtm.variable] = true; + window.dataLayer.push(tempObj); + + /* + //ES6 - https://stackoverflow.com/questions/11508463/javascript-set-object-key-by-variable + window.dataLayer.push({ + event: app.name, + [app.name]: true + }); + */ + } + } + + //Check if the own callback function is allready defined + if (typeof window[app.ownCallback] === "function") { + window[app.ownCallback](state, app); + } else if (app.ownCallback !== '') { + console.error('The Callback function ' + app.ownCallback + ' is not yet defined. Please create it first.'); + } + }; + + /** + * Replace the klaro "OK" button with a clone to remove all attached event listeners. + * Otherwise our own defined listener gets not fired. + */ + this.cloneButton = function () { + if ($('.cookie-notice .cm-btn-success').length > 0) { + let currentButton = $('.cookie-notice .cm-btn-success'); + let cloneButton = currentButton.clone(); + let configLink = $('.cookie-notice p a'); + + //Replace the original button with the new + currentButton.replaceWith(cloneButton); + + //Workaround to link the privacypage inside the consent text https://github.com/KIProtect/klaro/issues/116 + $('.cn-body p:first').html(function (index, text) { + let link = $('', { + text: klaroConfig.translations.en.consentModal.privacyPolicy.name, + title: klaroConfig.translations.en.consentModal.privacyPolicy.name, + href: klaroConfig.privacyPolicy, + class: 'privcyPage' + }) + return text.replace("[privacyPage]", link[0].outerHTML); + }); + + clearInterval(cloneButttonInterval); + counter = 0; + } + + if (counter > 1000) { + clearInterval(cloneButttonInterval); + } + counter++; + }; + + //--- constructor --- + (function contruct() { + $(document).ready(function () { + //Listener for the button on the privacy page, to edit the consent + $(document).on('click', '.js-showConsentModal', function (event) { + event.preventDefault(); + klaro.show(); + }); + + //Workaround if modal ist closed without save + $(document).on('click', 'div.cm-bg, button.hide', function (event) { + event.preventDefault(); + ConsentApp.cloneButton(); + }); + + + //Only execute, if no decision is made yet (first visit). + if (klaro.getManager().confirmed == false) { + //Workaround for issue https://github.com/KIProtect/klaro/issues/138 + $(document).on('click', '.cookie-notice .cm-btn-success', function (event) { + klaroConfig.apps.forEach(function (element, index) { + klaroConfig.apps[index].default = klaroConfig.apps[index].defaultIfNoConsent; + }); + klaro.getManager().resetConsent(); + klaro.getManager().saveAndApplyConsents(); + + $('.cookie-notice ').remove(); + }); + + //Workaround, because there is no klaro callback function + cloneButttonInterval = setInterval(ConsentApp.cloneButton, 1); + } + }); + })(); +}; \ No newline at end of file diff --git a/Resources/Public/Library/klaro/getLatest.txt b/Resources/Public/Library/klaro/getLatest.txt new file mode 100755 index 0000000..2af1fb0 --- /dev/null +++ b/Resources/Public/Library/klaro/getLatest.txt @@ -0,0 +1 @@ +https://unpkg.com/klaro \ No newline at end of file diff --git a/Resources/Public/Library/klaro/klaro.js b/Resources/Public/Library/klaro/klaro.js new file mode 100755 index 0000000..a4d3e93 --- /dev/null +++ b/Resources/Public/Library/klaro/klaro.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.klaro=t():e.klaro=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=172)}([function(e,t,n){var r=n(3),o=n(51),i=n(6),a=n(36),c=n(54),l=n(82),s=o("wks"),u=r.Symbol,p=l?u:u&&u.withoutSetter||a;e.exports=function(e){return i(s,e)||(c&&i(u,e)?s[e]=u[e]:s[e]=p("Symbol."+e)),s[e]}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(3),o=n(16).f,i=n(9),a=n(11),c=n(50),l=n(76),s=n(53);e.exports=function(e,t){var n,u,p,f,d,v=e.target,m=e.global,y=e.stat;if(n=m?r:y?r[v]||c(v,{}):(r[v]||{}).prototype)for(u in t){if(f=t[u],p=e.noTargetGet?(d=o(n,u))&&d.value:n[u],!s(m?u:v+(y?".":"#")+u,e.forced)&&void 0!==p){if(typeof f==typeof p)continue;l(f,p)}(e.sham||p&&p.sham)&&i(f,"sham",!0),a(n,u,f,e)}}},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n(116))},function(e,t,n){var r=n(1);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(4),o=n(72),i=n(8),a=n(34),c=Object.defineProperty;t.f=r?c:function(e,t,n){if(i(e),t=a(t,!0),i(n),o)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(5);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,n){var r=n(4),o=n(7),i=n(23);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(49),o=n(13);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(3),o=n(9),i=n(6),a=n(50),c=n(74),l=n(17),s=l.get,u=l.enforce,p=String(String).split("String");(e.exports=function(e,t,n,c){var l=!!c&&!!c.unsafe,s=!!c&&!!c.enumerable,f=!!c&&!!c.noTargetGet;"function"==typeof n&&("string"!=typeof t||i(n,"name")||o(n,"name",t),u(n).source=p.join("string"==typeof t?t:"")),e!==r?(l?!f&&e[t]&&(s=!0):delete e[t],s?e[t]=n:o(e,t,n)):s?e[t]=n:a(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&s(this).source||c(this)}))},function(e,t,n){var r=n(38),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(13);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";var r=n(10),o=n(83),i=n(27),a=n(17),c=n(55),l=a.set,s=a.getterFor("Array Iterator");e.exports=c(Array,"Array",(function(e,t){l(this,{type:"Array Iterator",target:r(e),index:0,kind:t})}),(function(){var e=s(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(e,t,n){var r=n(4),o=n(62),i=n(23),a=n(10),c=n(34),l=n(6),s=n(72),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=a(e),t=c(t,!0),s)try{return u(e,t)}catch(e){}if(l(e,t))return i(!o.f.call(e,t),e[t])}},function(e,t,n){var r,o,i,a=n(117),c=n(3),l=n(5),s=n(9),u=n(6),p=n(35),f=n(26),d=c.WeakMap;if(a){var v=new d,m=v.get,y=v.has,h=v.set;r=function(e,t){return h.call(v,e,t),t},o=function(e){return m.call(v,e)||{}},i=function(e){return y.call(v,e)}}else{var g=p("state");f[g]=!0,r=function(e,t){return s(e,g,t),t},o=function(e){return u(e,g)?e[g]:{}},i=function(e){return u(e,g)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var r=n(78),o=n(3),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},function(e,t,n){var r=n(57),o=n(11),i=n(125);r||o(Object.prototype,"toString",i,{unsafe:!0})},function(e,t,n){"use strict";var r=n(95).charAt,o=n(17),i=n(55),a=o.set,c=o.getterFor("String Iterator");i(String,"String",(function(e){a(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=c(this),n=t.string,o=t.index;return o>=n.length?{value:void 0,done:!0}:(e=r(n,o),t.index+=e.length,{value:e,done:!1})}))},function(e,t,n){var r=n(3),o=n(96),i=n(15),a=n(9),c=n(0),l=c("iterator"),s=c("toStringTag"),u=i.values;for(var p in o){var f=r[p],d=f&&f.prototype;if(d){if(d[l]!==u)try{a(d,l,u)}catch(e){d[l]=u}if(d[s]||a(d,s,p),o[p])for(var v in i)if(d[v]!==i[v])try{a(d,v,i[v])}catch(e){d[v]=i[v]}}}},function(e,t,n){"use strict";var r=n(11),o=n(8),i=n(1),a=n(59),c=RegExp.prototype,l=c.toString,s=i((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),u="toString"!=l.name;(s||u)&&r(RegExp.prototype,"toString",(function(){var e=o(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in c)?a.call(e):n)}),{unsafe:!0})},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=!1},function(e,t){e.exports={}},function(e,t){e.exports={}},function(e,t,n){var r=n(4),o=n(1),i=n(6),a=Object.defineProperty,c={},l=function(e){throw e};e.exports=function(e,t){if(i(c,e))return c[e];t||(t={});var n=[][e],s=!!i(t,"ACCESSORS")&&t.ACCESSORS,u=i(t,0)?t[0]:l,p=i(t,1)?t[1]:void 0;return c[e]=!!n&&!o((function(){if(s&&!r)return!0;var e={length:-1};s?a(e,1,{enumerable:!0,get:l}):e[1]=1,n.call(e,u,p)}))}},function(e,t,n){var r=n(4),o=n(7).f,i=Function.prototype,a=i.toString,c=/^\s*function ([^ (]*)/;r&&!("name"in i)&&o(i,"name",{configurable:!0,get:function(){try{return a.call(this).match(c)[1]}catch(e){return""}}})},function(e,t,n){var r,o=n(8),i=n(118),a=n(52),c=n(26),l=n(119),s=n(73),u=n(35),p=u("IE_PROTO"),f=function(){},d=function(e){return"