diff --git a/Classes/Compatibility/Version.php b/Classes/Compatibility/Version.php deleted file mode 100644 index 8d5e6f6..0000000 --- a/Classes/Compatibility/Version.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license GPLv3 - */ - -namespace PAD\CookieconsentPlus\Compatibility; - -use \TYPO3\CMS\Core\Utility\ExtensionManagementUtility; - -class Version -{ - const DP_COOKIECONSENT_KEY = 'dp_cookieconsent'; - - /** - * If dp_cookieconsent is the new version - * returns true - * else false - * It is the new version, if it is eq to 11.2.1 or gte to 11.4.0 - * - * @param none - * @return bool - */ - public function isTheNewVersion(): bool - { - $version = ExtensionManagementUtility::getExtensionVersion(self::DP_COOKIECONSENT_KEY); - $result = false; - if (\version_compare($version, '11.2.1', '==') || \version_compare($version, '11.4.0', '>=')) { - $result = true; - } - return $result; - } -} diff --git a/Classes/Cookie/CookieConstraint.php b/Classes/Cookie/CookieConstraint.php new file mode 100644 index 0000000..a7c32a4 --- /dev/null +++ b/Classes/Cookie/CookieConstraint.php @@ -0,0 +1,119 @@ + + * @license GPLv3 + */ + +namespace PAD\CookieconsentPlus\Cookie; + +use \TYPO3\CMS\Core\Database\ConnectionPool; +use \TYPO3\CMS\Core\Utility\GeneralUtility; +use \PAD\CookieconsentPlus\Cookie\CookieManager; + +class CookieConstraint +{ + const ISCOOKIESDEPENDENT_OFF = 0; + const ISCOOKIESDEPENDENT_ON = 1; + const CONDITIONTYPE_VALUE_SHOWAND = 'showand'; + const CONDITIONTYPE_VALUE_SHOWOR = 'showor'; + const CONDITION_VALUE_ANYVALUE = 'anyvalue'; + const CONDITION_VALUE_DENIED = 'denied'; + const CONDITION_VALUE_ACCEPTED = 'accepted'; + + /** + * Returns enable fields (constraints) for cookies dependency + * + * @param string $table + * @param array $enableFields - cookieconsent enable fields + * @return string + */ + public static function getCookiesConstraints(string $table, array $enableFields): string + { + $constraints = []; + $cookieManager = GeneralUtility::makeInstance(CookieManager::class); + $isStatisticsOn = $cookieManager->isStatisticsOn(); + $isMarketingOn = $cookieManager->isMarketingOn(); + $statisticsValues = [ + self::CONDITION_VALUE_ANYVALUE, + $isStatisticsOn ? self::CONDITION_VALUE_ACCEPTED : self::CONDITION_VALUE_DENIED, + ]; + $marketingValues = [ + self::CONDITION_VALUE_ANYVALUE, + $isMarketingOn ? self::CONDITION_VALUE_ACCEPTED : self::CONDITION_VALUE_DENIED, + ]; + $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); + $expressionBuilder = $queryBuilder->expr(); + $statisticsValues = array_map([$expressionBuilder, 'literal'], $statisticsValues); + $marketingValues = array_map([$expressionBuilder, 'literal'], $marketingValues); + $constraints[] = $expressionBuilder->eq( + $enableFields['iscookiesdependent'], + self::ISCOOKIESDEPENDENT_OFF + ); + $constraints[] = $expressionBuilder->and( + $expressionBuilder->eq( + $enableFields['iscookiesdependent'], + self::ISCOOKIESDEPENDENT_ON + ), + $expressionBuilder->eq( + $enableFields['conditiontype'], + $expressionBuilder->literal(self::CONDITIONTYPE_VALUE_SHOWAND) + ), + $expressionBuilder->and( + $expressionBuilder->in( + $enableFields['statisticscondition'], + $statisticsValues + ), + $expressionBuilder->in( + $enableFields['marketingcondition'], + $marketingValues + ), + ) + ); + $constraints[] = $expressionBuilder->and( + $expressionBuilder->eq( + $enableFields['iscookiesdependent'], + self::ISCOOKIESDEPENDENT_ON + ), + $expressionBuilder->eq( + $enableFields['conditiontype'], + $expressionBuilder->literal(self::CONDITIONTYPE_VALUE_SHOWOR) + ), + $expressionBuilder->or( + $expressionBuilder->in( + $enableFields['statisticscondition'], + $statisticsValues + ), + $expressionBuilder->in( + $enableFields['marketingcondition'], + $marketingValues + ), + ) + ); + return strval($expressionBuilder->or(...$constraints)); + } +} diff --git a/Classes/Cookie/CookieManager.php b/Classes/Cookie/CookieManager.php index 6b1d2d3..c01e525 100644 --- a/Classes/Cookie/CookieManager.php +++ b/Classes/Cookie/CookieManager.php @@ -31,18 +31,12 @@ namespace PAD\CookieconsentPlus\Cookie; -use \PAD\CookieconsentPlus\Compatibility\Version; -use \TYPO3\CMS\Core\Utility\GeneralUtility; - class CookieManager { - const COOKIECONSENTSTATUS_NAME = 'cookieconsent_status'; - const COOKIECONSENTSTATUS_DP_NAME = 'dp_cookieconsent_status'; - const COOKIEDISMISSVALUE = 'dismiss'; - const COOKIEALLOWVALUE = 'allow'; - const COOKIEDENYVALUE = 'deny'; - const COOKIEDIALOGSTATUSOPEN = 'open'; - const COOKIEDIALOGSTATUSAPPROVED = 'approved'; + const DP_COOKIECONSENT_STATUS = 'dp_cookieconsent_status'; + const DP_COOKIECONSENT_STATISTICS = 'statistics'; + const DP_COOKIECONSENT_MARKETING = 'marketing'; + const DP_COOKIECONSENT_DIALOG_STATUS_APPROVED = 'approved'; protected $cookieValue = ''; protected $dpCookieValue = []; @@ -58,48 +52,28 @@ class CookieManager */ public function __construct() { - $versionCompatibility = GeneralUtility::makeInstance(Version::class); - if ($versionCompatibility->isTheNewVersion()) { // dp_cookieconsent new version - if (isset($_COOKIE[self::COOKIECONSENTSTATUS_DP_NAME])) { - $this->cookieValue = ''; - $this->cookieStatus = false; - $this->dpCookieValue = json_decode($_COOKIE[self::COOKIECONSENTSTATUS_DP_NAME], true); - $this->dpCookieStatus = $this->dpCookieValue['status']; - if ($this->dpCookieStatus == self::COOKIEDIALOGSTATUSAPPROVED) { - if (is_array($this->dpCookieValue['checkboxes'])) { - foreach ($this->dpCookieValue['checkboxes'] as $key => $value) { - switch ($value['name']) { - case 'statistics': - $this->statisticsCookieStatus = (boolean) $value['checked']; - break; + if (isset($_COOKIE[self::DP_COOKIECONSENT_STATUS])) { + $this->cookieValue = ''; + $this->cookieStatus = false; + $this->dpCookieValue = json_decode($_COOKIE[self::DP_COOKIECONSENT_STATUS], true); + $this->dpCookieStatus = $this->dpCookieValue['status']; + if ($this->dpCookieStatus == self::DP_COOKIECONSENT_DIALOG_STATUS_APPROVED) { + if (is_array($this->dpCookieValue['checkboxes'])) { + foreach ($this->dpCookieValue['checkboxes'] as $key => $value) { + switch ($value['name']) { + case self::DP_COOKIECONSENT_STATISTICS: + $this->statisticsCookieStatus = boolval($value['checked']); + break; - case 'marketing': - $this->marketingCookieStatus = (boolean) $value['checked']; - break; - } - } - } - } else { - $this->statisticsCookieStatus = false; - $this->marketingCookieStatus = false; - } - } - } else { // dp_cookieconsent old version - if (isset($_COOKIE[self::COOKIECONSENTSTATUS_NAME])) { - $this->cookieValue = $_COOKIE[self::COOKIECONSENTSTATUS_NAME]; - if ($this->cookieValue) { - $this->cookieStatus = $_COOKIE[self::COOKIECONSENTSTATUS_NAME] == self::COOKIEDENYVALUE ? false : true; - if ($this->cookieStatus) { - if ($this->cookieValue != self::COOKIEDISMISSVALUE && isset($_COOKIE[self::COOKIECONSENTSTATUS_DP_NAME])) { - $this->dpCookieValue = json_decode($_COOKIE[self::COOKIECONSENTSTATUS_DP_NAME], true); - $this->statisticsCookieStatus = (boolean) $this->dpCookieValue['dp--cookie-statistics']; - $this->marketingCookieStatus = (boolean) $this->dpCookieValue['dp--cookie-marketing']; - } else { - $this->statisticsCookieStatus = true; - $this->marketingCookieStatus = true; + case self::DP_COOKIECONSENT_MARKETING: + $this->marketingCookieStatus = boolval($value['checked']); + break; } } } + } else { + $this->statisticsCookieStatus = false; + $this->marketingCookieStatus = false; } } } diff --git a/Classes/Database/Query/Restriction/CookieRestriction.php b/Classes/Database/Query/Restriction/CookieRestriction.php new file mode 100644 index 0000000..5d50219 --- /dev/null +++ b/Classes/Database/Query/Restriction/CookieRestriction.php @@ -0,0 +1,72 @@ + + * @license GPLv3 + */ + +namespace PAD\CookieconsentPlus\Database\Query\Restriction; + +use TYPO3\CMS\Core\Database\Query\Expression\CompositeExpression; +use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder; +use TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionInterface; +use PAD\CookieconsentPlus\Cookie\CookieConstraint; + +class CookieRestriction implements QueryRestrictionInterface +{ + /** + * Main method to build expressions for given tables + * Evaluates the ctrl/delete flag of the table and adds the according restriction if set + * + * @param array $queriedTables Array of tables, where array key is table alias and value is a table name + * @param ExpressionBuilder $expressionBuilder Expression builder instance to add restrictions with + * @return CompositeExpression The result of query builder expression(s) + */ + public function buildExpression(array $queriedTables, ExpressionBuilder $expressionBuilder): CompositeExpression + { + $constraints = []; + foreach ($queriedTables as $tableAlias => $tableName) { + if (isset($GLOBALS['TCA'][$tableName]['ctrl']['enablecolumns'])) { + $enableColumns = $GLOBALS['TCA'][$tableName]['ctrl']['enablecolumns']; + if (isset($enableColumns['cookiesdependent_iscookiesdependent']) && $enableColumns['cookiesdependent_iscookiesdependent'] && + isset($enableColumns['cookiesdependent_conditiontype']) && $enableColumns['cookiesdependent_conditiontype'] && + isset($enableColumns['cookiesdependent_statisticscondition']) && $enableColumns['cookiesdependent_statisticscondition'] && + isset($enableColumns['cookiesdependent_marketingcondition']) && $enableColumns['cookiesdependent_marketingcondition']) + { + $enableFields = [ + 'iscookiesdependent' => $tableAlias . '.' . $enableColumns['cookiesdependent_iscookiesdependent'], + 'conditiontype' => $tableAlias . '.' . $enableColumns['cookiesdependent_conditiontype'], + 'statisticscondition' => $tableAlias . '.' . $enableColumns['cookiesdependent_statisticscondition'], + 'marketingcondition' => $tableAlias . '.' . $enableColumns['cookiesdependent_marketingcondition'], + ]; + $constraints[] = CookieConstraint::getCookiesConstraints($tableName, $enableFields); + } + } + } + return $expressionBuilder->andX(...$constraints); + } +} diff --git a/Classes/Hook/AddEnableColumnsHook.php b/Classes/Hook/AddEnableColumnsHook.php new file mode 100644 index 0000000..e5b3c29 --- /dev/null +++ b/Classes/Hook/AddEnableColumnsHook.php @@ -0,0 +1,66 @@ + + * @license GPLv3 + */ + +namespace PAD\CookieconsentPlus\Hook; + +use TYPO3\CMS\Core\Domain\Repository\PageRepository; +use PAD\CookieconsentPlus\Cookie\CookieConstraint; + +class AddEnableColumnsHook +{ + /** + * Returns clause where conditions for cookies + * + * @param array $params + * @param PageRepository $pageRepository + * @return string + */ + public function addAdditionalWhereConditions(array $params, PageRepository $pageRepository): string + { + $conditions = ''; + $enableColumns = $params['ctrl']['enablecolumns']; + if (isset($enableColumns['cookiesdependent_iscookiesdependent']) && $enableColumns['cookiesdependent_iscookiesdependent'] && + isset($enableColumns['cookiesdependent_conditiontype']) && $enableColumns['cookiesdependent_conditiontype'] && + isset($enableColumns['cookiesdependent_statisticscondition']) && $enableColumns['cookiesdependent_statisticscondition'] && + isset($enableColumns['cookiesdependent_marketingcondition']) && $enableColumns['cookiesdependent_marketingcondition']) + { + $table = $params['table']; + $enableFields = [ + 'iscookiesdependent' => $table . '.' . $enableColumns['cookiesdependent_iscookiesdependent'], + 'conditiontype' => $table . '.' . $enableColumns['cookiesdependent_conditiontype'], + 'statisticscondition' => $table . '.' . $enableColumns['cookiesdependent_statisticscondition'], + 'marketingcondition' => $table . '.' . $enableColumns['cookiesdependent_marketingcondition'], + ]; + $conditions = CookieConstraint::getCookiesConstraints($table, $enableFields); + } + return $conditions; + } +} diff --git a/Classes/Xclass/PageRepository.php b/Classes/Xclass/PageRepository.php deleted file mode 100644 index 49e4de3..0000000 --- a/Classes/Xclass/PageRepository.php +++ /dev/null @@ -1,150 +0,0 @@ - - * @license GPLv3 - */ - -namespace PAD\CookieconsentPlus\Xclass; - -use \PAD\CookieconsentPlus\Cookie\CookieManager; -use \TYPO3\CMS\Core\Database\ConnectionPool; -use \TYPO3\CMS\Core\Utility\GeneralUtility; -use \TYPO3\CMS\Core\Domain\Repository\PageRepository as CmsPageRepository; - -class PageRepository extends CmsPageRepository -{ - const ISCOOKIESDEPENDENT_FIELD = 'tx_cookieconsentplus_iscookiesdependent'; - const ISCOOKIESDEPENDENT_OFF = 0; - const ISCOOKIESDEPENDENT_ON = 1; - const CONDITIONTYPE_FIELD = 'tx_cookieconsentplus_conditiontype'; - const CONDITIONTYPE_VALUE_SHOWAND = 'showand'; - const CONDITIONTYPE_VALUE_SHOWOR = 'showor'; - const CONDITIONTYPE_VALUE_HIDEAND = 'hideand'; - const CONDITIONTYPE_VALUE_HIDEOR = 'hideor'; - const STATISTICSCONDITION_FIELD = 'tx_cookieconsentplus_statisticscondition'; - const MARKETINGCONDITION_FIELD = 'tx_cookieconsentplus_marketingcondition'; - const CONDITION_VALUE_ANYVALUE = 'anyvalue'; - const CONDITION_VALUE_DENIED = 'denied'; - const CONDITION_VALUE_ACCEPTED = 'accepted'; - - protected $allowedTables = [ - 'pages', - 'tt_content', - ]; - - /** - * Returns enable fields (constraints) for cookies dependency - * - * @param string $table - table on which to create the query - * @return string - */ - protected function getCookiesEnableFields($table): string - { - $constraints = []; - if (in_array($table, $this->allowedTables)) { - $cookieManager = GeneralUtility::makeInstance(CookieManager::class); - $isStatisticsOn = $cookieManager->isStatisticsOn(); - $isMarketingOn = $cookieManager->isMarketingOn(); - $statisticsValues = [ - self::CONDITION_VALUE_ANYVALUE, - $isStatisticsOn ? self::CONDITION_VALUE_ACCEPTED : self::CONDITION_VALUE_DENIED, - ]; - $marketingValues = [ - self::CONDITION_VALUE_ANYVALUE, - $isMarketingOn ? self::CONDITION_VALUE_ACCEPTED : self::CONDITION_VALUE_DENIED, - ]; - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); - $expressionBuilder = $queryBuilder->expr(); - $statisticsValues = array_map([$expressionBuilder, 'literal'], $statisticsValues); - $marketingValues = array_map([$expressionBuilder, 'literal'], $marketingValues); - $constraints[] = $expressionBuilder->eq( - self::ISCOOKIESDEPENDENT_FIELD, - self::ISCOOKIESDEPENDENT_OFF - ); - $constraints[] = $expressionBuilder->andX( - $expressionBuilder->eq( - self::ISCOOKIESDEPENDENT_FIELD, - self::ISCOOKIESDEPENDENT_ON - ), - $expressionBuilder->eq( - self::CONDITIONTYPE_FIELD, - $expressionBuilder->literal(self::CONDITIONTYPE_VALUE_SHOWAND) - ), - $expressionBuilder->andX( - $expressionBuilder->in( - self::STATISTICSCONDITION_FIELD, - $statisticsValues - ), - $expressionBuilder->in( - self::MARKETINGCONDITION_FIELD, - $marketingValues - ), - ) - ); - $constraints[] = $expressionBuilder->andX( - $expressionBuilder->eq( - self::ISCOOKIESDEPENDENT_FIELD, - self::ISCOOKIESDEPENDENT_ON - ), - $expressionBuilder->eq( - self::CONDITIONTYPE_FIELD, - $expressionBuilder->literal(self::CONDITIONTYPE_VALUE_SHOWOR) - ), - $expressionBuilder->orX( - $expressionBuilder->in( - self::STATISTICSCONDITION_FIELD, - $statisticsValues - ), - $expressionBuilder->in( - self::MARKETINGCONDITION_FIELD, - $marketingValues - ), - ) - ); - } - return strval($expressionBuilder->orX(...$constraints)); - } - - /** - * {@inheritdoc} - * - * In addition cookies sql constraints - * are added to enableFields query - */ - public function enableFields($table, $show_hidden = -1, $ignore_array = [], $noVersionPreview = false): string - { - $enableFields = parent::enableFields($table, $show_hidden, $ignore_array, $noVersionPreview); - if (in_array($table, $this->allowedTables)) { - $cookiesEnableFields = $this->getCookiesEnableFields($table); - if (!empty($cookiesEnableFields)) { - $enableFields .= ' AND (' . $cookiesEnableFields . ')'; - } - } - return $enableFields; - } -} diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php index bd040a1..0853d3c 100644 --- a/Configuration/TCA/Overrides/pages.php +++ b/Configuration/TCA/Overrides/pages.php @@ -1,12 +1,13 @@ [ 'label' => $ll . 'tx_cookieconsentplus_iscookiesdependent', + 'description' => $ll . 'tx_cookieconsentplus_iscookiesdependent.description', 'exclude' => 0, 'l10n_mode' => 'exclude', 'l10n_display' => 'defaultAsReadonly', @@ -17,6 +18,7 @@ ], 'tx_cookieconsentplus_conditiontype' => [ 'label' => $ll . 'tx_cookieconsentplus_conditiontype', + 'description' => $ll . 'tx_cookieconsentplus_conditiontype.description', 'exclude' => 0, 'l10n_mode' => 'exclude', 'l10n_display' => 'defaultAsReadonly', @@ -38,6 +40,7 @@ ], 'tx_cookieconsentplus_statisticscondition' => [ 'label' => $ll . 'tx_cookieconsentplus_statisticscondition', + 'description' => $ll . 'tx_cookieconsentplus_statisticscondition.description', 'exclude' => 0, 'l10n_mode' => 'exclude', 'l10n_display' => 'defaultAsReadonly', @@ -63,6 +66,7 @@ ], 'tx_cookieconsentplus_marketingcondition' => [ 'label' => $ll . 'tx_cookieconsentplus_marketingcondition', + 'description' => $ll . 'tx_cookieconsentplus_marketingcondition.description', 'exclude' => 0, 'l10n_mode' => 'exclude', 'l10n_display' => 'defaultAsReadonly', @@ -100,3 +104,7 @@ '', 'after:nav_hide' ); +$GLOBALS['TCA']['pages']['ctrl']['enablecolumns']['cookiesdependent_iscookiesdependent'] = 'tx_cookieconsentplus_iscookiesdependent'; +$GLOBALS['TCA']['pages']['ctrl']['enablecolumns']['cookiesdependent_conditiontype'] = 'tx_cookieconsentplus_conditiontype'; +$GLOBALS['TCA']['pages']['ctrl']['enablecolumns']['cookiesdependent_statisticscondition'] = 'tx_cookieconsentplus_statisticscondition'; +$GLOBALS['TCA']['pages']['ctrl']['enablecolumns']['cookiesdependent_marketingcondition'] = 'tx_cookieconsentplus_marketingcondition'; diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index d1396b0..c6af9de 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -1,12 +1,13 @@ [ 'label' => $ll . 'tx_cookieconsentplus_iscookiesdependent', + 'description' => $ll . 'tx_cookieconsentplus_iscookiesdependent.description', 'exclude' => 0, 'l10n_mode' => 'exclude', 'l10n_display' => 'defaultAsReadonly', @@ -17,6 +18,7 @@ ], 'tx_cookieconsentplus_conditiontype' => [ 'label' => $ll . 'tx_cookieconsentplus_conditiontype', + 'description' => $ll . 'tx_cookieconsentplus_conditiontype.description', 'exclude' => 0, 'l10n_mode' => 'exclude', 'l10n_display' => 'defaultAsReadonly', @@ -38,6 +40,7 @@ ], 'tx_cookieconsentplus_statisticscondition' => [ 'label' => $ll . 'tx_cookieconsentplus_statisticscondition', + 'description' => $ll . 'tx_cookieconsentplus_statisticscondition.description', 'exclude' => 0, 'l10n_mode' => 'exclude', 'l10n_display' => 'defaultAsReadonly', @@ -63,6 +66,7 @@ ], 'tx_cookieconsentplus_marketingcondition' => [ 'label' => $ll . 'tx_cookieconsentplus_marketingcondition', + 'description' => $ll . 'tx_cookieconsentplus_marketingcondition.description', 'exclude' => 0, 'l10n_mode' => 'exclude', 'l10n_display' => 'defaultAsReadonly', @@ -100,3 +104,7 @@ '', 'after:hidden' ); +$GLOBALS['TCA']['tt_content']['ctrl']['enablecolumns']['cookiesdependent_iscookiesdependent'] = 'tx_cookieconsentplus_iscookiesdependent'; +$GLOBALS['TCA']['tt_content']['ctrl']['enablecolumns']['cookiesdependent_conditiontype'] = 'tx_cookieconsentplus_conditiontype'; +$GLOBALS['TCA']['tt_content']['ctrl']['enablecolumns']['cookiesdependent_statisticscondition'] = 'tx_cookieconsentplus_statisticscondition'; +$GLOBALS['TCA']['tt_content']['ctrl']['enablecolumns']['cookiesdependent_marketingcondition'] = 'tx_cookieconsentplus_marketingcondition'; diff --git a/Documentation/Cache/Index.rst b/Documentation/Cache/Index.rst new file mode 100644 index 0000000..39b63ad --- /dev/null +++ b/Documentation/Cache/Index.rst @@ -0,0 +1,18 @@ +.. include:: ../Includes.txt + + +.. _cache: + +==== +Cache +==== + +| Page content is updated when the page cache expires. +When the frontend user changes the status of the cookies, +page contents (included navigation menu) are not immediately updated until the cache expires. +The page is immediately unavailable (HTML error 404), +but any navigation menu and CE will continue to show them, due to cache. + +.. note:: It is suggested to define a very small page :guilabel:`Cache Lifetime`, so that the menus and page contents are updated as quickly as possible. + + diff --git a/Documentation/Changelog/Index.rst b/Documentation/Changelog/Index.rst index 9ab27a6..48e4b74 100644 --- a/Documentation/Changelog/Index.rst +++ b/Documentation/Changelog/Index.rst @@ -9,6 +9,18 @@ Changelog All notable changes will be documented in this file. +[0.3.0] - 2023-10-27 +#### + +Added +**** +* Query restrictions for QueryBuilder +* WHERE clause for custom EnableColumns + +Removed +**** +* XCLASS: PAD\\CookieconsentPlus\\Xclass\\PageRepository + [0.2.0] - 2022-01-08 #### diff --git a/Documentation/Configuration/Index.rst b/Documentation/Configuration/Index.rst index bc31399..5e03df9 100644 --- a/Documentation/Configuration/Index.rst +++ b/Documentation/Configuration/Index.rst @@ -10,4 +10,4 @@ Configuration This extension needs no configuration. Configuration is required for dp_cookieconsent extension -(`see `_) +(`see `_) diff --git a/Documentation/Development/Index.rst b/Documentation/Development/Index.rst new file mode 100644 index 0000000..0a1cf4b --- /dev/null +++ b/Documentation/Development/Index.rst @@ -0,0 +1,69 @@ +.. include:: ../Includes.txt + + +.. _development: + + +==== +Develompment +==== + +The extension adds four custom enable fields: + +* :php:`cookiesdependent_iscookiesdependent`: :guilabel:`Is cookie-dependent` [tx_cookieconsentplus_iscookiesdependent] +* :php:`cookiesdependent_conditiontype`: :guilabel:`Conditions evaluation type` [tx_cookieconsentplus_conditiontype] +* :php:`cookiesdependent_statisticscondition`: :guilabel:`Statistics cookies are` [tx_cookieconsentplus_statisticscondition] +* :php:`cookiesdependent_marketingcondition`: :guilabel:`Marketing cookies are` [tx_cookieconsentplus_marketingcondition] + +| Current version of extension adds *cookies-dependent enable fields* only to pages (pages) and content element (tt_content) tables. +| *Cookies-dependent enable fields* can be added to each other table (record). +| The extension provides cookies-dependent restriction in QueryBuilder. Restriction can be disabled. + + +.. _development-core-table-cookies-dependent-enable-fields: + +Add cookies-dependent enable fields in core table +==== + +To add, for example, the *cookies-dependent enable fields* to category record (sys_category table), in your extension, +add a new file :file:`Configuration/TCA/Override/sys_category.php` + +.. literalinclude:: _TCAOverrideSysCategory.php + :language: php + :caption: EXT:my_extension/Classes/Configuration/TCA/Override/sys_category.php + +Then add fields to table in the database. In :file:`ext_tables.php` append + +.. literalinclude:: _extTableSysCategory.sql + :language: sql + :caption: EXT:my_extension/ext_tables.sql + + +Add cookies-dependent enable fields in custom table +==== + +Just like in core table +:ref:`development-core-table-cookies-dependent-enable-fields`: +simply change 'sys_category' table name with your table name. + + + +Disable QueryBuilder cookies-dependent restriction, overall system +==== + +To disable QueryBuilder cookies-dependent restriction, you have to append in your :file:`ext_localconf.php` this line + +.. literalinclude:: _extLocalcontDisableQueryBuilderRestriction.php + :language: php + :caption: EXT:my_extension/ext_localconf.php + + +How to remove cookies-dependent restriction in QueryBuilder +==== + +Cookies-dependent restriction can be removed just like built-in restrictions + +.. literalinclude:: _removeRestrictionQueryBuilder.php + :language: php + :caption: EXT:my_extension/Classes/.../MyClass.php + diff --git a/Documentation/Development/_TCAOverrideSysCategory.php b/Documentation/Development/_TCAOverrideSysCategory.php new file mode 100644 index 0000000..59adeee --- /dev/null +++ b/Documentation/Development/_TCAOverrideSysCategory.php @@ -0,0 +1,110 @@ + [ + 'label' => $ll . 'tx_cookieconsentplus_iscookiesdependent', + 'description' => $ll . 'tx_cookieconsentplus_iscookiesdependent.description', + 'exclude' => 0, + 'l10n_mode' => 'exclude', + 'l10n_display' => 'defaultAsReadonly', + 'config' => [ + 'type' => 'check', + ], + 'onChange' => 'reload', + ], + 'tx_cookieconsentplus_conditiontype' => [ + 'label' => $ll . 'tx_cookieconsentplus_conditiontype', + 'description' => $ll . 'tx_cookieconsentplus_conditiontype.description', + 'exclude' => 0, + 'l10n_mode' => 'exclude', + 'l10n_display' => 'defaultAsReadonly', + 'displayCond' => 'FIELD:tx_cookieconsentplus_iscookiesdependent:=:1', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'items' => [ + [ + $ll . 'tx_cookieconsentplus_conditiontype.showand', + 'showand' + ], + [ + $ll . 'tx_cookieconsentplus_conditiontype.showor', + 'showor' + ], + ], + ], + ], + 'tx_cookieconsentplus_statisticscondition' => [ + 'label' => $ll . 'tx_cookieconsentplus_statisticscondition', + 'description' => $ll . 'tx_cookieconsentplus_statisticscondition.description', + 'exclude' => 0, + 'l10n_mode' => 'exclude', + 'l10n_display' => 'defaultAsReadonly', + 'displayCond' => 'FIELD:tx_cookieconsentplus_iscookiesdependent:=:1', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'items' => [ + [ + $ll . 'tx_cookieconsentplus_conditionvalue.anyvalue', + 'anyvalue' + ], + [ + $ll . 'tx_cookieconsentplus_conditionvalue.denied', + 'denied' + ], + [ + $ll . 'tx_cookieconsentplus_conditionvalue.accepted', + 'accepted' + ], + ], + ], + ], + 'tx_cookieconsentplus_marketingcondition' => [ + 'label' => $ll . 'tx_cookieconsentplus_marketingcondition', + 'description' => $ll . 'tx_cookieconsentplus_marketingcondition.description', + 'exclude' => 0, + 'l10n_mode' => 'exclude', + 'l10n_display' => 'defaultAsReadonly', + 'displayCond' => 'FIELD:tx_cookieconsentplus_iscookiesdependent:=:1', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'items' => [ + [ + $ll . 'tx_cookieconsentplus_conditionvalue.anyvalue', + 'anyvalue' + ], + [ + $ll . 'tx_cookieconsentplus_conditionvalue.denied', + 'denied' + ], + [ + $ll . 'tx_cookieconsentplus_conditionvalue.accepted', + 'accepted' + ], + ], + ], + ], +]; +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_category', $newFields); +$GLOBALS['TCA']['sys_category']['palettes']['cookiesdependent'] = [ + 'label' => $ll . 'tx_cookieconsentplus_iscookiesdependent.label', + 'showitem' => 'tx_cookieconsentplus_iscookiesdependent, + --linebreak--, tx_cookieconsentplus_conditiontype, + --linebreak--, tx_cookieconsentplus_statisticscondition, tx_cookieconsentplus_marketingcondition', +]; +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes( + 'sys_category', + '--palette--;;cookiesdependent', + '', + 'after:hidden' +); +$GLOBALS['TCA']['sys_category']['ctrl']['enablecolumns']['cookiesdependent_iscookiesdependent'] = 'tx_cookieconsentplus_iscookiesdependent'; +$GLOBALS['TCA']['sys_category']['ctrl']['enablecolumns']['cookiesdependent_conditiontype'] = 'tx_cookieconsentplus_conditiontype'; +$GLOBALS['TCA']['sys_category']['ctrl']['enablecolumns']['cookiesdependent_statisticscondition'] = 'tx_cookieconsentplus_statisticscondition'; +$GLOBALS['TCA']['sys_category']['ctrl']['enablecolumns']['cookiesdependent_marketingcondition'] = 'tx_cookieconsentplus_marketingcondition'; diff --git a/Documentation/Development/_extLocalcontDisableQueryBuilderRestriction.php b/Documentation/Development/_extLocalcontDisableQueryBuilderRestriction.php new file mode 100644 index 0000000..f499079 --- /dev/null +++ b/Documentation/Development/_extLocalcontDisableQueryBuilderRestriction.php @@ -0,0 +1,11 @@ +getQueryBuilderForTable('my_table'); + $queryBuilder->getRestrictions()->removeByType(CookieRestriction::class); + + // ... + } +} diff --git a/Documentation/Index.rst b/Documentation/Index.rst index 1a895d2..941baba 100644 --- a/Documentation/Index.rst +++ b/Documentation/Index.rst @@ -58,6 +58,8 @@ on the top right to submit your change request. Installation/Index Configuration/Index Setup/Index + Development/Index + Cache/Index Changelog/Index Contributing/Index Links/Index diff --git a/Documentation/Introduction/Index.rst b/Documentation/Introduction/Index.rst index fb25331..f4047a5 100644 --- a/Documentation/Introduction/Index.rst +++ b/Documentation/Introduction/Index.rst @@ -43,4 +43,7 @@ Screenshots :alt: content element cookies dependency | -.. note:: This extension uses XCLASSES to extend core. +.. note:: | *XCLASS has been removed.* + | **Fully re-engineered with query restriction and custom TCA enable columns.** + + diff --git a/Documentation/Settings.cfg b/Documentation/Settings.cfg index 5c371db..9767127 100644 --- a/Documentation/Settings.cfg +++ b/Documentation/Settings.cfg @@ -27,8 +27,8 @@ project = Cookie Consent Plus # ... (recommended) version, displayed next to title (desktop) and in - - -
- - - Sets the visibility of the page with respect to the denial or acceptance of cookies or part of them - Legt die Sichtbarkeit der Seite in Bezug auf die Ablehnung oder Annahme von Cookies fest - - - - -
  • - show if ALL conditions: makes the page visible if all below conditions are verified: statistics and marketing -
  • -
  • - show if AT LEAST ONE condition: makes the page visible if at least one of below conditions is verified: statistics or marketing -
  • - - ]]> - - - -
  • - anzeigen wenn ALLE zutreffen: macht die Seite sichtbar, wenn alle folgenden Bedingungen erfüllt sind: Statistik und Marketing -
  • -
  • - anzeigen wenn EINS zutrifft: macht die Seite sichtbar, wenn mindestens eine der folgenden Bedingungen erfüllt ist: Statistik oder Marketing -
  • - - ]]> -
    -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if statistics cookies are denied -
  • -
  • - accepted: true if statistics cookies are accepted -
  • - - ]]> - - - -
  • - vorhanden: immer wahr -
  • -
  • - abgelehnt: wahr, wenn Statistik Cookies nicht zugestimmt wurde -
  • -
  • - zugestimmt: wahr, wenn Statistik Cookies zugestimmt wurde -
  • - - ]]> -
    -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if marketing cookies are denied -
  • -
  • - accepted: true if marketing cookies are accepted -
  • - - ]]> - - - -
  • - vorhanden: immer wahr -
  • -
  • - abgelehnt: wahr, wenn Marketing Cookies nicht zugestimmt wurde -
  • -
  • - zugestimmt: wahr, wenn Marketing Cookies zugestimmt wurde -
  • - - ]]> -
    -
    - - - diff --git a/Resources/Private/Language/de.locallang_csh_ttcontent.xlf b/Resources/Private/Language/de.locallang_csh_ttcontent.xlf deleted file mode 100644 index ee8e791..0000000 --- a/Resources/Private/Language/de.locallang_csh_ttcontent.xlf +++ /dev/null @@ -1,113 +0,0 @@ - - - -
    - - - Sets the visibility of the content element with respect to the denial or acceptance of cookies or part of them - Legt die Sichtbarkeit der Inhaltselemente in Bezug auf die Ablehnung oder Annahme von Cookies fest - - - - -
  • - show if ALL conditions: makes the content element visible if all below conditions are verified: statistics and marketing -
  • -
  • - show if AT LEAST ONE condition: makes the content element visible if at least one of below conditions is verified: statistics or marketing -
  • - - ]]> - - - -
  • - anzeigen wenn ALLE zutreffen: macht das Inhaltselement sichtbar, wenn alle folgenden Bedingungen erfüllt sind: Statistik und Marketing -
  • -
  • - anzeigen wenn EINS zutrifft: macht das Inhaltselement sichtbar, wenn mindestens eine der folgenden Bedingungen erfüllt ist: Statistik oder Marketing -
  • - - ]]> -
    -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if statistics cookies are denied -
  • -
  • - accepted: true if statistics cookies are accepted -
  • - - ]]> - - - -
  • - vorhanden: immer wahr -
  • -
  • - abgelehnt: wahr, wenn Statistik Cookies nicht zugestimmt wurde -
  • -
  • - zugestimmt: wahr, wenn Statistik Cookies zugestimmt wurde -
  • - - ]]> -
    -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if marketing cookies are denied -
  • -
  • - accepted: true if marketing cookies are accepted -
  • - - ]]> - - - -
  • - vorhanden: immer wahr -
  • -
  • - abgelehnt: wahr, wenn Marketing Cookies nicht zugestimmt wurde -
  • -
  • - zugestimmt: wahr, wenn Marketing Cookies zugestimmt wurde -
  • - - ]]> -
    -
    - - - diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index a3c9993..4663899 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -16,10 +16,18 @@ Is cookie-dependent Ist abhängig von Cookies + + Sets the visibility of the page with respect to the denial or acceptance of cookies or part of them + Legt die Sichtbarkeit der Seite in Bezug auf die Ablehnung oder Annahme von Cookies fest + Conditions evaluation type Bedingungsart + + Sets the evaluation type - [show if ALL conditions] makes the page visible if all below conditions are verified: statistics and marketing. [show if AT LEAST ONE condition] makes the page visible if at least one of below conditions is verified: statistics or marketing. + Legt den Bedingungsart fest - [anzeigen wenn ALLE zutreffen] macht die Seite sichtbar, wenn alle folgenden Bedingungen erfüllt sind: Statistik und Marketing. [anzeigen wenn EINS zutrifft] macht die Seite sichtbar, wenn mindestens eine der folgenden Bedingungen erfüllt ist: Statistik oder Marketing. + show if ALL conditions anzeigen wenn alle zutreffen @@ -32,10 +40,18 @@ Statistics cookies are Statistik Cookies sind + + Statistics cookies condition - [any value] always true. [denied] true if statistics cookies are denied. [accepted] true if statistics cookies are accepted. + Statistik Cookies Bedingung - [vorhanden]: immer wahr. [abgelehnt]: wahr, wenn Statistik Cookies nicht zugestimmt wurde. [zugestimmt]: wahr, wenn Statistik Cookies zugestimmt wurde. + Marketing cookies are Marketing Cookies sind + + Marketing cookies condition - [any value] always true. [denied] true if marketing cookies are denied. [accepted] true if marketing cookies are accepted. + Marketing Cookies Bedingung - [vorhanden] immer wahr. [abgelehnt] wahr, wenn Marketing Cookies nicht zugestimmt wurde. [zugestimmt] wahr, wenn Marketing Cookies zugestimmt wurde. + any value vorhanden @@ -56,10 +72,18 @@ Is cookie-dependent Ist abhängig von Cookies + + Sets the visibility of the content element with respect to the denial or acceptance of cookies or part of them + Legt die Sichtbarkeit der Inhaltselemente in Bezug auf die Ablehnung oder Annahme von Cookies fest + Conditions evaluation type Bedingungsart + + Sets the evaluation type - [show if ALL conditions] makes the content element visible if all below conditions are verified: statistics and marketing. [show if AT LEAST ONE condition] makes the content element visible if at least one of below conditions is verified: statistics or marketing. + Legt den Bedingungsart fest - [anzeigen wenn ALLE zutreffen] macht das Inhaltselement sichtbar, wenn alle folgenden Bedingungen erfüllt sind: Statistik und Marketing. [anzeigen wenn EINS zutrifft] macht das Inhaltselement sichtbar, wenn mindestens eine der folgenden Bedingungen erfüllt ist: Statistik oder Marketing. + show if ALL conditions anzeigen wenn alle zutreffen @@ -72,10 +96,18 @@ Statistics cookies are Statistik Cookies sind + + Statistics cookies condition - [any value] always true. [denied] true if statistics cookies are denied. [accepted] true if statistics cookies are accepted. + Statistik Cookies Bedingung - [vorhanden] immer wahr. [abgelehnt] wahr, wenn Statistik Cookies nicht zugestimmt wurde. [zugestimmt] wahr, wenn Statistik Cookies zugestimmt wurde. + Marketing cookies are Marketing Cookies sind + + Marketing cookies condition - [any value] always true. [denied]: true if marketing cookies are denied. [accepted] true if marketing cookies are accepted. + Marketing Cookies Bedingung - [vorhanden] immer wahr. [abgelehnt] wahr, wenn Marketing Cookies nicht zugestimmt wurde. [zugestimmt] wahr, wenn Marketing Cookies zugestimmt wurde. + any value vorhanden diff --git a/Resources/Private/Language/it.locallang_csh_pages.xlf b/Resources/Private/Language/it.locallang_csh_pages.xlf deleted file mode 100644 index d3c105a..0000000 --- a/Resources/Private/Language/it.locallang_csh_pages.xlf +++ /dev/null @@ -1,113 +0,0 @@ - - - -
    - - - Sets the visibility of the page with respect to the denial or acceptance of cookies or part of them - Imposta la visibilità della pagina rispetto alla negazione o accettazione dei cookie o di parte di essi - - - - -
  • - show if ALL conditions: makes the page visible if all below conditions are verified: statistics and marketing -
  • -
  • - show if AT LEAST ONE condition: makes the page visible if at least one of below conditions is verified: statistics or marketing -
  • - - ]]> - - - -
  • - mostra se TUTTE le condizioni: rende la pagina visibile se tutte le condizioni qui sotto sono verificate: obbligatori, statistica e marketing -
  • -
  • - mostra se ALMENO UNA condizione: rende visibile la pagina se almeno una delle condizioni qui sotto è verificata: obbligatori, statistica o marketing -
  • - - ]]> -
    -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if statistics cookies are denied -
  • -
  • - accepted: true if statistics cookies are accepted -
  • - - ]]> - - - -
  • - qualsiasi valore: sempre vera -
  • -
  • - negati: vera se i cookie di statistica sono negati -
  • -
  • - accettati: vera se i cookie di statistica sono accettati -
  • - - ]]> -
    -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if marketing cookies are denied -
  • -
  • - accepted: true if marketing cookies are accepted -
  • - - ]]> - - - -
  • - qualsiasi valore: sempre vera -
  • -
  • - negati: vera se i cookie di marketing sono negati -
  • -
  • - accettati: vera se i cookie di marketing sono accettati -
  • - - ]]> -
    -
    - - - diff --git a/Resources/Private/Language/it.locallang_csh_ttcontent.xlf b/Resources/Private/Language/it.locallang_csh_ttcontent.xlf deleted file mode 100644 index 2489588..0000000 --- a/Resources/Private/Language/it.locallang_csh_ttcontent.xlf +++ /dev/null @@ -1,113 +0,0 @@ - - - -
    - - - Sets the visibility of the content element with respect to the denial or acceptance of cookies or part of them - Imposta la visibilità del contenuto di pagina rispetto alla negazione o accettazione dei cookie o di parte di essi - - - - -
  • - show if ALL conditions: makes the content element visible if all below conditions are verified: statistics and marketing -
  • -
  • - show if AT LEAST ONE condition: makes the content element visible if at least one of below conditions is verified: statistics or marketing -
  • - - ]]> - - - -
  • - mostra se TUTTE le condizioni: rende il contenuto di pagina visibile se tutte le condizioni qui sotto sono verificate: obbligatori, statistica e marketing -
  • -
  • - mostra se ALMENO UNA condizione: rende visibile il contenuto di pagina se almeno una delle condizioni qui sotto è verificata: obbligatori, statistica o marketing -
  • - - ]]> -
    -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if statistics cookies are denied -
  • -
  • - accepted: true if statistics cookies are accepted -
  • - - ]]> - - - -
  • - qualsiasi valore: sempre vera -
  • -
  • - negati: vera se i cookie di statistica sono negati -
  • -
  • - accettati: vera se i cookie di statistica sono accettati -
  • - - ]]> -
    -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if marketing cookies are denied -
  • -
  • - accepted: true if marketing cookies are accepted -
  • - - ]]> - - - -
  • - qualsiasi valore: sempre vera -
  • -
  • - negati: vera se i cookie di marketing sono negati -
  • -
  • - accettati: vera se i cookie di marketing sono accettati -
  • - - ]]> -
    -
    - - - diff --git a/Resources/Private/Language/it.locallang_db.xlf b/Resources/Private/Language/it.locallang_db.xlf index e9cfc9f..7b026cc 100644 --- a/Resources/Private/Language/it.locallang_db.xlf +++ b/Resources/Private/Language/it.locallang_db.xlf @@ -16,10 +16,18 @@ Is cookie-dependent È dipendente dai cookie + + Sets the visibility of the page with respect to the denial or acceptance of cookies or part of them + Imposta la visibilità della pagina rispetto alla negazione o accettazione dei cookie o di parte di essi + Conditions evaluation type Tipo di valutazione condizioni + + Sets the evaluation type - [show if ALL conditions] makes the page visible if all below conditions are verified: statistics and marketing. [show if AT LEAST ONE condition] makes the page visible if at least one of below conditions is verified: statistics or marketing. + Imposta il tipo di valutazione delle condizioni - [mostra se TUTTE le condizioni] rende la pagina visibile se tutte le condizioni qui sotto sono verificate: statistica e marketing. [mostra se ALMENO UNA condizione] rende visibile la pagina se almeno una delle condizioni qui sotto è verificata: statistica o marketing. + show if ALL conditions mostra se TUTTE le condizioni @@ -32,10 +40,18 @@ Statistics cookies are I cookie di statistica sono + + Statistics cookies condition - [any value] always true. [denied] true if statistics cookies are denied. [accepted] true if statistics cookies are accepted. + Condizione cookie di statistica - [qualsiasi valore] sempre vera. [negati] vera se i cookie di statistica sono negati. [accettati] vera se i cookie di statistica sono accettati. + Marketing cookies are I cookie di marketing sono + + Marketing cookies condition - [any value] always true. [denied] true if marketing cookies are denied. [accepted] true if marketing cookies are accepted. + Condizione cookie di marketing - [qualsiasi valore]: sempre vera. [negati]: vera se i cookie di marketing sono negati. [accettati]: vera se i cookie di marketing sono accettati. + any value qualsiasi valore @@ -56,10 +72,18 @@ Is cookie-dependent È dipendente dai cookie + + Sets the visibility of the content element with respect to the denial or acceptance of cookies or part of them + Imposta la visibilità del contenuto di pagina rispetto alla negazione o accettazione dei cookie o di parte di essi + Conditions evaluation type Tipo di valutazione condizioni + + Sets the evaluation type - [show if ALL conditions] makes the content element visible if all below conditions are verified: statistics and marketing. [show if AT LEAST ONE condition] makes the content element visible if at least one of below conditions is verified: statistics or marketing. + Imposta il tipo di valutazione delle condizioni - [mostra se TUTTE le condizioni] rende il contenuto di pagina visibile se tutte le condizioni qui sotto sono verificate: statistica e marketing. [mostra se ALMENO UNA condizione] rende visibile il contenuto di pagina se almeno una delle condizioni qui sotto è verificata: statistica o marketing. + show if ALL conditions mostra se TUTTE le condizioni @@ -72,10 +96,18 @@ Statistics cookies are I cookie di statistica sono + + Statistics cookies condition - [any value] always true. [denied] true if statistics cookies are denied. [accepted] true if statistics cookies are accepted. + Condizione cookie di statistica - [qualsiasi valore]: sempre vera. [negati]: vera se i cookie di statistica sono negati. [accettati] vera se i cookie di statistica sono accettati. + Marketing cookies are I cookie di marketing sono + + Marketing cookies condition - [any value] always true. [denied]: true if marketing cookies are denied. [accepted] true if marketing cookies are accepted. + Condizione cookie di marketing - [qualsiasi valore] sempre vera. [negati] vera se i cookie di marketing sono negati. [accettati] vera se i cookie di marketing sono accettati. + any value qualsiasi valore diff --git a/Resources/Private/Language/locallang_csh_pages.xlf b/Resources/Private/Language/locallang_csh_pages.xlf deleted file mode 100644 index a5dc71f..0000000 --- a/Resources/Private/Language/locallang_csh_pages.xlf +++ /dev/null @@ -1,66 +0,0 @@ - - - -
    - - - Sets the visibility of the page with respect to the denial or acceptance of cookies or part of them - - - - -
  • - show if ALL conditions: makes the page visible if all below conditions are verified: statistics and marketing -
  • -
  • - show if AT LEAST ONE condition: makes the page visible if at least one of below conditions is verified: statistics or marketing -
  • - - ]]> - -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if statistics cookies are denied -
  • -
  • - accepted: true if statistics cookies are accepted -
  • - - ]]> - -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if marketing cookies are denied -
  • -
  • - accepted: true if marketing cookies are accepted -
  • - - ]]> - -
    - - - diff --git a/Resources/Private/Language/locallang_csh_ttcontent.xlf b/Resources/Private/Language/locallang_csh_ttcontent.xlf deleted file mode 100644 index 2c91376..0000000 --- a/Resources/Private/Language/locallang_csh_ttcontent.xlf +++ /dev/null @@ -1,66 +0,0 @@ - - - -
    - - - Sets the visibility of the content element with respect to the denial or acceptance of cookies or part of them - - - - -
  • - show if ALL conditions: makes the content element visible if all below conditions are verified: statistics and marketing -
  • -
  • - show if AT LEAST ONE condition: makes the content element visible if at least one of below conditions is verified: statistics or marketing -
  • - - ]]> - -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if statistics cookies are denied -
  • -
  • - accepted: true if statistics cookies are accepted -
  • - - ]]> - -
    - - - -
  • - any value: always true -
  • -
  • - denied: true if marketing cookies are denied -
  • -
  • - accepted: true if marketing cookies are accepted -
  • - - ]]> - -
    - - - diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index d515bd3..e55ff5a 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -13,9 +13,15 @@ Is cookie-dependent + + Sets the visibility of the page with respect to the denial or acceptance of cookies or part of them + Conditions evaluation type + + Sets the evaluation type - [show if ALL conditions] makes the page visible if all below conditions are verified: statistics and marketing. [show if AT LEAST ONE condition] makes the page visible if at least one of below conditions is verified: statistics or marketing. + show if ALL conditions @@ -25,9 +31,15 @@ Statistics cookies are + + Statistics cookies condition - [any value] always true. [denied] true if statistics cookies are denied. [accepted] true if statistics cookies are accepted. + Marketing cookies are + + Marketing cookies condition - [any value] always true. [denied] true if marketing cookies are denied. [accepted] true if marketing cookies are accepted. + any value @@ -43,9 +55,15 @@ Is cookie-dependent + + Sets the visibility of the content element with respect to the denial or acceptance of cookies or part of them + Conditions evaluation type + + Sets the evaluation type - [show if ALL conditions] makes the content element visible if all below conditions are verified: statistics and marketing. [show if AT LEAST ONE condition] makes the content element visible if at least one of below conditions is verified: statistics or marketing. + show if ALL conditions @@ -55,9 +73,15 @@ Statistics cookies are + + Statistics cookies condition - [any value] always true. [denied] true if statistics cookies are denied. [accepted] true if statistics cookies are accepted. + Marketing cookies are + + Marketing cookies condition - [any value] always true. [denied]: true if marketing cookies are denied. [accepted] true if marketing cookies are accepted. + any value diff --git a/composer.json b/composer.json index bccdd71..4250eea 100644 --- a/composer.json +++ b/composer.json @@ -24,9 +24,9 @@ ], "license": "GPL-3.0-or-later", "require": { - "php" : ">=7.2", - "typo3/cms-core": "^10.4.0||^11.5.0", - "dirkpersky/typo3-dp_cookieconsent": "^11.0.0" + "php" : ">=7.4.1", + "typo3/cms-core": "^11.5.32||^12.4.7", + "dirkpersky/typo3-dp_cookieconsent": ">=12.0.0" }, "autoload": { "psr-4": { diff --git a/ext_emconf.php b/ext_emconf.php index 31d0e6d..449c3da 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -27,27 +27,24 @@ * @license GPLv3 */ -$EM_CONF[$_EXTKEY] = array ( +$EM_CONF[$_EXTKEY] = [ 'title' => 'Cookie Consent Plus', 'description' => 'Cookie Consent Plus adds some new features to Dirk Persky\'s Cookie Consent extension (dp_cookieconsent).', 'category' => 'fe', + 'version' => '1.0.0', 'state' => 'alpha', - 'version' => '0.2.0', - 'clearCacheOnLoad' => true, + 'uploadfolder' => false, + 'clearcacheonload' => true, 'author' => 'Davide Alghi', 'author_email' => 'davide@penguinable.it', 'author_company' => '', 'constraints' => [ 'depends' => [ - 'typo3' => '10.4.0-11.5.99', - 'dp_cookieconsent' => '11.0.0', + 'typo3' => '11.5.32-12.4.99', + 'dp_cookieconsent' => '12.0.0', + 'php' => '7.4.1' ], 'conflicts' => [], 'suggests' => [], ], - 'autoload' => [ - 'psr-4' => [ - 'PAD\\CookieconsentPlus\\' => 'Classes' - ], - ], -); +]; diff --git a/ext_localconf.php b/ext_localconf.php index 1ed63a7..4ac450a 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,6 +1,8 @@ \PAD\CookieconsentPlus\Xclass\PageRepository::class, -]; +// Adds cookies query restriction for QueryBuilder +$GLOBALS['TYPO3_CONF_VARS']['DB']['additionalQueryRestrictions'][\PAD\CookieconsentPlus\Database\Query\Restriction\CookieRestriction::class] ??= []; +// Adds where clause for custom EnableColumns +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['addEnableColumns'][1698385983] = \PAD\CookieconsentPlus\Hook\AddEnableColumnsHook::class . '->addAdditionalWhereConditions'; diff --git a/ext_tables.php b/ext_tables.php index 7ad99ce..90a21ee 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -1,6 +1,8 @@