├── .gitignore ├── Resources ├── Public │ ├── Icons │ │ ├── relation.gif │ │ ├── code-signs.svg │ │ ├── Extension.svg │ │ ├── cookie_panel_icon.svg │ │ └── cookie_grp.svg │ ├── Css │ │ ├── cookie_panel.css.map │ │ ├── cookie_panel.less │ │ └── cookie_panel.css │ └── Js │ │ └── om_cookie_main.js └── Private │ ├── Layouts │ └── Default.html │ ├── .htaccess │ ├── Templates │ └── CookiePanel │ │ ├── Info.html │ │ └── Show.html │ └── Language │ ├── locallang.xlf │ ├── de.locallang.xlf │ ├── locallang_db.xlf │ └── de.locallang_db.xlf ├── Configuration ├── Services.yaml ├── TCA │ ├── Overrides │ │ ├── sys_template.php │ │ ├── tx_omcookiemanager_domain_model_cookie.php │ │ ├── tx_omcookiemanager_domain_model_cookiehtml.php │ │ ├── tx_omcookiemanager_domain_model_cookiegroup.php │ │ ├── tx_omcookiemanager_domain_model_cookiepanel.php │ │ ├── tt_content.php │ │ └── tx_omcookiemanager_domain_model_general.php │ ├── tx_omcookiemanager_domain_model_cookiehtml.php │ ├── tx_omcookiemanager_domain_model_cookie.php │ ├── tx_omcookiemanager_domain_model_cookiegroup.php │ └── tx_omcookiemanager_domain_model_cookiepanel.php ├── Icons.php ├── page.tsconfig └── TypoScript │ ├── setup.typoscript │ └── constants.typoscript ├── Documentation ├── Sitemap.rst ├── Includes.txt ├── Index.rst └── Settings.cfg ├── ext_conf_template.txt ├── Classes ├── Domain │ ├── Repository │ │ ├── CookieRepository.php │ │ ├── CookieGroupRepository.php │ │ └── CookiePanelRepository.php │ └── Model │ │ ├── CookieHtml.php │ │ ├── CookiePanel.php │ │ ├── CookieGroup.php │ │ └── Cookie.php ├── Updates │ └── OMOmCookieManagerCTypeMigration.php ├── Hook │ ├── ProcessCmdmapClass.php │ └── ProcessDatamapClass.php ├── Controller │ ├── CookieGroupController.php │ └── CookiePanelController.php └── Utility │ └── JsBuilder.php ├── composer.json ├── ext_emconf.php ├── ext_localconf.php ├── ext_tables.sql ├── readme.txt └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ -------------------------------------------------------------------------------- /Resources/Public/Icons/relation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xippo/OM-Cookie-Manager/HEAD/Resources/Public/Icons/relation.gif -------------------------------------------------------------------------------- /Configuration/Services.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | _defaults: 3 | autowire: true 4 | autoconfigure: true 5 | public: false 6 | 7 | OM\OmCookieManager\: 8 | resource: '../Classes/*' 9 | -------------------------------------------------------------------------------- /Configuration/TCA/Overrides/sys_template.php: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /ext_conf_template.txt: -------------------------------------------------------------------------------- 1 | # cat=Options; type=boolean; label=Clear Frontend Cache after Panel or Group Changes 2 | clearCache = 1 3 | # cat=Options; type=boolean; label=Replace/Fetch TypoScript constants inside the the cookie html 4 | injectTsConstants = 0 -------------------------------------------------------------------------------- /Resources/Private/.htaccess: -------------------------------------------------------------------------------- 1 | # Apache < 2.3 2 | 3 | Order allow,deny 4 | Deny from all 5 | Satisfy All 6 | 7 | 8 | # Apache >= 2.3 9 | 10 | Require all denied 11 | 12 | -------------------------------------------------------------------------------- /Configuration/Icons.php: -------------------------------------------------------------------------------- 1 | [ 5 | \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, 6 | 'source' => 'EXT:om_cookie_manager/Resources/Public/Icons/Extension.svg', 7 | ], 8 | ]; 9 | -------------------------------------------------------------------------------- /Configuration/TCA/Overrides/tt_content.php: -------------------------------------------------------------------------------- 1 | , Olli machts 13 | * 14 | ***/ 15 | /** 16 | * The repository for Cookies 17 | */ 18 | class CookieRepository extends \TYPO3\CMS\Extbase\Persistence\Repository 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /Classes/Domain/Repository/CookieGroupRepository.php: -------------------------------------------------------------------------------- 1 | , Olli machts 13 | * 14 | ***/ 15 | /** 16 | * The repository for CookieGroups 17 | */ 18 | class CookieGroupRepository extends \TYPO3\CMS\Extbase\Persistence\Repository 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "opfaff/om-cookie-manager", 3 | "type": "typo3-cms-extension", 4 | "description": "", 5 | "authors": [ 6 | { 7 | "name": "Oliver Pfaff", 8 | "role": "Developer" 9 | } 10 | ], 11 | "require": { 12 | "typo3/cms-core": "^13.4" 13 | }, 14 | "autoload": { 15 | "psr-4": { 16 | "OM\\OmCookieManager\\": "Classes" 17 | } 18 | }, 19 | "replace": { 20 | "om/om-cookie-consent": "self.version", 21 | "typo3-ter/om-cookie-consent": "self.version" 22 | }, 23 | "extra": { 24 | "typo3/cms": { 25 | "extension-key": "om_cookie_manager" 26 | } 27 | }, 28 | "license": "GPL-3.0-or-later" 29 | } 30 | -------------------------------------------------------------------------------- /ext_emconf.php: -------------------------------------------------------------------------------- 1 | 'Cookie manager - Consent Panel (Optin)', 4 | 'description' => 'Features: Consent Panel (Optin), Grouping, Google Tag Manager support, Google Consent Mode V2. With this Extension you can manage the script/html tags that generates cookies on your site or simply build a consent panel. You can creat different groups like essential, tracking, preferences and so on. The associated scripts will be loaded only after the optin process is done.', 5 | 'category' => 'plugin', 6 | 'constraints' => [ 7 | 'depends' => [ 8 | 'typo3' => '13.4.0-13.4.99', 9 | ], 10 | 'conflicts' => [], 11 | 'suggests' => [], 12 | ], 13 | 'author' => 'Oliver Pfaff', 14 | 'author_email' => 'info@olli-machts.de', 15 | 'state' => 'stable', 16 | 'version' => '13.1.0', 17 | ]; 18 | -------------------------------------------------------------------------------- /Classes/Domain/Repository/CookiePanelRepository.php: -------------------------------------------------------------------------------- 1 | , Olli machts 13 | * 14 | ***/ 15 | /** 16 | * The repository for CookiePanels 17 | */ 18 | class CookiePanelRepository extends \TYPO3\CMS\Extbase\Persistence\Repository 19 | { 20 | 21 | public function initializeObject(): void { 22 | //set default translation behavior. So we hopefully avoid problems with different system settings 23 | $querySettings = $this->createQuery()->getQuerySettings(); 24 | $this->setDefaultQuerySettings($querySettings); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Configuration/page.tsconfig: -------------------------------------------------------------------------------- 1 | mod { 2 | wizards.newContentElement.wizardItems.plugins { 3 | elements { 4 | main { 5 | iconIdentifier = om_cookie_manager-plugin-main 6 | title = LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_om_cookie_manager_main.name 7 | description = LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_om_cookie_manager_main.description 8 | tt_content_defValues { 9 | CType = omcookiemanager_main 10 | } 11 | } 12 | } 13 | show = * 14 | } 15 | web_list.hideTables = tx_omcookiemanager_domain_model_cookie,tx_omcookiemanager_domain_model_cookiehtml 16 | web_list.deniedNewTables = tx_omcookiemanager_domain_model_cookie,tx_omcookiemanager_domain_model_cookiehtml 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /ext_localconf.php: -------------------------------------------------------------------------------- 1 | 'show', 10 | ], 11 | [], 12 | \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT 13 | ); 14 | 15 | \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 16 | 'OmCookieManager', 17 | 'Main', 18 | [ 19 | \OM\OmCookieManager\Controller\CookiePanelController::class => 'info', 20 | ], 21 | [], 22 | \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT 23 | ); 24 | 25 | // hook registration 26 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \OM\OmCookieManager\Hook\ProcessDatamapClass::class; 27 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = \OM\OmCookieManager\Hook\ProcessCmdmapClass::class; 28 | 29 | -------------------------------------------------------------------------------- /Documentation/Includes.txt: -------------------------------------------------------------------------------- 1 | .. This is 'Includes.txt'. It is included at the very top of each and 2 | every ReST source file in THIS documentation project (= manual). 3 | 4 | .. This files lives at 5 | https://github.com/TYPO3-Documentation/TYPO3CMS-Guide-HowToDocument/blob/master/Documentation/Includes.txt 6 | Version: 2018-10-16 7 | 8 | .. More information about this file: 9 | https://docs.typo3.org/typo3cms/HowToDocument/GeneralConventions/DirectoryFilenames.html#includes-txt 10 | 11 | .. Define some additional textroles 12 | See: https://docs.typo3.org/typo3cms/HowToDocument/WritingReST/InlineCode.html 13 | 14 | 15 | .. --------- 16 | .. textroles 17 | .. --------- 18 | 19 | .. role:: aspect (emphasis) 20 | .. role:: html(code) 21 | .. role:: js(code) 22 | .. role:: php(code) 23 | .. role:: rst(code) 24 | .. role:: sep (strong) 25 | .. role:: typoscript(code) 26 | 27 | .. role:: ts(typoscript) 28 | :class: typoscript 29 | 30 | .. role:: yaml(code) 31 | 32 | .. default-role:: code 33 | 34 | .. --------- 35 | .. highlight 36 | .. --------- 37 | 38 | .. By default, code blocks are php 39 | 40 | .. highlight:: php -------------------------------------------------------------------------------- /Classes/Updates/OMOmCookieManagerCTypeMigration.php: -------------------------------------------------------------------------------- 1 | 'pi_plugin1', 30 | * 'pi_plugin2' => 'new_content_element', 31 | * ] 32 | * 33 | * @return array 34 | */ 35 | protected function getListTypeToCTypeMapping(): array 36 | { 37 | return [ 38 | 'omcookiemanager_main' => 'omcookiemanager_main', 39 | 'omcookiemanager_info' => 'omcookiemanager_info', 40 | ]; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Resources/Public/Css/cookie_panel.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["cookie_panel.less"],"names":[],"mappings":"AAAA;EACE,eAAA;;AAGF;EACE,aAAA;EACA,aAAA;EACA,gBAAA;EACA,eAAA;EACA,SAAA;EACA,WAAA;EACA,OAAA;EACA,UAAA;EACA,sBAAA;EACA,0BAAA;EACA,eAAA;EACA,WAAW,iBAAiB,aAA5B;EACA,6CAAA;EACA,kBAAA;;AAQA,QAP0B;EAO1B;IANE,WAAA;IACA,SAAA;IACA,WAAW,iBAAiB,gBAA5B;IACA,2BAAA;IACA,4BAAA;;;AAEF,gBAAC;EACC,WAAW,cAAc,aAAzB;EACA,UAAA;;AAIF,QAH4B;EAG5B,gBANC;IAIG,WAAW,cAAc,gBAAzB;;;AA1BN,gBA8BE;EACE,SAAA;EACA,gBAAA;EACA,gBAAA;;AAjCJ,gBAmCE;EACE,SAAA;EACA,cAAA;;AArCJ,gBAwCE;EACE,aAAA;;AAzCJ,gBA2CE,wBAAwB;EACtB,eAAA;EACA,gBAAA;EACA,gBAAA;EACA,cAAA;;AA/CJ,gBAiDE,wBAAwB,QAAO;EAC7B,WAAA;EACA,YAAA;EACA,kBAAA;EACA,yBAAA;EACA,sBAAA;EACA,cAAA;EACA,SAAS,EAAT;EACA,WAAA;EACA,iBAAA;;AA1DJ,gBA4DE,wBAAuB,QAAQ,QAAM;EACnC,gCAAA;EACA,yBAAA;;AA9DJ,gBAgEE,uCAAuC,QAAO;EAC5C,kBAAA;;AAjEJ,gBAmEE,uCAAsC,QAAQ,QAAM;EAClD,sBAAA;;AApEJ,gBAsEE;EACE,qBAAA;EACA,gBAAA;;AAxEJ,gBAsEE,6BAGE;EACE,iBAAA;;AA1EN,gBA6EE;EACE,WAAA;;AA9EJ,gBAiFE;EACE,gBAAA;;AAlFJ,gBAoFE;EACE,gBAAA;EACA,WAAA;EACA,iBAAA;EACA,YAAA;EACA,kBAAA;EACA,cAAA;EACA,WAAA;EACA,eAAA;EACA,gBAAA;EACA,yBAAA;;AA9FJ,gBAoFE,sBAWE;EACE,gBAAA;;AASJ,QAP4B;EAO5B,gBArBA;IAeI,WAAA;IACA,qBAAA;;EAKJ,gBArBA,sBAiBI;IACE,aAAA;;;AAtGR,gBA0GE;EACE,aAAA;EACA,oBAAA;;AA5GJ,gBA0GE,qBAGE;EACE,WAAA;;AA9GN,gBA0GE,qBAME;EACE,eAAA;;AAjHN,gBAoHE;EACE,yBAAA;;AArHJ,gBAuHE;EACE,kBAAA;EACA,WAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;EACA,kBAAA;;AA7HJ,gBAuHE,2BAOE;EACE,cAAA;EACA,qBAAA;;AAKN,eACE;EACE,uBAAA;EACA,yBAAA;;AAHJ,eACE,MAGE;AAJJ,eACE,MAgBF,CAbO;EACD,iBAAA;EACA,uBAAA;;AANN,eACE,MAOE;EACE,aAAA;;AATN,eACE,MAUE,EAAC;EACC,gBAAA;EACA,iBAAA","file":"cookie_panel.css"} -------------------------------------------------------------------------------- /Classes/Hook/ProcessCmdmapClass.php: -------------------------------------------------------------------------------- 1 | , Olli machts 18 | * 19 | ***/ 20 | 21 | class ProcessCmdmapClass 22 | { 23 | /** 24 | * Generates the files out of the TCA data. 25 | * 26 | * @return void 27 | */ 28 | public function processCmdmap_deleteAction($table, $id, $recordToDelete, $recordWasDeleted, DataHandler$datahandler): void 29 | { 30 | if ($table === 'tx_omcookiemanager_domain_model_cookiepanel' || $table === 'tx_omcookiemanager_domain_model_cookiegroup') { 31 | $clearCacheOpt = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('om_cookie_manager', 'clearCache'); 32 | if((int)$clearCacheOpt === 1){ 33 | /** @var CacheManager $cacheManager */ 34 | $cacheManager = GeneralUtility::makeInstance(CacheManager::class); 35 | $cacheManager->flushCachesInGroup('pages'); 36 | $GLOBALS['BE_USER']->writelog(4,0,0,15728,'Frontend Cache Clear by deleting Cookie Panel or Group (OM Cookie manager)',[]); 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Classes/Hook/ProcessDatamapClass.php: -------------------------------------------------------------------------------- 1 | , Olli machts 18 | * 19 | ***/ 20 | 21 | class ProcessDatamapClass 22 | { 23 | /** 24 | * Generates the files out of the TCA data. 25 | * 26 | * @param DataHandler $dataHandler 27 | * @return void 28 | */ 29 | public function processDatamap_afterAllOperations(DataHandler $dataHandler): void 30 | { 31 | if (isset($dataHandler->datamap['tx_omcookiemanager_domain_model_cookiepanel']) === false && isset($dataHandler->datamap['tx_omcookiemanager_domain_model_cookiegroup']) === false) { 32 | return; 33 | } 34 | $clearCacheOpt = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('om_cookie_manager', 'clearCache'); 35 | if((int)$clearCacheOpt === 1){ 36 | /** @var CacheManager $cacheManager */ 37 | $cacheManager = GeneralUtility::makeInstance(CacheManager::class); 38 | $cacheManager->flushCachesInGroup('pages'); 39 | $GLOBALS['BE_USER']->writelog(4,0,0,15728,'Frontend Cache Clear by saving Om Cookie Panel or Group(OM Cookie manager)',[]); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Classes/Domain/Model/CookieHtml.php: -------------------------------------------------------------------------------- 1 | , Olli machts 13 | * 14 | ***/ 15 | /** 16 | * CookieHtml 17 | */ 18 | class CookieHtml extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity 19 | { 20 | 21 | /** 22 | * html 23 | * 24 | * @var string 25 | */ 26 | protected $html = ''; 27 | 28 | /** 29 | * insertPlace 30 | * 31 | * @var int 32 | */ 33 | protected $insertPlace = 0; 34 | 35 | /** 36 | * Returns the html 37 | * 38 | * @return string $html 39 | */ 40 | public function getHtml() 41 | { 42 | return $this->html; 43 | } 44 | 45 | /** 46 | * Sets the html 47 | * 48 | * @param string $html 49 | * @return void 50 | */ 51 | public function setHtml($html): void 52 | { 53 | $this->html = $html; 54 | } 55 | 56 | /** 57 | * Returns the insertPlace 58 | * 59 | * @return int $insertPlace 60 | */ 61 | public function getInsertPlace() 62 | { 63 | return $this->insertPlace; 64 | } 65 | 66 | /** 67 | * Sets the insertPlace 68 | * 69 | * @param int $insertPlace 70 | * @return void 71 | */ 72 | public function setInsertPlace($insertPlace): void 73 | { 74 | $this->insertPlace = $insertPlace; 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /Resources/Private/Templates/CookiePanel/Info.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

6 | 38 |
39 |
40 | 41 | -------------------------------------------------------------------------------- /Classes/Controller/CookieGroupController.php: -------------------------------------------------------------------------------- 1 | , Olli machts 13 | * 14 | ***/ 15 | /** 16 | * CookieGroupController 17 | */ 18 | class CookieGroupController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController 19 | { 20 | 21 | /** 22 | * cookieGroupRepository 23 | * 24 | * @var \OM\OmCookieManager\Domain\Repository\CookieGroupRepository 25 | */ 26 | protected $cookieGroupRepository = null; 27 | 28 | public function __construct(\OM\OmCookieManager\Domain\Repository\CookieGroupRepository $cookieGroupRepository) 29 | { 30 | $this->cookieGroupRepository = $cookieGroupRepository; 31 | } 32 | 33 | /** 34 | * action list 35 | * 36 | * @return void 37 | */ 38 | public function listAction(): \Psr\Http\Message\ResponseInterface 39 | { 40 | $cookieGroups = $this->cookieGroupRepository->findAll(); 41 | $this->view->assign('cookieGroups', $cookieGroups); 42 | return $this->htmlResponse(); 43 | } 44 | 45 | /** 46 | * action show 47 | * 48 | * @param \OM\OmCookieManager\Domain\Model\CookieGroup $cookieGroup 49 | * @return void 50 | */ 51 | public function showAction(\OM\OmCookieManager\Domain\Model\CookieGroup $cookieGroup): \Psr\Http\Message\ResponseInterface 52 | { 53 | $this->view->assign('cookieGroup', $cookieGroup); 54 | return $this->htmlResponse(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Resources/Public/Icons/code-signs.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Configuration/TypoScript/setup.typoscript: -------------------------------------------------------------------------------- 1 | 2 | plugin.tx_omcookiemanager_main { 3 | view { 4 | templateRootPaths.0 = EXT:om_cookie_manager/Resources/Private/Templates/ 5 | templateRootPaths.1 = {$plugin.tx_omcookiemanager_main.view.templateRootPath} 6 | partialRootPaths.0 = EXT:om_cookie_manager/Resources/Private/Partials/ 7 | partialRootPaths.1 = {$plugin.tx_omcookiemanager_main.view.partialRootPath} 8 | layoutRootPaths.0 = EXT:om_cookie_manager/Resources/Private/Layouts/ 9 | layoutRootPaths.1 = {$plugin.tx_omcookiemanager_main.view.layoutRootPath} 10 | } 11 | settings { 12 | css = {$plugin.tx_omcookiemanager_main.settings.cssFile} 13 | js = {$plugin.tx_omcookiemanager_main.settings.jsFile} 14 | googleConsentModeV2 = {$plugin.tx_omcookiemanager_main.settings.googleConsentModeV2} 15 | dontShowOnPids = {$plugin.tx_omcookiemanager_main.settings.dontShowOnPids} 16 | legalNoticePid = {$plugin.tx_omcookiemanager_main.settings.legalNoticePid} 17 | privacyPolicyPid = {$plugin.tx_omcookiemanager_main.settings.privacyPolicyPid} 18 | } 19 | persistence { 20 | storagePid = {$plugin.tx_omcookiemanager_main.persistence.storagePid} 21 | #recursive = 1 22 | } 23 | features { 24 | #skipDefaultArguments = 1 25 | # if set to 1, the enable fields are ignored in BE context 26 | ignoreAllEnableFieldsInBe = 0 27 | # Should be on by default, but can be disabled if all action in the plugin are uncached 28 | requireCHashArgumentForActionArguments = 1 29 | } 30 | mvc { 31 | #callDefaultActionIfActionCantBeResolved = 1 32 | } 33 | } 34 | plugin.tx_omcookiemanager_info < plugin.tx_omcookiemanager_main 35 | 36 | //add Extbase plugin to the default page 37 | page.1572349671 < tt_content.omcookiemanager_info.20 38 | -------------------------------------------------------------------------------- /ext_tables.sql: -------------------------------------------------------------------------------- 1 | # 2 | # Table structure for table 'tx_omcookiemanager_domain_model_cookie' 3 | # 4 | CREATE TABLE tx_omcookiemanager_domain_model_cookie ( 5 | cookiegroup int(11) unsigned DEFAULT '0' NOT NULL, 6 | 7 | name varchar(255) DEFAULT '' NOT NULL, 8 | description text, 9 | lifetime varchar(255) DEFAULT '' NOT NULL, 10 | provider varchar(255) DEFAULT '' NOT NULL, 11 | cookie_group int(11) unsigned DEFAULT '0', 12 | cookie_html int(11) unsigned DEFAULT '0', 13 | 14 | ); 15 | 16 | # 17 | # Table structure for table 'tx_omcookiemanager_domain_model_cookiegroup' 18 | # 19 | CREATE TABLE tx_omcookiemanager_domain_model_cookiegroup ( 20 | name varchar(255) DEFAULT '' NOT NULL, 21 | gtm_event_name varchar(255) DEFAULT '' NOT NULL, 22 | description text, 23 | essential smallint(5) unsigned DEFAULT '0' NOT NULL, 24 | cookies int(11) unsigned DEFAULT '0' NOT NULL, 25 | gtm_consent_grps varchar(1024) DEFAULT '' NOT NULL, 26 | ); 27 | 28 | # 29 | # Table structure for table 'tx_omcookiemanager_domain_model_cookiepanel' 30 | # 31 | CREATE TABLE tx_omcookiemanager_domain_model_cookiepanel ( 32 | name varchar(255) DEFAULT '' NOT NULL, 33 | description text, 34 | link varchar(255) DEFAULT '' NOT NULL, 35 | link_text varchar(255) DEFAULT '' NOT NULL, 36 | link_legal_notice varchar(255) DEFAULT '' NOT NULL, 37 | link_legal_notice_text varchar(255) DEFAULT '' NOT NULL, 38 | groups varchar(1024) DEFAULT '' NOT NULL, 39 | ); 40 | 41 | # 42 | # Table structure for table 'tx_omcookiemanager_domain_model_cookiehtml' 43 | # 44 | CREATE TABLE tx_omcookiemanager_domain_model_cookiehtml ( 45 | cookie int(11) unsigned DEFAULT '0' NOT NULL, 46 | html text, 47 | insert_place int(11) DEFAULT '0' NOT NULL, 48 | ); 49 | 50 | # 51 | # Table structure for table 'tx_omcookiemanager_domain_model_cookie' 52 | # 53 | CREATE TABLE tx_omcookiemanager_domain_model_cookie ( 54 | 55 | cookiegroup int(11) unsigned DEFAULT '0' NOT NULL 56 | 57 | ); 58 | -------------------------------------------------------------------------------- /Configuration/TypoScript/constants.typoscript: -------------------------------------------------------------------------------- 1 | # customcategory=om_cookie_manager=LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang.xlf:tx_omcookiemanager.be.constants.cat 2 | # customsubcategory=01_Persistence=Persistence 3 | # customsubcategory=02_View=View Templates 4 | # customsubcategory=03_Settings=Settings 5 | 6 | plugin.tx_omcookiemanager_main { 7 | view { 8 | # cat=om_cookie_manager/02_View/file; type=string; label=Path to template root (FE) 9 | templateRootPath = EXT:om_cookie_manager/Resources/Private/Templates/ 10 | # cat=om_cookie_manager/02_View/file; type=string; label=Path to template partials (FE) 11 | partialRootPath = EXT:om_cookie_manager/Resources/Private/Partials/ 12 | # cat=om_cookie_manager/02_View/file; type=string; label=Path to template layouts (FE) 13 | layoutRootPath = EXT:om_cookie_manager/Resources/Private/Layouts/ 14 | } 15 | settings{ 16 | # cat=om_cookie_manager/03_Settings/file; type=boolean; label=Include Google Consent Mode V2 Default values. (ad_storage,ad_user_data,ad_personalization,analytics_storage as denied) 17 | googleConsentModeV2 = 1 18 | # cat=om_cookie_manager/03_Settings/file; type=string; label=Main CSS File 19 | cssFile = EXT:om_cookie_manager/Resources/Public/Css/cookie_panel.css 20 | # cat=om_cookie_manager/03_Settings/file; type=string; label=Main JS File 21 | jsFile = EXT:om_cookie_manager/Resources/Public/Js/om_cookie_main.js 22 | # cat=om_cookie_manager/03_Settings/file; type=string; label=Comma separated pids where the panel don't show up automatically. Good for legal notice or privacy policy pages 23 | dontShowOnPids = 24 | # cat=om_cookie_manager/03_Settings/file; type=string; label=Pid legal notice page. When set is used for the link inside the Panel 25 | legalNoticePid = 26 | # cat=om_cookie_manager/03_Settings/file; type=string; label=Pid privacy policy page. When set is used for the link inside the Panel 27 | privacyPolicyPid = 28 | } 29 | persistence { 30 | # cat=om_cookie_manager/01_Persistence/a; type=string; label=Default storage PID 31 | storagePid = 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Resources/Public/Icons/Extension.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Resources/Public/Icons/cookie_panel_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Documentation/Index.rst: -------------------------------------------------------------------------------- 1 | .. --------------------------------------------------------------- 2 | This is the start file. It gets displayed as first page 3 | https://docs.typo3.org/m/typo3/docs-how-to-document/master/en-us/GeneralConventions/DirectoryFilenames.html#supported-filenames-and-formats 4 | --------------------------------------------------------------- 5 | 6 | .. --------------------------------------------------------------- 7 | More information about creating an extension manual: 8 | https://docs.typo3.org/m/typo3/docs-how-to-document/master/en-us/WritingDocForExtension/CreateWithExtensionBuilder.html 9 | --------------------------------------------------------------- 10 | 11 | .. --------------------------------------------------------------- 12 | comments start with 2 dots and a blank 13 | they can continue on the next line 14 | --------------------------------------------------------------- 15 | 16 | .. --------------------------------------------------------------- 17 | every .rst file should include Includes.txt 18 | use correct path! 19 | --------------------------------------------------------------- 20 | 21 | .. include:: Includes.txt 22 | 23 | .. --------------------------------------------------------------- 24 | Every manual should have a start label for cross-referencing to 25 | start page. Do not remove this! 26 | --------------------------------------------------------------- 27 | 28 | .. _start: 29 | 30 | .. --------------------------------------------------------------- 31 | This is the doctitle 32 | --------------------------------------------------------------- 33 | 34 | ============================================================= 35 | Om Cookie Manager 36 | ============================================================= 37 | 38 | :Extension Key: 39 | om_cookie_manager 40 | 41 | :Version: 42 | |release| 43 | 44 | :Language: 45 | en 46 | 47 | :Copyright: 48 | 2019 49 | 50 | :Author: 51 | Oliver Pfaff 52 | 53 | :Email: 54 | info@olli-machts.de 55 | 56 | :License: 57 | This extension documentation is published under the `CC BY-NC-SA 4.0 `__ (Creative Commons) license 58 | 59 | **TYPO3** 60 | 61 | The content of this document is related to TYPO3 CMS, 62 | a GNU/GPL CMS/Framework available from `typo3.org 63 | `_ . 64 | 65 | **Community Documentation:** 66 | 67 | This documentation is community documentation for the TYPO3 extension Om Cookie Manager 68 | 69 | It is maintained as part of this third party extension. 70 | 71 | ********************************* 72 | Documentation and Setup tutorial 73 | ********************************* 74 | You can find all what you need under:` `_ 75 | 76 | The changelog is written down in the readme. 77 | 78 | -------------------------------------------------------------------------------- /Resources/Private/Language/locallang.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | Privacy policy 8 | 9 | 10 | Legal notice 11 | 12 | 13 | Accept all 14 | 15 | 16 | Save and Close 17 | 18 | 19 | Accept only essential 20 | 21 | 22 | Cookie overview 23 | 24 | 25 | Name 26 | 27 | 28 | Descr. 29 | 30 | 31 | Lifetime 32 | 33 | 34 | Provider 35 | 36 | 37 | Group 38 | 39 | 40 | Open cookie settings 41 | 42 | 43 | OM Cookie Consent Manager 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Resources/Private/Templates/CookiePanel/Show.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | This is a TYPO3 Extension made by Oliver Pfaff from olli-machts.de . 2 | You will find a documentation under www.olli-machts.de/en/extension/cookie-manager and a small setup tutorial 3 | The Extension development and maintenance is sponsored by Nerdost GmbH (www.nerdost.net) 4 | 5 | - HTML/Script tag management 6 | - Grouping of different Cookies alias Script tags 7 | - Multi-domain ready 8 | - Multi-language ready 9 | - Out of the box english and german frontend redering 10 | - Cookie Information Table plugin 11 | - Optin Panel, which loads the scripts only after the optin confirmation 12 | - Google Tag Manager support. 13 | - Customizable, use your own CSS or change the Fluid templates 14 | - Custom javascript events that can be lised 15 | 16 | ## Changelog 17 | **9.1.0** 18 | - Composer support 19 | - New Group awareness. If the panel finds a new group(with a new ID) it will show up again. 20 | - Improved multilanguage support 21 | **9.2.0** 22 | - (Sponsored by Gesellschaft für Informatik - gi.de) TypoScript Constant processing inside the cookie HTML field(default:disabled). It must be enabled inside the Extension Settings after that you should clear the system cache. 23 | **9.2.1** 24 | - Bugfix shortening details_nr for writelog method (thx to bashte and Sebastian Richter) 25 | **10.0.0** 26 | - Add TYPO3 10 support 27 | - Improved remember abilities between languages. Know also if your groups are not linked (over the field Transl.Orig) inside the TYPO3 backend, the extension will remember all active groups and not show the panel on every language switch on the frontend side. 28 | **10.0.1** 29 | - BUGFIX if no css or js file is set in the TypoScript Constants no empty file will be added to the page. 30 | **10.0.2** 31 | - [BUGFIX] Fix failing TS constants replacement in HTML. Thanks, @maritwho(Sebastian Hofer) 32 | **11.0.0** 33 | - [TASK] TYPO3 11 compatibility (Thx Christoph Dolar) 34 | - [TASK] Improve default CSS for better OS and iOS experience 35 | **11.0.1** 36 | - [BUGFIX] W3C HTML Validation 37 | - [TASK] TYPO3 12 Compatibility preparation (Thx Sebastian Richter and DerBasti) 38 | **12.0.0** 39 | - [TASK] Establish TYPO3 12 compatibility for typoscript constants swap 40 | - [BUGFIX] PHP Warning: Undefined variable and fix extension scanner false positives 41 | - [TASK] TYPO3 12 compatibility 42 | **12.0.1** 43 | - [TASK] improve TYPO3 12 compatibility, remove obsolete configurations and replace outdated API calls (Thx Nikita) 44 | **12.1.0** 45 | - [FEATURE] add native support for google consent mode V2. More setup information can be found inside the docu on my site (development sponsored by web-crossing.com, nerdost.net and smaller donations) 46 | **12.1.1** 47 | - [Compatibility] improve TCA compatibility. Thanks to dbtisch-no for contribution 48 | - [Compatibility] improve compatibility with CSP. Thanks to Michael Grundkötter for contribution 49 | **13.0.0** 50 | - [TASK] TYPO3 13 compatibility. Thanks to Mohsin Kahn for the big contribution. 51 | **13.1.0** 52 | - [FEATURE] Allow to suppress popup of the panel for specific pids over typoscript constants setting. (Sponsored by Gesellschaft für Informatik - gi.de) 53 | - [FEATURE] Allow to set to specific links for legal notice and privacy policy inside the panel. Default Link targets can be set also over TypoScript constants settings (Sponsored by Gesellschaft für Informatik - gi.de) 54 | - [TASK] Change default color of "accept all" button for better contrast to match WACG requirements 4.5 55 | Icons used in the extension. Visible only in the backend. 56 | Icons made by Smashicons from www.flaticon.com 57 | Icons made by Freepik from www.flaticon.com 58 | Icons made by from www.flaticon.com 59 | -------------------------------------------------------------------------------- /Resources/Private/Language/de.locallang.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | Privacy policy 9 | Datenschutzerklärung 10 | 11 | 12 | Legal notice 13 | Impressum 14 | 15 | 16 | Accept all 17 | Alle akzeptieren 18 | 19 | 20 | Speichern und schließen 21 | Speichern und schließen 22 | 23 | 24 | Nur essentielle Cookies akzeptieren 25 | Nur essentielle Cookies akzeptieren 26 | 27 | 28 | Cookie overview 29 | Übersicht der verwendeten Cookies 30 | 31 | 32 | Name 33 | Name 34 | 35 | 36 | Descr. 37 | Beschr. 38 | 39 | 40 | Lifetime 41 | Speicherdauer 42 | 43 | 44 | Provider 45 | Provider 46 | 47 | 48 | Group 49 | Gruppe 50 | 51 | 52 | Open cookie settings 53 | Cookie-Einstellungen öffnen 54 | 55 | 56 | OM Cookie Consent Manager 57 | OM Cookie Consent Manager 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Classes/Utility/JsBuilder.php: -------------------------------------------------------------------------------- 1 | , Olli machts 10 | * 11 | ***/ 12 | 13 | namespace OM\OmCookieManager\Utility; 14 | 15 | 16 | use OM\OmCookieManager\Domain\Model\Cookie; 17 | use OM\OmCookieManager\Domain\Model\CookieGroup; 18 | use OM\OmCookieManager\Domain\Model\CookieHtml; 19 | use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; 20 | use TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionInterface; 21 | use TYPO3\CMS\Extbase\Mvc\RequestInterface; 22 | 23 | class JsBuilder 24 | { 25 | private static $flatSetup = []; 26 | 27 | /** 28 | * @param $groups array|QueryRestrictionInterface 29 | */ 30 | public static function buildCompleteGrpJson($groups, RequestInterface $request) 31 | { 32 | $grpArray = []; 33 | $fetchTsConstants = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('om_cookie_manager', 'injectTsConstants'); 34 | if((int)$fetchTsConstants === 1){ 35 | /** @var \TYPO3\CMS\Core\TypoScript\FrontendTypoScript $typoscript */ 36 | $typoscript = $request->getAttribute('frontend.typoscript'); 37 | self::$flatSetup = $typoscript->getFlatSettings(); 38 | } 39 | /** @var CookieGroup $group */ 40 | foreach ($groups as $group){ 41 | if(false === empty($group->getGtmConsentGrps())){ 42 | $grpArray['group-' . $group->getUid()]['gtmConsentMode'] = $group->getGtmConsentGrps(); 43 | } 44 | if(false === empty($group->getGtmEventName())){ 45 | $grpArray['group-' . $group->getUid()]['gtm'] = $group->getGtmEventName(); 46 | } 47 | if (is_object($group->getCookies()) || $group->getCookies()->count() > 0){ 48 | /** @var Cookie $cookie */ 49 | foreach ($group->getCookies() as $cookie){ 50 | if (is_object($cookie->getCookieHtml()) || $cookie->getCookieHtml()->count() > 0){ 51 | /** @var CookieHtml $html */ 52 | foreach ($cookie->getCookieHtml() as $html){ 53 | $cookieHtmlCode = $html->getHtml(); 54 | if((int)$fetchTsConstants === 1){ 55 | $cookieHtmlCode = self::substituteConstants($html->getHtml()); 56 | } 57 | $grpArray['group-' . $group->getUid()]['cookie-'.$cookie->getUid()][$html->getInsertPlace() === 0 ? 'header' : 'body'][] = $cookieHtmlCode; 58 | } 59 | } 60 | } 61 | } 62 | } 63 | return json_encode($grpArray); 64 | } 65 | 66 | /** 67 | * @param $subject 68 | * 69 | * @return string 70 | */ 71 | private static function substituteConstants($subject) 72 | { 73 | $noChange = false; 74 | for ($i = 0; $i < 10 && !$noChange; $i++) { 75 | $oldSubject = $subject; 76 | $subject = preg_replace_callback('/\\{\\$(.[^}]*)\\}/', function ($matches) { 77 | $flatSetup = JsBuilder::$flatSetup; 78 | // Replace {$CONST} if found in $this->flatSetup, else leave unchanged 79 | return isset($flatSetup[$matches[1]]) && !is_array($flatSetup[$matches[1]]) ? $flatSetup[$matches[1]] : $matches[0]; 80 | }, $subject); 81 | if ($oldSubject == $subject) { 82 | $noChange = true; 83 | } 84 | } 85 | return $subject; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Resources/Public/Css/cookie_panel.less: -------------------------------------------------------------------------------- 1 | [data-omcookie-panel-show]{ 2 | cursor: pointer; 3 | } 4 | 5 | .om-cookie-panel{ 6 | padding: 25px; 7 | z-index: 9999; 8 | background: #fff; 9 | position: fixed; 10 | bottom: 0; 11 | width: 100%; 12 | left: 0; 13 | opacity: 0; 14 | box-sizing: border-box; 15 | border-top: 1px solid #666; 16 | font-size: 16px; 17 | transform: translateY(100%) translateX(0); 18 | transition: transform 0.5s ease, opacity 0.3s; 19 | text-align: center; 20 | @media (min-width: 1024px){ 21 | width: 50vw; 22 | left: 50%; 23 | transform: translateY(100%) translateX(-50%); 24 | border-left: 1px solid #666; 25 | border-right: 1px solid #666; 26 | } 27 | &.active{ 28 | transform: translateY(0) translateX(0); 29 | opacity: 1; 30 | @media (min-width: 1024px){ 31 | transform: translateY(0) translateX(-50%); 32 | } 33 | } 34 | 35 | h3{ 36 | margin: 0; 37 | padding: 0 0 1em; 38 | text-align: left; 39 | } 40 | p{ 41 | margin: 0; 42 | padding: 1em 0; 43 | } 44 | 45 | .cookie-panel__checkbox { 46 | display:none; 47 | } 48 | .cookie-panel__checkbox + label{ 49 | cursor: pointer; 50 | line-height: 1.1; 51 | font-weight: 400; 52 | display: block; 53 | } 54 | .cookie-panel__checkbox + label::before { 55 | width: 15px; 56 | height: 15px; 57 | border-radius: 5px; 58 | border: 2px solid #618105; 59 | background-color: #fff; 60 | display: block; 61 | content: ""; 62 | float: left; 63 | margin-right: 5px; 64 | } 65 | .cookie-panel__checkbox:checked+label::before { 66 | box-shadow: inset 0 0 0 3px #fff; 67 | background-color: #618105; 68 | } 69 | .cookie-panel__checkbox--state-inactiv + label::before{ 70 | border-color:#666; 71 | } 72 | .cookie-panel__checkbox--state-inactiv:checked+label::before{ 73 | background-color:#666; 74 | } 75 | .cookie-panel__checkbox-wrap{ 76 | display:inline-block; 77 | line-height: 1.1; 78 | + .cookie-panel__checkbox-wrap{ 79 | margin-left:15px; 80 | } 81 | } 82 | .cookie-panel__description{ 83 | clear:both; 84 | } 85 | 86 | .cookie-panel__link{ 87 | padding-top: 1em; 88 | } 89 | .cookie-panel__button{ 90 | background: #666; 91 | color: #fff; 92 | padding: 5px 10px; 93 | border:none; 94 | border-radius: 5px; 95 | display: block; 96 | width: 100%; 97 | cursor: pointer; 98 | font-size: 1.1em; 99 | text-transform: uppercase; 100 | + .cookie-panel__button{ 101 | margin-top: 15px; 102 | } 103 | @media (min-width: 1024px){ 104 | width: auto; 105 | display: inline-block; 106 | + .cookie-panel__button{ 107 | margin-top: 0; 108 | } 109 | } 110 | } 111 | .cookie-panel__links{ 112 | display: flex; 113 | margin: 1em -.5em 0; 114 | a { 115 | color: #666; 116 | } 117 | > .cookie-panel__link{ 118 | padding: 0 .5em; 119 | } 120 | } 121 | .cookie-panel__button--color--green{ 122 | background-color: #618105; 123 | } 124 | .cookie-panel__attribution{ 125 | position: absolute; 126 | bottom: 5px; 127 | right: 25px; 128 | font-size: 9px; 129 | font-style: italic; 130 | text-align: center; 131 | a{ 132 | color: inherit; 133 | text-decoration: none; 134 | } 135 | } 136 | } 137 | 138 | .om-cookie-info{ 139 | table{ 140 | border: 1px solid black; 141 | border-collapse: collapse; 142 | th,td{ 143 | padding: 10px 5px; 144 | border: 1px solid black; 145 | } 146 | p{ 147 | margin-top: 0; 148 | } 149 | p:last-child{ 150 | margin-bottom: 0; 151 | padding-bottom: 0; 152 | } 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /Configuration/TCA/Overrides/tx_omcookiemanager_domain_model_general.php: -------------------------------------------------------------------------------- 1 | [ 14 | 'exclude' => true, 15 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_groups', 16 | 'description' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_groups.description', 17 | 'config' => [ 18 | 'type' => 'select', 19 | 'maxitems' => 99, 20 | 'renderType' => 'selectMultipleSideBySide', 21 | 'items' => $versionInformation->getMajorVersion() < 12 ? [ 22 | [ 23 | 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_groups.ad_storage', 'ad_storage' 24 | ], 25 | [ 26 | 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_groups.ad_user_data', 'ad_user_data' 27 | ], 28 | [ 29 | 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_groups.ad_personalization', 'ad_personalization', 30 | ], 31 | [ 32 | 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_groups.analytics_storage', 'analytics_storage', 33 | ], 34 | ] : [ 35 | [ 36 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_groups.ad_storage', 37 | 'value' => 'ad_storage', 38 | ], 39 | [ 40 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_groups.ad_user_data', 41 | 'value' => 'ad_user_data', 42 | ], 43 | [ 44 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_groups.ad_personalization', 45 | 'value' => 'ad_personalization', 46 | ], 47 | [ 48 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_groups.analytics_storage', 49 | 'value' => 'analytics_storage', 50 | ], 51 | ], 52 | ], 53 | ], 54 | ] 55 | ); 56 | }; 57 | $boot(); 58 | unset($boot); 59 | -------------------------------------------------------------------------------- /Classes/Domain/Model/CookiePanel.php: -------------------------------------------------------------------------------- 1 | , Olli machts 13 | * 14 | ***/ 15 | /** 16 | * CookiePanel 17 | */ 18 | class CookiePanel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity 19 | { 20 | 21 | /** 22 | * name 23 | * 24 | * @var string 25 | */ 26 | #[TYPO3\CMS\Extbase\Annotation\Validate(['validator' => 'NotEmpty'])] 27 | protected $name = ''; 28 | 29 | /** 30 | * description 31 | * 32 | * @var string 33 | */ 34 | protected $description = ''; 35 | 36 | /** 37 | * Link to cookie policy 38 | * 39 | * @var string 40 | */ 41 | protected $link = ''; 42 | 43 | /** 44 | * Link text to cookie policy 45 | * 46 | * @var string 47 | */ 48 | protected $linkText = ''; 49 | 50 | /** 51 | * Link to legal notice 52 | * 53 | * @var string 54 | */ 55 | protected $linkLegalNotice = ''; 56 | 57 | /** 58 | * Link Text for legal notice 59 | * 60 | * @var string 61 | */ 62 | protected $linkLegalNoticeText = ''; 63 | 64 | /** 65 | * groups 66 | * 67 | * @var string 68 | */ 69 | protected $groups = ''; 70 | 71 | 72 | 73 | /** 74 | * Returns the name 75 | * 76 | * @return string $name 77 | */ 78 | public function getName() 79 | { 80 | return $this->name; 81 | } 82 | 83 | /** 84 | * Sets the name 85 | * 86 | * @param string $name 87 | * @return void 88 | */ 89 | public function setName($name): void 90 | { 91 | $this->name = $name; 92 | } 93 | 94 | /** 95 | * Returns the description 96 | * 97 | * @return string $description 98 | */ 99 | public function getDescription() 100 | { 101 | return $this->description; 102 | } 103 | 104 | /** 105 | * Sets the description 106 | * 107 | * @param string $description 108 | * @return void 109 | */ 110 | public function setDescription($description): void 111 | { 112 | $this->description = $description; 113 | } 114 | 115 | /** 116 | * Returns the link 117 | * 118 | * @return string $link 119 | */ 120 | public function getLink() 121 | { 122 | return $this->link; 123 | } 124 | 125 | /** 126 | * Sets the link 127 | * 128 | * @param string $link 129 | * @return void 130 | */ 131 | public function setLink($link): void 132 | { 133 | $this->link = $link; 134 | } 135 | 136 | /** 137 | * @return string 138 | */ 139 | public function getGroups() 140 | { 141 | return $this->groups; 142 | } 143 | 144 | /** 145 | * @param string $groups 146 | */ 147 | public function setGroups($groups): void 148 | { 149 | $this->groups = $groups; 150 | } 151 | 152 | public function getLinkText(): string 153 | { 154 | return $this->linkText; 155 | } 156 | 157 | public function setLinkText(string $linkText): void 158 | { 159 | $this->linkText = $linkText; 160 | } 161 | 162 | public function getLinkLegalNotice(): string 163 | { 164 | return $this->linkLegalNotice; 165 | } 166 | 167 | public function setLinkLegalNotice(string $linkLegalNotice): void 168 | { 169 | $this->linkLegalNotice = $linkLegalNotice; 170 | } 171 | 172 | public function getLinkLegalNoticeText(): string 173 | { 174 | return $this->linkLegalNoticeText; 175 | } 176 | 177 | public function setLinkLegalNoticeText(string $linkLegalNoticeText): void 178 | { 179 | $this->linkLegalNoticeText = $linkLegalNoticeText; 180 | } 181 | 182 | } 183 | -------------------------------------------------------------------------------- /Resources/Public/Css/cookie_panel.css: -------------------------------------------------------------------------------- 1 | [data-omcookie-panel-show] { 2 | cursor: pointer; 3 | } 4 | .om-cookie-panel { 5 | padding: 25px; 6 | z-index: 9999; 7 | background: #fff; 8 | position: fixed; 9 | bottom: 0; 10 | width: 100%; 11 | left: 0; 12 | opacity: 0; 13 | box-sizing: border-box; 14 | border-top: 1px solid #666; 15 | font-size: 16px; 16 | transform: translateY(100%) translateX(0); 17 | transition: transform 0.5s ease, opacity 0.3s; 18 | text-align: center; 19 | } 20 | @media (min-width: 1024px) { 21 | .om-cookie-panel { 22 | width: 50vw; 23 | left: 50%; 24 | transform: translateY(100%) translateX(-50%); 25 | border-left: 1px solid #666; 26 | border-right: 1px solid #666; 27 | } 28 | } 29 | .om-cookie-panel.active { 30 | transform: translateY(0) translateX(0); 31 | opacity: 1; 32 | } 33 | @media (min-width: 1024px) { 34 | .om-cookie-panel.active { 35 | transform: translateY(0) translateX(-50%); 36 | } 37 | } 38 | .om-cookie-panel h3 { 39 | margin: 0; 40 | padding: 0 0 1em; 41 | text-align: left; 42 | } 43 | .om-cookie-panel p { 44 | margin: 0; 45 | padding: 1em 0; 46 | } 47 | .om-cookie-panel .cookie-panel__checkbox { 48 | display: none; 49 | } 50 | .om-cookie-panel .cookie-panel__checkbox + label { 51 | cursor: pointer; 52 | line-height: 1.1; 53 | font-weight: 400; 54 | display: block; 55 | } 56 | .om-cookie-panel .cookie-panel__checkbox + label::before { 57 | width: 15px; 58 | height: 15px; 59 | border-radius: 5px; 60 | border: 2px solid #618105; 61 | background-color: #fff; 62 | display: block; 63 | content: ""; 64 | float: left; 65 | margin-right: 5px; 66 | } 67 | .om-cookie-panel .cookie-panel__checkbox:checked + label::before { 68 | box-shadow: inset 0 0 0 3px #fff; 69 | background-color: #618105; 70 | } 71 | .om-cookie-panel .cookie-panel__checkbox--state-inactiv + label::before { 72 | border-color: #666; 73 | } 74 | .om-cookie-panel .cookie-panel__checkbox--state-inactiv:checked + label::before { 75 | background-color: #666; 76 | } 77 | .om-cookie-panel .cookie-panel__checkbox-wrap { 78 | display: inline-block; 79 | line-height: 1.1; 80 | } 81 | .om-cookie-panel .cookie-panel__checkbox-wrap + .cookie-panel__checkbox-wrap { 82 | margin-left: 15px; 83 | } 84 | .om-cookie-panel .cookie-panel__description { 85 | clear: both; 86 | } 87 | .om-cookie-panel .cookie-panel__link { 88 | padding-top: 1em; 89 | } 90 | .om-cookie-panel .cookie-panel__button { 91 | background: #666; 92 | color: #fff; 93 | padding: 5px 10px; 94 | border: none; 95 | border-radius: 5px; 96 | display: block; 97 | width: 100%; 98 | cursor: pointer; 99 | font-size: 1.1em; 100 | text-transform: uppercase; 101 | } 102 | .om-cookie-panel .cookie-panel__button + .cookie-panel__button { 103 | margin-top: 15px; 104 | } 105 | @media (min-width: 1024px) { 106 | .om-cookie-panel .cookie-panel__button { 107 | width: auto; 108 | display: inline-block; 109 | } 110 | .om-cookie-panel .cookie-panel__button + .cookie-panel__button { 111 | margin-top: 0; 112 | } 113 | } 114 | .om-cookie-panel .cookie-panel__links { 115 | display: flex; 116 | margin: 1em -0.5em 0; 117 | } 118 | .om-cookie-panel .cookie-panel__links a { 119 | color: #666; 120 | } 121 | .om-cookie-panel .cookie-panel__links > .cookie-panel__link { 122 | padding: 0 .5em; 123 | } 124 | .om-cookie-panel .cookie-panel__button--color--green { 125 | background-color: #618105; 126 | } 127 | .om-cookie-panel .cookie-panel__attribution { 128 | position: absolute; 129 | bottom: 5px; 130 | right: 25px; 131 | font-size: 9px; 132 | font-style: italic; 133 | text-align: center; 134 | } 135 | .om-cookie-panel .cookie-panel__attribution a { 136 | color: inherit; 137 | text-decoration: none; 138 | } 139 | .om-cookie-info table { 140 | border: 1px solid black; 141 | border-collapse: collapse; 142 | } 143 | .om-cookie-info table th, 144 | .om-cookie-info table td { 145 | padding: 10px 5px; 146 | border: 1px solid black; 147 | } 148 | .om-cookie-info table p { 149 | margin-top: 0; 150 | } 151 | .om-cookie-info table p:last-child { 152 | margin-bottom: 0; 153 | padding-bottom: 0; 154 | } 155 | /*# sourceMappingURL=cookie_panel.css.map */ -------------------------------------------------------------------------------- /Documentation/Settings.cfg: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # ##### 4 | # 5 | # Settings.cfg - A TYPO3 Documentation Project's Configuration File 6 | # Information about Settings.cfg: 7 | # https://docs.typo3.org/typo3cms/HowToDocument/GeneralConventions/DirectoryFilenames.html#settings-cfg 8 | # 9 | # About Syntax: 10 | # See https://docs.python.org/2/library/configparser.html 11 | # 12 | # Attention: 13 | # Only " ;" can start an inline comment. 14 | # This is: blank PLUS semicolon! 15 | # 16 | # ##### 17 | 18 | [general] 19 | 20 | # ................................................................................. 21 | # ... (required) title (displayed in left sidebar (desktop) or top panel (mobile) 22 | # ................................................................................. 23 | 24 | project = OM Cookie Manager 25 | 26 | # ................................................................................. 27 | # ... (recommended) version, displayed next to title (desktop) and in [ 4 | 'title' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiehtml', 5 | 'label' => 'html', 6 | 'tstamp' => 'tstamp', 7 | 'crdate' => 'crdate', 8 | 'versioningWS' => true, 9 | 'languageField' => 'sys_language_uid', 10 | 'transOrigPointerField' => 'l10n_parent', 11 | 'transOrigDiffSourceField' => 'l10n_diffsource', 12 | 'delete' => 'deleted', 13 | 'enablecolumns' => [ 14 | 'disabled' => 'hidden', 15 | 'starttime' => 'starttime', 16 | 'endtime' => 'endtime', 17 | ], 18 | 'searchFields' => 'html', 19 | 'iconfile' => 'EXT:om_cookie_manager/Resources/Public/Icons/code-signs.svg' 20 | ], 21 | 'types' => [ 22 | '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, html, insert_place'], 23 | ], 24 | 'columns' => [ 25 | 'sys_language_uid' => [ 26 | 'exclude' => true, 27 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', 28 | 'config' => [ 29 | 'type' => 'language' 30 | ], 31 | ], 32 | 'l10n_parent' => [ 33 | 'displayCond' => 'FIELD:sys_language_uid:>:0', 34 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', 35 | 'config' => [ 36 | 'type' => 'select', 37 | 'renderType' => 'selectSingle', 38 | 'default' => 0, 39 | 'items' => [ 40 | ['label' => '', 'value' => 0], 41 | ], 42 | 'foreign_table' => 'tx_omcookiemanager_domain_model_cookiehtml', 43 | 'foreign_table_where' => 'AND {#tx_omcookiemanager_domain_model_cookiehtml}.{#pid}=###CURRENT_PID### AND {#tx_omcookiemanager_domain_model_cookiehtml}.{#sys_language_uid} IN (-1,0)', 44 | ], 45 | ], 46 | 'l10n_diffsource' => [ 47 | 'config' => [ 48 | 'type' => 'passthrough', 49 | ], 50 | ], 51 | 't3ver_label' => [ 52 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel', 53 | 'config' => [ 54 | 'type' => 'input', 55 | 'size' => 30, 56 | 'max' => 255, 57 | ], 58 | ], 59 | 'hidden' => [ 60 | 'exclude' => true, 61 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', 62 | 'config' => [ 63 | 'type' => 'check', 64 | 'renderType' => 'checkboxToggle', 65 | 'items' => [ 66 | [ 67 | 'label' => '', 68 | 'invertStateDisplay' => true 69 | ] 70 | ], 71 | ], 72 | ], 73 | 'starttime' => [ 74 | 'exclude' => true, 75 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 76 | 'config' => [ 77 | 'type' => 'datetime', 78 | 'default' => 0, 79 | 'behaviour' => [ 80 | 'allowLanguageSynchronization' => true 81 | ] 82 | ], 83 | ], 84 | 'endtime' => [ 85 | 'exclude' => true, 86 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 87 | 'config' => [ 88 | 'type' => 'datetime', 89 | 'default' => 0, 90 | 'range' => [ 91 | 'upper' => mktime(0, 0, 0, 1, 1, 2038) 92 | ], 93 | 'behaviour' => [ 94 | 'allowLanguageSynchronization' => true 95 | ] 96 | ], 97 | ], 98 | 99 | 'html' => [ 100 | 'exclude' => true, 101 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiehtml.html', 102 | 'config' => [ 103 | 'type' => 'text', 104 | 'renderType' => 't3editor', 105 | 'format' => 'html', 106 | 'eval' => 'trim' 107 | ] 108 | ], 109 | 'insert_place' => [ 110 | 'exclude' => true, 111 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiehtml.insert_place', 112 | 'config' => [ 113 | 'type' => 'select', 114 | 'renderType' => 'selectSingle', 115 | 'items' => [ 116 | ['label' => 'Header', 'value' => 0], 117 | ['label' => 'Body', 'value' => 1], 118 | ], 119 | 'size' => 1, 120 | 'maxitems' => 1, 121 | 'eval' => '' 122 | ], 123 | ], 124 | 'cookie' => [ 125 | 'config' => [ 126 | 'type' => 'passthrough', 127 | ], 128 | ], 129 | 130 | ], 131 | ]; 132 | -------------------------------------------------------------------------------- /Classes/Domain/Model/CookieGroup.php: -------------------------------------------------------------------------------- 1 | , Olli machts 13 | * 14 | ***/ 15 | /** 16 | * CookieGroup 17 | */ 18 | class CookieGroup extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity 19 | { 20 | 21 | /** 22 | * name 23 | * 24 | * @var string 25 | */ 26 | #[TYPO3\CMS\Extbase\Annotation\Validate(['validator' => 'NotEmpty'])] 27 | protected $name = ''; 28 | 29 | /** 30 | * description 31 | * 32 | * @var string 33 | */ 34 | protected $description = ''; 35 | 36 | /** 37 | * gtm event name 38 | * 39 | * @var string 40 | */ 41 | protected $gtmEventName = ''; 42 | 43 | /** 44 | * gtm consent mode groups 45 | * 46 | * @var string 47 | */ 48 | protected $gtmConsentGrps = ''; 49 | 50 | /** 51 | * essential 52 | * 53 | * @var bool 54 | */ 55 | protected $essential = false; 56 | 57 | /** 58 | * cookies 59 | * 60 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OM\OmCookieManager\Domain\Model\Cookie> 61 | */ 62 | #[TYPO3\CMS\Extbase\Annotation\ORM\Cascade(['value' => 'remove'])] 63 | protected $cookies = null; 64 | 65 | /** 66 | * __construct 67 | */ 68 | public function __construct() 69 | { 70 | 71 | //Do not remove the next line: It would break the functionality 72 | $this->initStorageObjects(); 73 | } 74 | 75 | /** 76 | * Initializes all ObjectStorage properties 77 | * Do not modify this method! 78 | * It will be rewritten on each save in the extension builder 79 | * You may modify the constructor of this class instead 80 | * 81 | * @return void 82 | */ 83 | protected function initStorageObjects() 84 | { 85 | $this->cookies = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); 86 | } 87 | 88 | /** 89 | * Returns the name 90 | * 91 | * @return string $name 92 | */ 93 | public function getName() 94 | { 95 | return $this->name; 96 | } 97 | 98 | /** 99 | * Sets the name 100 | * 101 | * @param string $name 102 | * @return void 103 | */ 104 | public function setName($name): void 105 | { 106 | $this->name = $name; 107 | } 108 | 109 | /** 110 | * Returns the description 111 | * 112 | * @return string $description 113 | */ 114 | public function getDescription() 115 | { 116 | return $this->description; 117 | } 118 | 119 | /** 120 | * Sets the description 121 | * 122 | * @param string $description 123 | * @return void 124 | */ 125 | public function setDescription($description): void 126 | { 127 | $this->description = $description; 128 | } 129 | 130 | /** 131 | * Returns the essential 132 | * 133 | * @return bool $essential 134 | */ 135 | public function getEssential() 136 | { 137 | return $this->essential; 138 | } 139 | 140 | /** 141 | * Sets the essential 142 | * 143 | * @param bool $essential 144 | * @return void 145 | */ 146 | public function setEssential($essential): void 147 | { 148 | $this->essential = $essential; 149 | } 150 | 151 | /** 152 | * Returns the boolean state of essential 153 | * 154 | * @return bool 155 | */ 156 | public function isEssential() 157 | { 158 | return $this->essential; 159 | } 160 | 161 | /** 162 | * Adds a Cookie 163 | * 164 | * @param \OM\OmCookieManager\Domain\Model\Cookie $cooky 165 | * @return void 166 | */ 167 | public function addCooky(\OM\OmCookieManager\Domain\Model\Cookie $cooky): void 168 | { 169 | $this->cookies->attach($cooky); 170 | } 171 | 172 | /** 173 | * Removes a Cookie 174 | * 175 | * @param \OM\OmCookieManager\Domain\Model\Cookie $cookyToRemove The Cookie to be removed 176 | * @return void 177 | */ 178 | public function removeCooky(\OM\OmCookieManager\Domain\Model\Cookie $cookyToRemove): void 179 | { 180 | $this->cookies->detach($cookyToRemove); 181 | } 182 | 183 | /** 184 | * Returns the cookies 185 | * 186 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OM\OmCookieManager\Domain\Model\Cookie> $cookies 187 | */ 188 | public function getCookies() 189 | { 190 | return $this->cookies; 191 | } 192 | 193 | /** 194 | * Sets the cookies 195 | * 196 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OM\OmCookieManager\Domain\Model\Cookie> $cookies 197 | * @return void 198 | */ 199 | public function setCookies(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $cookies): void 200 | { 201 | $this->cookies = $cookies; 202 | } 203 | 204 | /** 205 | * @return string 206 | */ 207 | public function getGtmEventName() 208 | { 209 | return $this->gtmEventName; 210 | } 211 | 212 | /** 213 | * @param string $gtmEventName 214 | */ 215 | public function setGtmEventName(string $gtmEventName): void 216 | { 217 | $this->gtmEventName = $gtmEventName; 218 | } 219 | 220 | /** 221 | * @return string 222 | */ 223 | public function getGtmConsentGrps(): string 224 | { 225 | return $this->gtmConsentGrps; 226 | } 227 | 228 | /** 229 | * @param string $gtmConsentGrps 230 | */ 231 | public function setGtmConsentGrps(string $gtmConsentGrps): void 232 | { 233 | $this->gtmConsentGrps = $gtmConsentGrps; 234 | } 235 | } 236 | -------------------------------------------------------------------------------- /Classes/Domain/Model/Cookie.php: -------------------------------------------------------------------------------- 1 | , Olli machts 13 | * 14 | ***/ 15 | /** 16 | * Cookie 17 | */ 18 | class Cookie extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity 19 | { 20 | 21 | /** 22 | * name 23 | * 24 | * @var string 25 | */ 26 | #[TYPO3\CMS\Extbase\Annotation\Validate(['validator' => 'NotEmpty'])] 27 | protected $name = ''; 28 | 29 | /** 30 | * description 31 | * 32 | * @var string 33 | */ 34 | protected $description = ''; 35 | 36 | /** 37 | * lifetime 38 | * 39 | * @var string 40 | */ 41 | protected $lifetime = ''; 42 | 43 | /** 44 | * provider 45 | * 46 | * @var string 47 | */ 48 | protected $provider = ''; 49 | 50 | /** 51 | * cookieGroup 52 | * 53 | * @var \OM\OmCookieManager\Domain\Model\CookieGroup 54 | */ 55 | protected $cookieGroup = null; 56 | 57 | /** 58 | * cookieHtml 59 | * 60 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OM\OmCookieManager\Domain\Model\CookieHtml> 61 | */ 62 | #[TYPO3\CMS\Extbase\Annotation\ORM\Cascade(['value' => 'remove'])] 63 | protected $cookieHtml = null; 64 | 65 | /** 66 | * __construct 67 | */ 68 | public function __construct() 69 | { 70 | 71 | //Do not remove the next line: It would break the functionality 72 | $this->initStorageObjects(); 73 | } 74 | 75 | /** 76 | * Initializes all ObjectStorage properties 77 | * Do not modify this method! 78 | * It will be rewritten on each save in the extension builder 79 | * You may modify the constructor of this class instead 80 | * 81 | * @return void 82 | */ 83 | protected function initStorageObjects() 84 | { 85 | $this->cookieHtml = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); 86 | } 87 | 88 | /** 89 | * Adds a CookieHtml 90 | * 91 | * @param \OM\OmCookieManager\Domain\Model\CookieHtml $cookieHtml 92 | * @return void 93 | */ 94 | public function addCookieHtml(\OM\OmCookieManager\Domain\Model\CookieHtml $cookieHtml): void 95 | { 96 | $this->cookieHtml->attach($cookieHtml); 97 | } 98 | 99 | /** 100 | * Removes a CookieHtml 101 | * 102 | * @param \OM\OmCookieManager\Domain\Model\CookieHtml $cookieHtmlToRemove The CookieHtml to be removed 103 | * @return void 104 | */ 105 | public function removeCookieHtml(\OM\OmCookieManager\Domain\Model\CookieHtml $cookieHtmlToRemove): void 106 | { 107 | $this->cookieHtml->detach($cookieHtmlToRemove); 108 | } 109 | 110 | /** 111 | * Returns the cookieHtml 112 | * 113 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OM\OmCookieManager\Domain\Model\CookieHtml> $cookieHtml 114 | */ 115 | public function getCookieHtml() 116 | { 117 | return $this->cookieHtml; 118 | } 119 | 120 | /** 121 | * Sets the cookieHtml 122 | * 123 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OM\OmCookieManager\Domain\Model\CookieHtml> $cookieHtml 124 | * @return void 125 | */ 126 | public function setCookieHtml(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $cookieHtml): void 127 | { 128 | $this->cookieHtml = $cookieHtml; 129 | } 130 | 131 | /** 132 | * Returns the name 133 | * 134 | * @return string $name 135 | */ 136 | public function getName() 137 | { 138 | return $this->name; 139 | } 140 | 141 | /** 142 | * Sets the name 143 | * 144 | * @param string $name 145 | * @return void 146 | */ 147 | public function setName($name): void 148 | { 149 | $this->name = $name; 150 | } 151 | 152 | /** 153 | * Returns the description 154 | * 155 | * @return string $description 156 | */ 157 | public function getDescription() 158 | { 159 | return $this->description; 160 | } 161 | 162 | /** 163 | * Sets the description 164 | * 165 | * @param string $description 166 | * @return void 167 | */ 168 | public function setDescription($description): void 169 | { 170 | $this->description = $description; 171 | } 172 | 173 | /** 174 | * Returns the provider 175 | * 176 | * @return string $provider 177 | */ 178 | public function getProvider() 179 | { 180 | return $this->provider; 181 | } 182 | 183 | /** 184 | * Sets the provider 185 | * 186 | * @param string $provider 187 | * @return void 188 | */ 189 | public function setProvider($provider): void 190 | { 191 | $this->provider = $provider; 192 | } 193 | 194 | /** 195 | * Returns the cookieGroup 196 | * 197 | * @return \OM\OmCookieManager\Domain\Model\CookieGroup $cookieGroup 198 | */ 199 | public function getCookieGroup() 200 | { 201 | return $this->cookieGroup; 202 | } 203 | 204 | /** 205 | * Sets the cookieGroup 206 | * 207 | * @param \OM\OmCookieManager\Domain\Model\CookieGroup $cookieGroup 208 | * @return void 209 | */ 210 | public function setCookieGroup(\OM\OmCookieManager\Domain\Model\CookieGroup $cookieGroup): void 211 | { 212 | $this->cookieGroup = $cookieGroup; 213 | } 214 | 215 | 216 | /** 217 | * lifetime 218 | * 219 | * @return string 220 | */ 221 | public function getLifetime() { 222 | // @extensionScannerIgnoreLine 223 | return $this->lifetime; 224 | } 225 | 226 | /** 227 | * lifetime 228 | * 229 | * @param string $lifetime lifetime 230 | * @return self 231 | */ 232 | public function setLifetime($lifetime): self { 233 | // @extensionScannerIgnoreLine 234 | $this->lifetime = $lifetime; 235 | return $this; 236 | } 237 | } 238 | -------------------------------------------------------------------------------- /Classes/Controller/CookiePanelController.php: -------------------------------------------------------------------------------- 1 | , Olli machts 20 | * 21 | ***/ 22 | /** 23 | * CookiePanelController 24 | */ 25 | class CookiePanelController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController 26 | { 27 | 28 | /** 29 | * cookiePanelRepository 30 | * 31 | * @var \OM\OmCookieManager\Domain\Repository\CookiePanelRepository 32 | */ 33 | protected $cookiePanelRepository = null; 34 | 35 | public function __construct(\OM\OmCookieManager\Domain\Repository\CookiePanelRepository $cookiePanelRepository, \OM\OmCookieManager\Domain\Repository\CookieGroupRepository $cookieGroupRepository) 36 | { 37 | $this->cookiePanelRepository = $cookiePanelRepository; 38 | $this->cookieGroupRepository = $cookieGroupRepository; 39 | } 40 | 41 | /** 42 | * cookieGroupRepository 43 | * 44 | * @var \OM\OmCookieManager\Domain\Repository\CookieGroupRepository 45 | */ 46 | protected $cookieGroupRepository = null; 47 | 48 | public function initializeShowAction(): void 49 | { 50 | /** @var PageRenderer $pageRenderer */ 51 | $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); 52 | if(empty($this->settings['googleConsentModeV2']) === false) { 53 | /** @var ConsumableString|null $nonce */ 54 | $nonceAttribute = $this->request->getAttribute('nonce'); 55 | $nonce = ''; 56 | if ($nonceAttribute instanceof ConsumableString) { 57 | $nonce = $nonceAttribute->consume(); 58 | } 59 | $googleConsentModeV2DefaultValues = " 60 | 71 | "; 72 | $pageRenderer->addHeaderData($googleConsentModeV2DefaultValues); 73 | } 74 | if(empty($this->settings['js']) === false){ 75 | $pageRenderer->addJsFooterFile($this->settings['js']); 76 | } 77 | if(empty($this->settings['css']) === false) { 78 | $pageRenderer->addCssFile($this->settings['css']); 79 | } 80 | } 81 | 82 | /** 83 | * @return \Psr\Http\Message\ResponseInterface 84 | */ 85 | public function showAction(): \Psr\Http\Message\ResponseInterface 86 | { 87 | $allPanels = $this->cookiePanelRepository->findAll(); 88 | if($allPanels->count() > 0){ 89 | //render only the first 90 | /** @var CookiePanel $panel */ 91 | $panel = $allPanels->getFirst(); 92 | $this->view->assign('cookiePanel',$panel); 93 | $groupIds = explode(',',$panel->getGroups()); 94 | if(count($groupIds) > 0){ 95 | // @todo make some nice sql query in repo for this 96 | foreach ($groupIds as $id){ 97 | /** @var CookieGroup $grp */ 98 | $grp = $this->cookieGroupRepository->findByUid((int)$id); 99 | if($grp !== null){ 100 | if($grp->getEssential() === true){ 101 | $this->view->assign('essential',true); 102 | } 103 | $cookieGroups[] = $grp; 104 | } 105 | } 106 | } 107 | if(is_array($cookieGroups) && count($cookieGroups) > 0){ 108 | $grpJson = \OM\OmCookieManager\Utility\JsBuilder::buildCompleteGrpJson($cookieGroups, $this->request); 109 | /** @var PageRenderer $pageRenderer */ 110 | $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); 111 | $pageRenderer->addHeaderData(''); 112 | } 113 | if (true === isset($cookieGroups)){ 114 | $this->view->assign('cookieGroups',$cookieGroups); 115 | } 116 | //check if panel should be suppressed 117 | if(false === empty($this->settings['dontShowOnPids'])){ 118 | $pageUid = $this->request->getAttribute('frontend.page.information')->getId(); 119 | $supressPIds = array_map('intval',explode(',',$this->settings['dontShowOnPids'])); 120 | if (true === in_array($pageUid, $supressPIds, true)){ 121 | $this->view->assign('suppressPanel',1); 122 | } 123 | } 124 | //check links and set default if needed 125 | if(true === empty($panel->getLink()) && false === empty($this->settings['privacyPolicyPid'])){ 126 | $panel->setLink($this->settings['privacyPolicyPid']); 127 | } 128 | if(true === empty($panel->getLinkLegalNotice()) && false === empty($this->settings['legalNoticePid'])){ 129 | $panel->setLinkLegalNotice($this->settings['legalNoticePid']); 130 | } 131 | } 132 | return $this->htmlResponse(); 133 | } 134 | 135 | /** 136 | * @return \Psr\Http\Message\ResponseInterface 137 | */ 138 | public function infoAction(): \Psr\Http\Message\ResponseInterface 139 | { 140 | $allPanels = $this->cookiePanelRepository->findAll(); 141 | 142 | if($allPanels->count() > 0) { 143 | //render only the first 144 | /** @var CookiePanel $panel */ 145 | $panel = $allPanels->getFirst(); 146 | $groupIds = explode(',',$panel->getGroups()); 147 | 148 | foreach ($groupIds as $id){ 149 | /** @var CookieGroup $grp */ 150 | $grp = $this->cookieGroupRepository->findByUid((int)$id); 151 | if($grp !== null){ 152 | $cookieGroups[] = $grp; 153 | } 154 | } 155 | if (true === isset($cookieGroups)){ 156 | $this->view->assign('cookieGroups',$cookieGroups); 157 | } 158 | } 159 | 160 | return $this->htmlResponse(); 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /Configuration/TCA/tx_omcookiemanager_domain_model_cookie.php: -------------------------------------------------------------------------------- 1 | [ 4 | 'title' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookie', 5 | 'label' => 'name', 6 | 'tstamp' => 'tstamp', 7 | 'crdate' => 'crdate', 8 | 'versioningWS' => true, 9 | 'languageField' => 'sys_language_uid', 10 | 'transOrigPointerField' => 'l10n_parent', 11 | 'transOrigDiffSourceField' => 'l10n_diffsource', 12 | 'delete' => 'deleted', 13 | 'enablecolumns' => [ 14 | 'disabled' => 'hidden', 15 | 'starttime' => 'starttime', 16 | 'endtime' => 'endtime', 17 | ], 18 | 'searchFields' => 'name,description,lifetime,provider', 19 | 'iconfile' => 'EXT:om_cookie_manager/Resources/Public/Icons/Extension.svg' 20 | ], 21 | 'types' => [ 22 | '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, description, lifetime, provider, cookie_group, cookie_html'], 23 | ], 24 | 'columns' => [ 25 | 'sys_language_uid' => [ 26 | 'exclude' => true, 27 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', 28 | 'config' => [ 29 | 'type' => 'language' 30 | ], 31 | ], 32 | 'l10n_parent' => [ 33 | 'displayCond' => 'FIELD:sys_language_uid:>:0', 34 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', 35 | 'config' => [ 36 | 'type' => 'select', 37 | 'renderType' => 'selectSingle', 38 | 'default' => 0, 39 | 'items' => [ 40 | ['label' => '', 'value' => 0], 41 | ], 42 | 'foreign_table' => 'tx_omcookiemanager_domain_model_cookie', 43 | 'foreign_table_where' => 'AND {#tx_omcookiemanager_domain_model_cookie}.{#pid}=###CURRENT_PID### AND {#tx_omcookiemanager_domain_model_cookie}.{#sys_language_uid} IN (-1,0)', 44 | ], 45 | ], 46 | 'l10n_diffsource' => [ 47 | 'config' => [ 48 | 'type' => 'passthrough', 49 | ], 50 | ], 51 | 't3ver_label' => [ 52 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel', 53 | 'config' => [ 54 | 'type' => 'input', 55 | 'size' => 30, 56 | 'max' => 255, 57 | ], 58 | ], 59 | 'hidden' => [ 60 | 'exclude' => true, 61 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', 62 | 'config' => [ 63 | 'type' => 'check', 64 | 'renderType' => 'checkboxToggle', 65 | 'items' => [ 66 | [ 67 | 'label' => '', 68 | 'invertStateDisplay' => true 69 | ] 70 | ], 71 | ], 72 | ], 73 | 'starttime' => [ 74 | 'exclude' => true, 75 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 76 | 'config' => [ 77 | 'type' => 'datetime', 78 | 'default' => 0, 79 | 'behaviour' => [ 80 | 'allowLanguageSynchronization' => true 81 | ] 82 | ], 83 | ], 84 | 'endtime' => [ 85 | 'exclude' => true, 86 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 87 | 'config' => [ 88 | 'type' => 'datetime', 89 | 'default' => 0, 90 | 'range' => [ 91 | 'upper' => mktime(0, 0, 0, 1, 1, 2038) 92 | ], 93 | 'behaviour' => [ 94 | 'allowLanguageSynchronization' => true 95 | ] 96 | ], 97 | ], 98 | 99 | 'name' => [ 100 | 'exclude' => true, 101 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookie.name', 102 | 'config' => [ 103 | 'type' => 'input', 104 | 'size' => 30, 105 | 'eval' => 'trim', 106 | 'required' => true 107 | ], 108 | ], 109 | 'description' => [ 110 | 'exclude' => true, 111 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookie.description', 112 | 'config' => [ 113 | 'type' => 'text', 114 | 'enableRichtext' => true, 115 | 'richtextConfiguration' => 'default', 116 | 'fieldControl' => [ 117 | 'fullScreenRichtext' => [ 118 | 'disabled' => false, 119 | ], 120 | ], 121 | 'cols' => 40, 122 | 'rows' => 15, 123 | 'eval' => 'trim', 124 | ], 125 | 126 | ], 127 | 'lifetime' => [ 128 | 'exclude' => true, 129 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookie.lifetime', 130 | 'config' => [ 131 | 'type' => 'input', 132 | 'size' => 30, 133 | 'eval' => 'trim' 134 | ], 135 | ], 136 | 'provider' => [ 137 | 'exclude' => true, 138 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookie.provider', 139 | 'config' => [ 140 | 'type' => 'input', 141 | 'size' => 30, 142 | 'eval' => 'trim' 143 | ], 144 | ], 145 | 'cookie_html' => [ 146 | 'exclude' => true, 147 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookie.cookie_html', 148 | 'config' => [ 149 | 'type' => 'inline', 150 | 'foreign_table' => 'tx_omcookiemanager_domain_model_cookiehtml', 151 | 'foreign_field' => 'cookie', 152 | 'maxitems' => 9999, 153 | 'appearance' => [ 154 | 'collapseAll' => 0, 155 | 'levelLinksPosition' => 'top', 156 | 'showSynchronizationLink' => 1, 157 | 'showPossibleLocalizationRecords' => 1, 158 | 'showAllLocalizationLink' => 1 159 | ], 160 | ], 161 | ], 162 | 163 | 'cookiegroup' => [ 164 | 'config' => [ 165 | 'type' => 'passthrough', 166 | ], 167 | ], 168 | ], 169 | ]; 170 | -------------------------------------------------------------------------------- /Configuration/TCA/tx_omcookiemanager_domain_model_cookiegroup.php: -------------------------------------------------------------------------------- 1 | [ 4 | 'title' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup', 5 | 'label' => 'name', 6 | 'tstamp' => 'tstamp', 7 | 'crdate' => 'crdate', 8 | 'versioningWS' => true, 9 | 'languageField' => 'sys_language_uid', 10 | 'transOrigPointerField' => 'l10n_parent', 11 | 'transOrigDiffSourceField' => 'l10n_diffsource', 12 | 'delete' => 'deleted', 13 | 'enablecolumns' => [ 14 | 'disabled' => 'hidden', 15 | 'starttime' => 'starttime', 16 | 'endtime' => 'endtime', 17 | ], 18 | 'searchFields' => 'name,description', 19 | 'iconfile' => 'EXT:om_cookie_manager/Resources/Public/Icons/cookie_grp.svg' 20 | ], 21 | 'types' => [ 22 | '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, description, essential, cookies, 23 | --div--;LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.tab.google,gtm_event_name,gtm_consent_grps'], 24 | ], 25 | 'columns' => [ 26 | 'sys_language_uid' => [ 27 | 'exclude' => true, 28 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', 29 | 'config' => [ 30 | 'type' => 'language' 31 | ], 32 | ], 33 | 'l10n_parent' => [ 34 | 'displayCond' => 'FIELD:sys_language_uid:>:0', 35 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', 36 | 'config' => [ 37 | 'type' => 'select', 38 | 'renderType' => 'selectSingle', 39 | 'default' => 0, 40 | 'items' => [ 41 | ['label' => '', 'value' => 0], 42 | ], 43 | 'foreign_table' => 'tx_omcookiemanager_domain_model_cookiegroup', 44 | 'foreign_table_where' => 'AND {#tx_omcookiemanager_domain_model_cookiegroup}.{#pid}=###CURRENT_PID### AND {#tx_omcookiemanager_domain_model_cookiegroup}.{#sys_language_uid} IN (-1,0)', 45 | ], 46 | ], 47 | 'l10n_diffsource' => [ 48 | 'config' => [ 49 | 'type' => 'passthrough', 50 | ], 51 | ], 52 | 't3ver_label' => [ 53 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel', 54 | 'config' => [ 55 | 'type' => 'input', 56 | 'size' => 30, 57 | 'max' => 255, 58 | ], 59 | ], 60 | 'hidden' => [ 61 | 'exclude' => true, 62 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', 63 | 'config' => [ 64 | 'type' => 'check', 65 | 'renderType' => 'checkboxToggle', 66 | 'items' => [ 67 | [ 68 | 'label' => '', 69 | 'invertStateDisplay' => true 70 | ] 71 | ], 72 | ], 73 | ], 74 | 'starttime' => [ 75 | 'exclude' => true, 76 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 77 | 'config' => [ 78 | 'type' => 'datetime', 79 | 'default' => 0, 80 | 'behaviour' => [ 81 | 'allowLanguageSynchronization' => true 82 | ] 83 | ], 84 | ], 85 | 'endtime' => [ 86 | 'exclude' => true, 87 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 88 | 'config' => [ 89 | 'type' => 'datetime', 90 | 'default' => 0, 91 | 'range' => [ 92 | 'upper' => mktime(0, 0, 0, 1, 1, 2038) 93 | ], 94 | 'behaviour' => [ 95 | 'allowLanguageSynchronization' => true 96 | ] 97 | ], 98 | ], 99 | 100 | 'name' => [ 101 | 'exclude' => true, 102 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.name', 103 | 'config' => [ 104 | 'type' => 'input', 105 | 'size' => 30, 106 | 'eval' => 'trim', 107 | 'required' => true 108 | ], 109 | ], 110 | 'gtm_event_name' => [ 111 | 'exclude' => true, 112 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.gtm_event_name', 113 | 'config' => [ 114 | 'type' => 'input', 115 | 'size' => 30, 116 | 'eval' => 'trim,' 117 | ], 118 | ], 119 | 'description' => [ 120 | 'exclude' => true, 121 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.description', 122 | 'config' => [ 123 | 'type' => 'text', 124 | 'enableRichtext' => true, 125 | 'richtextConfiguration' => 'default', 126 | 'fieldControl' => [ 127 | 'fullScreenRichtext' => [ 128 | 'disabled' => false, 129 | ], 130 | ], 131 | 'cols' => 40, 132 | 'rows' => 15, 133 | 'eval' => 'trim', 134 | ], 135 | 136 | ], 137 | 'essential' => [ 138 | 'exclude' => true, 139 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.essential', 140 | 'config' => [ 141 | 'type' => 'check', 142 | 'items' => [ 143 | ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled'], 144 | ], 145 | 'default' => 0, 146 | ] 147 | ], 148 | 'cookies' => [ 149 | 'exclude' => true, 150 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiegroup.cookies', 151 | 'config' => [ 152 | 'type' => 'inline', 153 | 'foreign_table' => 'tx_omcookiemanager_domain_model_cookie', 154 | 'foreign_field' => 'cookiegroup', 155 | 'maxitems' => 9999, 156 | 'appearance' => [ 157 | 'collapseAll' => 0, 158 | 'levelLinksPosition' => 'top', 159 | 'showSynchronizationLink' => 1, 160 | 'showPossibleLocalizationRecords' => 1, 161 | 'showAllLocalizationLink' => 1 162 | ], 163 | ], 164 | 165 | ], 166 | ], 167 | ]; 168 | -------------------------------------------------------------------------------- /Configuration/TCA/tx_omcookiemanager_domain_model_cookiepanel.php: -------------------------------------------------------------------------------- 1 | [ 4 | 'title' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiepanel', 5 | 'label' => 'name', 6 | 'tstamp' => 'tstamp', 7 | 'crdate' => 'crdate', 8 | 'versioningWS' => true, 9 | 'languageField' => 'sys_language_uid', 10 | 'transOrigPointerField' => 'l10n_parent', 11 | 'transOrigDiffSourceField' => 'l10n_diffsource', 12 | 'delete' => 'deleted', 13 | 'enablecolumns' => [ 14 | 'disabled' => 'hidden', 15 | 'starttime' => 'starttime', 16 | 'endtime' => 'endtime', 17 | ], 18 | 'searchFields' => 'name,description,link', 19 | 'iconfile' => 'EXT:om_cookie_manager/Resources/Public/Icons/cookie_panel_icon.svg' 20 | ], 21 | 'types' => [ 22 | '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, description, link, link_text, link_legal_notice, link_legal_notice_text, groups'], 23 | ], 24 | 'columns' => [ 25 | 'sys_language_uid' => [ 26 | 'exclude' => true, 27 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', 28 | 'config' => [ 29 | 'type' => 'language' 30 | ], 31 | ], 32 | 'l10n_parent' => [ 33 | 'displayCond' => 'FIELD:sys_language_uid:>:0', 34 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', 35 | 'config' => [ 36 | 'type' => 'select', 37 | 'renderType' => 'selectSingle', 38 | 'default' => 0, 39 | 'items' => [ 40 | ['label' => '', 'value' => 0], 41 | ], 42 | 'foreign_table' => 'tx_omcookiemanager_domain_model_cookiepanel', 43 | 'foreign_table_where' => 'AND tx_omcookiemanager_domain_model_cookiepanel.pid=###CURRENT_PID### AND tx_omcookiemanager_domain_model_cookiepanel.sys_language_uid IN (-1,0)', 44 | ], 45 | ], 46 | 'l10n_diffsource' => [ 47 | 'config' => [ 48 | 'type' => 'passthrough', 49 | ], 50 | ], 51 | 't3ver_label' => [ 52 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel', 53 | 'config' => [ 54 | 'type' => 'input', 55 | 'size' => 30, 56 | 'max' => 255, 57 | ], 58 | ], 59 | 'hidden' => [ 60 | 'exclude' => true, 61 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', 62 | 'config' => [ 63 | 'type' => 'check', 64 | 'renderType' => 'checkboxToggle', 65 | 'items' => [ 66 | [ 67 | 'label' => '', 68 | 'invertStateDisplay' => true 69 | ] 70 | ], 71 | ], 72 | ], 73 | 'starttime' => [ 74 | 'exclude' => true, 75 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 76 | 'config' => [ 77 | 'type' => 'datetime', 78 | 'default' => 0, 79 | 'behaviour' => [ 80 | 'allowLanguageSynchronization' => true 81 | ] 82 | ], 83 | ], 84 | 'endtime' => [ 85 | 'exclude' => true, 86 | 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 87 | 'config' => [ 88 | 'type' => 'datetime', 89 | 'default' => 0, 90 | 'range' => [ 91 | 'upper' => mktime(0, 0, 0, 1, 1, 2038) 92 | ], 93 | 'behaviour' => [ 94 | 'allowLanguageSynchronization' => true 95 | ] 96 | ], 97 | ], 98 | 99 | 'name' => [ 100 | 'exclude' => true, 101 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiepanel.name', 102 | 'config' => [ 103 | 'type' => 'input', 104 | 'size' => 30, 105 | 'eval' => 'trim', 106 | 'required' => true 107 | ], 108 | ], 109 | 'description' => [ 110 | 'exclude' => true, 111 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiepanel.description', 112 | 'config' => [ 113 | 'type' => 'text', 114 | 'enableRichtext' => true, 115 | 'richtextConfiguration' => 'default', 116 | 'fieldControl' => [ 117 | 'fullScreenRichtext' => [ 118 | 'disabled' => false, 119 | ], 120 | ], 121 | 'cols' => 40, 122 | 'rows' => 15, 123 | 'eval' => 'trim', 124 | ], 125 | 126 | ], 127 | 'link' => [ 128 | 'exclude' => true, 129 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiepanel.link', 130 | 'config' => [ 131 | 'type' => 'link', 132 | 'size' => 30 133 | ], 134 | ], 135 | 'link_text' => [ 136 | 'exclude' => true, 137 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiepanel.link_text', 138 | 'config' => [ 139 | 'type' => 'input', 140 | 'size' => 30, 141 | 'eval' => 'trim' 142 | ], 143 | ], 144 | 'link_legal_notice' => [ 145 | 'exclude' => true, 146 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiepanel.link_legal_notice', 147 | 'config' => [ 148 | 'type' => 'input', 149 | 'renderType' => 'inputLink', 150 | 'size' => 30, 151 | 'eval' => 'trim' 152 | ], 153 | ], 154 | 'link_legal_notice_text' => [ 155 | 'exclude' => true, 156 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiepanel.link_legal_notice_text', 157 | 'config' => [ 158 | 'type' => 'input', 159 | 'size' => 30, 160 | 'eval' => 'trim' 161 | ], 162 | ], 163 | 'groups' => [ 164 | 'exclude' => true, 165 | 'label' => 'LLL:EXT:om_cookie_manager/Resources/Private/Language/locallang_db.xlf:tx_omcookiemanager_domain_model_cookiepanel.groups', 166 | 'config' => [ 167 | 'type' => 'select', 168 | 'maxitems' => 99, 169 | 'renderType' => 'selectMultipleSideBySide', 170 | 'foreign_table' => 'tx_omcookiemanager_domain_model_cookiegroup', 171 | 'foreign_table_where' => 'AND tx_omcookiemanager_domain_model_cookiegroup.sys_language_uid = ###REC_FIELD_sys_language_uid###', 172 | ], 173 | ], 174 | ], 175 | ]; 176 | -------------------------------------------------------------------------------- /Resources/Public/Icons/cookie_grp.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 11 | 16 | 17 | 18 | 21 | 26 | 27 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 54 | 55 | 56 | 61 | 75 | 76 | 77 | 78 | 79 | 82 | 85 | 90 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /Resources/Private/Language/locallang_db.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | Cookie 8 | 9 | 10 | Name 11 | 12 | 13 | Description 14 | 15 | 16 | Lifetime 17 | 18 | 19 | Provider 20 | 21 | 22 | Cookie Group 23 | 24 | 25 | Cookie Html 26 | 27 | 28 | Cookie Group 29 | 30 | 31 | Google (GTM) 32 | 33 | 34 | Name 35 | 36 | 37 | Description 38 | 39 | 40 | Essential (the option will be shown as checked and greyed out. The scripts will be loaded always after the save) 41 | 42 | 43 | Cookies 44 | 45 | 46 | Cookie Panel 47 | 48 | 49 | Name (the header of the cookie optin panel) 50 | 51 | 52 | Description (this is shown in the information table/view) 53 | 54 | 55 | Link to the legal notice 56 | 57 | 58 | Alternative link text for legal notice link 59 | 60 | 61 | Link to cookie or privacy policy, will be shown on the panel 62 | 63 | 64 | Alternative link text for the cookie or privacy policy link 65 | Alternativer Linktext für die Datenschutzseite 66 | 67 | 68 | Active groups and there ordering 69 | 70 | 71 | Google Consent Mode v2 - Categories to activate with this group 72 | 73 | 74 | Per Default all categories are disabled, as long as the default setting in the typoscript constants is active. More information about the categories can be found here https://support.google.com/tagmanager/answer/13802165?sjid=3054677762310188636-EU 75 | 76 | 77 | AD Storage: Enables the storage of advertising-related data such as cookies 78 | 79 | 80 | AD User Data: Defines the consent to send advertising-related user data to Google 81 | 82 | 83 | AD Personalization: Sets the consent for personalized ads 84 | 85 | 86 | Analytics Storage: Enables the storage of analysis-related data such as cookies, e.g. on visit duration 87 | 88 | 89 | Cookie HTML 90 | 91 | 92 | HTML (place here your script tags. Dont use plain javascript without script tag) 93 | 94 | 95 | Insert in 96 | 97 | 98 | OM Cookie Manager - Information Table/View 99 | 100 | 101 | This plugin generates a overview about all cookie groups and cookies with there descriptions (the data comes from the records). There is as well a link, that offers the possibility to reopen the Cookie Panel and change the given Optins 102 | 103 | 104 | OM Cookie Manager - Main 105 | 106 | 107 | Google Tag Manager event name (this will be pushed in the dataLayer when the group is accepted in the optin) 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Resources/Private/Language/de.locallang_db.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | Cookie 8 | Cookie 9 | 10 | 11 | Name 12 | Name 13 | 14 | 15 | Description 16 | Beschreibung 17 | 18 | 19 | Lifetime 20 | Speicherdauer 21 | 22 | 23 | Provider 24 | Provider 25 | 26 | 27 | Cookie Group 28 | Cookie Gruppe 29 | 30 | 31 | Cookie Html 32 | Cookie HTML 33 | 34 | 35 | Cookie Group 36 | Cookie Gruppe 37 | 38 | 39 | Google (GTM) 40 | 41 | 42 | Name 43 | Name 44 | 45 | 46 | Description 47 | Beschreibung 48 | 49 | 50 | Essential (the option will be shown as checked and greyed out. The scripts will be loaded always after the save) 51 | Essentiell (Die Gruppe wird im Optin schon angewählt und ausgegraut angezeigt. Das HTML und die hinterlegten Script Tags werden nach dem Speichern immer hinzugefügt und ausgeführt) 52 | 53 | 54 | Cookies 55 | Cookies 56 | 57 | 58 | Cookie Panel 59 | Cookie Panel 60 | 61 | 62 | Name (the header of the cookie optin panel) 63 | Titel (wird als überschrift vom optin panel verwendet) 64 | 65 | 66 | Description (this is shown in the information table/view) 67 | Beschreibung (wird in der Informationstabelle angezeigt) 68 | 69 | 70 | Link to the legal notice 71 | Link zum Impressum 72 | 73 | 74 | Alternative link text for legal notice link 75 | Alternativer Linktext für den Impressum Link 76 | 77 | 78 | Link to cookie or privacy policy, will be shown on the panel 79 | Link zur Datenschutzseite oder Cookie policy (Der Link wird im Optin Panel zur Verfügung gestellt) 80 | 81 | 82 | Alternative link text for the cookie or privacy policy link 83 | Alternativer Linktext für den Link zur Datenschutzseite 84 | 85 | 86 | Active groups and there ordering 87 | Aktive Gruppen und deren Anordnung 88 | 89 | 90 | Google Consent Mode v2 - Categories 91 | Google Consent Mode v2 - Kategorien 92 | 93 | 94 | Per default sind alle Kategorien deaktiviert, sofern die Standardeinstellung in den TypoScript Konstanten aktiv ist. Weitere Informationen zu den Google Einwilligung Kategorien können Sie hier finden https://support.google.com/tagmanager/answer/13802165?sjid=3054677762310188636-EU 95 | 96 | 97 | AD Storage: Ermöglicht das Speichern von werbebezogenen Daten wie Cookies 98 | 99 | 100 | AD User Data: Legt die Einwilligung zum Senden von werbebezogenen Nutzerdaten an Google fest 101 | 102 | 103 | AD Personalization: Legt die Einwilligung für personalisierte Anzeigen fest 104 | 105 | 106 | Analytics Storage: Ermöglicht das Speichern von analysebezogenen Daten wie Cookies, z. B. zur Besuchsdauer 107 | 108 | 109 | Cookie HTML 110 | Cookie HTML 111 | 112 | 113 | HTML 114 | HTML (fügen Sie hier bitte ihre Script tags rein. Bitte kein JS ohne script tag verwenden) 115 | 116 | 117 | Insert in 118 | Einfügen in 119 | 120 | 121 | OM Cookie Manager - Information Table/View 122 | OM Cookie Manager - Cookie Informationstabelle 123 | 124 | 125 | This plugin generates a overview about all cookie groups and cookies with there descriptions (the data comes from the records). There is as well a link, that offers the possibility to open the Cookie Panel and modify settings 126 | Dieses Plugin generiert eine Cookie Informationstabelle wo alle Gruppen und deren Cookies samt beschreibung gelistet werden. Die Daten werden aus den Datensätzen gelesen. Hier wird auch ein Link zu Verfügung gestellt der es ermöglicht den Optin panel wieder zu öffnen und Einstellungen zu verändern 127 | 128 | 129 | OM Cookie Manager - Main 130 | OM Cookie Manager - Main 131 | 132 | 133 | Google Tag Manager event name (this will be pushed in the dataLayer when the group is accepted in the optin) 134 | Google Tag Manager event name (dieses Event wird in den dataLayer gepusht, wenn die Gruppe akzeptiert wurde. Kann im GTM somit als Trigger dienen) 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /Resources/Public/Js/om_cookie_main.js: -------------------------------------------------------------------------------- 1 | try { 2 | var omCookieGroups = JSON.parse(document.getElementById('om-cookie-consent').innerHTML); 3 | var omGtmEvents = []; 4 | var omGtmConsentModeGrantedGrps = []; 5 | } 6 | catch(err) { 7 | console.log('OM Cookie Manager: No Cookie Groups found! Maybe you have forgot to set the page id inside the constants of the extension') 8 | } 9 | 10 | 11 | document.addEventListener('DOMContentLoaded', function(){ 12 | var panelButtons = document.querySelectorAll('[data-omcookie-panel-save]'); 13 | var openButtons = document.querySelectorAll('[data-omcookie-panel-show]'); 14 | var i; 15 | var omCookiePanel = document.querySelectorAll('[data-omcookie-panel]')[0]; 16 | if(omCookiePanel === undefined) return; 17 | var openCookiePanel = true; 18 | 19 | //Enable stuff by Cookie 20 | var cookieConsentData = omCookieUtility.getCookie('omCookieConsent'); 21 | if(cookieConsentData !== null && cookieConsentData.length > 0){ 22 | //dont open the panel if we have the cookie 23 | openCookiePanel = false; 24 | var checkboxes = document.querySelectorAll('[data-omcookie-panel-grp]'); 25 | var cookieConsentGrps = cookieConsentData.split(','); 26 | var cookieConsentActiveGrps = ''; 27 | 28 | for(i = 0; i < cookieConsentGrps.length; i++){ 29 | if(cookieConsentGrps[i] !== 'dismiss'){ 30 | var grpSettings = cookieConsentGrps[i].split('.'); 31 | if(parseInt(grpSettings[1]) === 1){ 32 | omCookieEnableCookieGrp(grpSettings[0]); 33 | cookieConsentActiveGrps += grpSettings[0] + ','; 34 | } 35 | } 36 | } 37 | for(i = 0; i < checkboxes.length; i++){ 38 | if(cookieConsentActiveGrps.indexOf(checkboxes[i].value) !== -1){ 39 | checkboxes[i].checked = true; 40 | } 41 | //check if we have a new group 42 | if(cookieConsentData.indexOf(checkboxes[i].value) === -1){ 43 | openCookiePanel = true; 44 | } 45 | } 46 | //push stored events(sored by omCookieEnableCookieGrp) to gtm. We push this last so we are sure that gtm is loaded 47 | omPushGtmConsentModeGrpsEvents(omGtmConsentModeGrantedGrps); 48 | pushGtmEvents(omGtmEvents); 49 | omTriggerPanelEvent(['cookieconsentscriptsloaded']); 50 | } 51 | //check explicit suppress 52 | if(omCookiePanel.dataset.omcookiePanelSuppress > 0){ 53 | openCookiePanel = false; 54 | } 55 | if(openCookiePanel === true){ 56 | //timeout, so the user can see the page before he get the nice cookie panel 57 | setTimeout(function () { 58 | omCookiePanel.classList.toggle('active'); 59 | },1000); 60 | } 61 | 62 | //check for button click 63 | for (i = 0; i < panelButtons.length; i++) { 64 | panelButtons[i].addEventListener('click', omCookieSaveAction, false); 65 | } 66 | for (i = 0; i < openButtons.length; i++) { 67 | openButtons[i].addEventListener('click', function (event) { 68 | event.preventDefault(); 69 | omCookiePanel.classList.toggle('active'); 70 | }, false); 71 | } 72 | 73 | }); 74 | 75 | //activates the groups 76 | var omCookieSaveAction = function() { 77 | action = this.getAttribute('data-omcookie-panel-save'); 78 | var checkboxes = document.querySelectorAll('[data-omcookie-panel-grp]'); 79 | var i; 80 | //check if we have a cookie 81 | var cookie = omCookieUtility.getCookie('omCookieConsent'); 82 | if(cookie === null || cookie.length <= 0){ 83 | //set cookie to empty string when no cookie data was found 84 | cookie = ''; 85 | }else{ 86 | //reset all values inside the cookie which are present in the actual panel 87 | for (i = 0; i < checkboxes.length; i++) { 88 | cookie = cookie.replace(new RegExp(checkboxes[i].value + '\\S{3}'),''); 89 | } 90 | } 91 | //save the group id (group-x) and the made choice (.0 for group denied and .1 for group accepted) 92 | switch (action) { 93 | case 'all': 94 | for (i = 0; i < checkboxes.length; i++) { 95 | omCookieEnableCookieGrp(checkboxes[i].value); 96 | cookie += checkboxes[i].value + '.1,'; 97 | checkboxes[i].checked = true; 98 | } 99 | break; 100 | case 'save': 101 | for (i = 0; i < checkboxes.length; i++) { 102 | if(checkboxes[i].checked === true){ 103 | omCookieEnableCookieGrp(checkboxes[i].value); 104 | cookie += checkboxes[i].value + '.1,'; 105 | }else{ 106 | cookie += checkboxes[i].value + '.0,'; 107 | } 108 | } 109 | break; 110 | case 'min': 111 | for (i = 0; i < checkboxes.length; i++) { 112 | if(checkboxes[i].getAttribute('data-omcookie-panel-essential') !== null){ 113 | omCookieEnableCookieGrp(checkboxes[i].value); 114 | cookie += checkboxes[i].value + '.1,'; 115 | }else{ 116 | cookie += checkboxes[i].value + '.0,'; 117 | checkboxes[i].checked = false; 118 | } 119 | } 120 | break; 121 | } 122 | //replace dismiss to the end of the cookie 123 | cookie = cookie.replace('dismiss',''); 124 | cookie += 'dismiss'; 125 | //cookie = cookie.slice(0, -1); 126 | omCookieUtility.setCookie('omCookieConsent',cookie,364); 127 | omPushGtmConsentModeGrpsEvents(omGtmConsentModeGrantedGrps); 128 | //push stored events to gtm. We push this last so we are sure that gtm is loaded 129 | pushGtmEvents(omGtmEvents); 130 | omTriggerPanelEvent(['cookieconsentsave','cookieconsentscriptsloaded']); 131 | 132 | setTimeout(function () { 133 | document.querySelectorAll('[data-omcookie-panel]')[0].classList.toggle('active'); 134 | },350) 135 | 136 | }; 137 | 138 | var omTriggerPanelEvent = function(events){ 139 | events.forEach(function (event) { 140 | var eventObj = new CustomEvent(event, {bubbles: true}); 141 | document.querySelectorAll('[data-omcookie-panel]')[0].dispatchEvent(eventObj); 142 | }) 143 | }; 144 | 145 | var pushGtmEvents = function (events) { 146 | window.dataLayer = window.dataLayer || []; 147 | events.forEach(function (event) { 148 | window.dataLayer.push({ 149 | 'event': event, 150 | }); 151 | }); 152 | }; 153 | 154 | var omPushGtmConsentModeGrpsEvents = function (groups) { 155 | groupsObject = {}; 156 | groups.forEach((value) => { 157 | groupsObject[value] = 'granted'; 158 | }); 159 | if(Object.keys(groupsObject).length > 0){ 160 | window.dataLayer = window.dataLayer || []; 161 | function gtag(){dataLayer.push(arguments);} 162 | gtag('consent', 'update', groupsObject); 163 | } 164 | 165 | }; 166 | var omCookieEnableCookieGrp = function (groupKey){ 167 | if(omCookieGroups[groupKey] !== undefined){ 168 | for (var key in omCookieGroups[groupKey]) { 169 | // skip loop if the property is from prototype 170 | if (!omCookieGroups[groupKey].hasOwnProperty(key)) continue; 171 | var obj = omCookieGroups[groupKey][key]; 172 | //save gtm event for pushing 173 | if(key === 'gtm'){ 174 | if(omCookieGroups[groupKey][key]){ 175 | omGtmEvents.push(omCookieGroups[groupKey][key]); 176 | } 177 | continue; 178 | } 179 | if(key === 'gtmConsentMode'){ 180 | if(omCookieGroups[groupKey][key]){ 181 | omCookieGroups[groupKey][key].split(',').forEach((value) => { 182 | omGtmConsentModeGrantedGrps.indexOf(value) === -1 ? omGtmConsentModeGrantedGrps.push(value) : false; 183 | }); 184 | omGtmConsentModeGrantedGrps.push(); 185 | } 186 | continue; 187 | } 188 | //set the cookie html 189 | for (var prop in obj) { 190 | // skip loop if the property is from prototype 191 | if (!obj.hasOwnProperty(prop)) continue; 192 | 193 | if(Array.isArray(obj[prop])){ 194 | var content = ''; 195 | //get the html content 196 | obj[prop].forEach(function (htmlContent) { 197 | content += htmlContent 198 | }); 199 | var range = document.createRange(); 200 | if(prop === 'header'){ 201 | // add the html to header 202 | range.selectNode(document.getElementsByTagName('head')[0]); 203 | var documentFragHead = range.createContextualFragment(content); 204 | document.getElementsByTagName('head')[0].appendChild(documentFragHead); 205 | }else{ 206 | //add the html to body 207 | range.selectNode(document.getElementsByTagName('body')[0]); 208 | var documentFragBody = range.createContextualFragment(content); 209 | document.getElementsByTagName('body')[0].appendChild(documentFragBody); 210 | } 211 | } 212 | } 213 | } 214 | //remove the group so we don't set it again 215 | delete omCookieGroups[groupKey]; 216 | } 217 | }; 218 | var omCookieUtility = { 219 | getCookie: function(name) { 220 | var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)'); 221 | return v ? v[2] : null; 222 | }, 223 | setCookie: function(name, value, days) { 224 | var d = new Date; 225 | d.setTime(d.getTime() + 24*60*60*1000*days); 226 | document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString() + ";SameSite=Lax"; 227 | }, 228 | deleteCookie: function(name){ setCookie(name, '', -1); } 229 | }; 230 | 231 | (function () { 232 | 233 | if ( typeof window.CustomEvent === "function" ) return false; 234 | 235 | function CustomEvent ( event, params ) { 236 | params = params || { bubbles: false, cancelable: false, detail: null }; 237 | var evt = document.createEvent( 'CustomEvent' ); 238 | evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); 239 | return evt; 240 | } 241 | 242 | window.CustomEvent = CustomEvent; 243 | })(); 244 | 245 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------