Skip to content

Commit

Permalink
Merge branch '1.x' into 2.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	contao/languages/en/tl_cookie.xlf
#	contao/languages/fr/tl_cookie.xlf
#	src/GlobalConfig.php
#	src/Resources/config/migrations.yml
#	src/Resources/contao/dca/tl_cookie.php
#	src/Resources/contao/dca/tl_cookie_config.php
#	src/Resources/public/scripts/cookiebar.min.js
  • Loading branch information
zoglo committed Jul 5, 2024
2 parents f84f243 + 8d0f7d1 commit 0d75344
Show file tree
Hide file tree
Showing 25 changed files with 434 additions and 306 deletions.
6 changes: 6 additions & 0 deletions config/migrations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
Oveleon\ContaoCookiebar\Migration\ContaoCookiebarConsentModeMigration:
arguments:
- '@database_connection'
tags:
- { name: contao.migration, priority: 0 }
73 changes: 27 additions & 46 deletions contao/dca/tl_cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
// Palettes
'palettes' => [
'__selector__' => ['type'],
'default' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{description_legend:hide},description,detailDescription;published,checked,disabled;',
'script' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{global_config_legend:hide},globalConfig;sourceUrl,sourceLoadingMode,sourceUrlParameter,sourceVersioning;scriptConfirmed,scriptUnconfirmed,scriptPosition;{description_legend:hide},description,detailDescription;published,checked;',
'template' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{global_config_legend:hide},globalConfig;{template_legend},scriptTemplate,scriptPosition;{description_legend:hide},description,detailDescription;published,checked;',
'googleAnalytics' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{google_analytics_legend},vendorId,scriptConfig;{description_legend:hide},description,detailDescription;published,checked;',
'googleConsentMode' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{google_consent_mode_legend},globalConfig,gcmMode,scriptConfig;{description_legend:hide},description,detailDescription;published,checked;',
'facebookPixel' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{facebook_pixel_legend},vendorId;{description_legend:hide},description,detailDescription;published,checked;',
'matomo' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{matomo_legend},vendorId,vendorUrl,scriptConfig;{description_legend:hide},description,detailDescription;published,checked;',
'matomoTagManager' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{matomo_legend},vendorId,vendorUrl,scriptConfig;{description_legend:hide},description,detailDescription;published,checked;',
'etracker' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{matomo_legend},vendorId,blockCookies,scriptConfig;{description_legend:hide},description,detailDescription;published,checked;',
'iframe' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{iframe_legend},iframeType,blockTemplate,blockDescription;{description_legend:hide},description,detailDescription;published,checked;',
'default' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{description_legend:hide},description,detailDescription;{expert_legend:hide},disabled;{publish_legend},published,checked;',
'script' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{global_config_legend:hide},globalConfig;sourceUrl,sourceLoadingMode,sourceUrlParameter,sourceVersioning;scriptConfirmed,scriptUnconfirmed,scriptPosition;{description_legend:hide},description,detailDescription;{expert_legend:hide},priority;{publish_legend},published,checked;',
'template' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{global_config_legend:hide},globalConfig;{template_legend},scriptTemplate,scriptPosition;{description_legend:hide},description,detailDescription;{expert_legend:hide},priority;{publish_legend},published,checked;',
'googleAnalytics' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{google_analytics_legend},vendorId,scriptConfig;{description_legend:hide},description,detailDescription;{expert_legend:hide},priority;{publish_legend},published,checked;',
'googleConsentMode' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{google_consent_mode_legend},globalConfig,gcmMode,scriptConfig;{description_legend:hide},description,detailDescription;{expert_legend:hide},priority;{publish_legend},published,checked;',
'facebookPixel' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{facebook_pixel_legend},vendorId;{description_legend:hide},description,detailDescription;{expert_legend:hide},priority;{publish_legend},published,checked;',
'matomo' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{matomo_legend},vendorId,vendorUrl,scriptConfig;{description_legend:hide},description,detailDescription;{expert_legend:hide},priority;{publish_legend},published,checked;',
'matomoTagManager' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{matomo_legend},vendorId,vendorUrl,scriptConfig;{description_legend:hide},description,detailDescription;{expert_legend:hide},priority;{publish_legend},published,checked;',
'etracker' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{matomo_legend},vendorId,blockCookies,scriptConfig;{description_legend:hide},description,detailDescription;{expert_legend:hide},priority;{publish_legend},published,checked;',
'iframe' => '{title_legend},title,type,token,showTokens,expireTime,showExpireTime,provider,showProvider;{iframe_legend},iframeType,blockTemplate,blockDescription;{description_legend:hide},description,detailDescription;{expert_legend:hide},priority;{publish_legend},published,checked;',
],

// Fields
Expand Down Expand Up @@ -151,7 +151,7 @@
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => ['mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'w50'],
'eval' => ['rgxp'=>'httpurl', 'mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'description' => [
Expand Down Expand Up @@ -257,11 +257,11 @@
],
'gcmMode' => [
'exclude' => true,
'inputType' => 'select',
'inputType' => 'checkbox',
'options' => ['ad_storage', 'ad_user_data', 'ad_personalization', 'analytics_storage', 'functionality_storage', 'personalization_storage', 'security_storage'],
'reference' => &$GLOBALS['TL_LANG']['tl_cookie'],
'eval' => ['tl_class'=>'w50 clr'],
'sql' => "varchar(32) NOT NULL default ''"
'eval' => ['mandatory'=>true, 'multiple'=>true, 'tl_class'=>'w50 clr'],
'sql' => "varchar(255) NOT NULL default ''"
],
'disabled' => [
'exclude' => true,
Expand All @@ -270,6 +270,12 @@
'eval' => ['tl_class'=>'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'priority' => [
'exclude' => true,
'inputType' => 'text',
'eval' => ['tl_class'=>'w50'],
'sql' => "int(10) NOT NULL default 0"
],
'checked' => [
'exclude' => true,
'filter' => true,
Expand Down Expand Up @@ -297,7 +303,6 @@
'config' => [
'dataContainer' => DC_Table::class,
'ptable' => 'tl_cookie_group',
'switchToEdit' => true,
'enableVersioning' => true,
'markAsCopy' => 'title',
'sql' => [
Expand All @@ -322,39 +327,15 @@
'format' => '%s'
],
'global_operations' => [
'all' => [
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
]
'all'
],
'operations' => [
'edit' => [
'href' => 'act=edit',
'icon' => 'edit.svg'
],
'copy' => [
'href' => 'act=paste&mode=copy',
'icon' => 'copy.svg'
],
'cut' => [
'href' => 'act=paste&mode=cut',
'icon' => 'cut.svg',
'attributes' => 'onclick="Backend.getScrollOffset()"'
],
'delete' => [
'href' => 'act=delete',
'icon' => 'delete.svg',
'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null) . '\'))return false;Backend.getScrollOffset()"',
],
'show' => [
'href' => 'act=show',
'icon' => 'show.svg'
],
'toggle' => [
'href' => 'act=toggle&field=published',
'icon' => 'visible.svg'
]
'edit',
'copy',
'cut',
'delete',
'show',
'toggle'
]
]
];
28 changes: 5 additions & 23 deletions contao/dca/tl_cookie_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
// Config
'config' => [
'dataContainer' => DC_Table::class,
'switchToEdit' => true,
'enableVersioning' => true,
'markAsCopy' => 'title',
'sql' => [
Expand All @@ -153,30 +152,13 @@
'format' => '%s'
],
'global_operations' => [
'all' => [
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
]
'all'
],
'operations' => [
'edit' => [
'href' => 'act=edit',
'icon' => 'edit.svg'
],
'copy' => [
'href' => 'act=paste&mode=copy',
'icon' => 'copy.svg'
],
'delete' => [
'href' => 'act=delete',
'icon' => 'delete.svg',
'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null) . '\'))return false;Backend.getScrollOffset()"'
],
'show' => [
'href' => 'act=show',
'icon' => 'show.svg'
]
'edit',
'copy',
'delete',
'show'
]
]
];
44 changes: 8 additions & 36 deletions contao/dca/tl_cookie_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,44 +91,16 @@
'format' => '%s'
],
'global_operations' => [
'all' => [
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
]
'all'
],
'operations' => [
'edit' => [
'href' => 'act=edit',
'icon' => 'edit.svg'
],
'children' => [
'href' => 'table=tl_cookie',
'icon' => 'children.svg'
],
'copy' => [
'href' => 'act=paste&mode=copy',
'icon' => 'copy.svg',
],
'cut' => [
'href' => 'act=paste&mode=cut',
'icon' => 'cut.svg',
'attributes' => 'onclick="Backend.getScrollOffset()"',
],
'delete' => [
'href' => 'act=delete',
'icon' => 'delete.svg',
'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null) . '\'))return false;Backend.getScrollOffset()"',
],
'toggle' => [
'href' => 'act=toggle&field=published',
'icon' => 'visible.svg',
'showInHeader' => true
],
'show' => [
'href' => 'act=show',
'icon' => 'show.svg'
]
'edit',
'children',
'copy',
'cut',
'delete',
'toggle',
'show'
]
],
];
17 changes: 3 additions & 14 deletions contao/dca/tl_cookie_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,15 @@
'showColumns' => true,
],
'global_operations' => [
'all' => [
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
],
'all',
'export' => [
'href' => 'key=export',
'icon' => 'theme_export.svg'
]
],
'operations' => [
'delete' => [
'href' => 'act=delete',
'icon' => 'delete.svg',
'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null) . '\'))return false;Backend.getScrollOffset()"'
],
'show' => [
'href' => 'act=show',
'icon' => 'show.svg'
]
'delete',
'show'
]
]
];
32 changes: 6 additions & 26 deletions contao/dca/tl_cookiebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,34 +184,14 @@
'href' => 'table=tl_cookie_log',
'icon' => 'diff.svg'
],
'all' => [
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
]
'all'
],
'operations' => [
'edit' => [
'href' => 'act=edit',
'icon' => 'edit.svg'
],
'children' => [
'href' => 'table=tl_cookie_group',
'icon' => 'children.svg'
],
'copy' => [
'href' => 'act=copy',
'icon' => 'copy.svg'
],
'delete' => [
'href' => 'act=delete',
'icon' => 'delete.svg',
'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null) . '\'))return false;Backend.getScrollOffset()"',
],
'show' => [
'href' => 'act=show',
'icon' => 'show.svg'
]
'edit',
'children',
'copy',
'delete',
'show'
]
],
];
32 changes: 24 additions & 8 deletions contao/languages/de/tl_cookie.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
<source>iFrame</source>
<target>iFrame</target>
</trans-unit>
<trans-unit id="tl_cookie.expert_legend">
<source>Expert settings</source>
<target>Experteneinstellungen</target>
</trans-unit>
<trans-unit id="tl_cookie.publish_legend">
<source>Publish settings</source>
<target>Veröffentlichung</target>
</trans-unit>
<trans-unit id="tl_cookie.title.0">
<source>Title</source>
<target>Titel</target>
Expand Down Expand Up @@ -241,12 +249,12 @@
<target>Geben Sie hier Ihre Mess-ID, Container-ID oder Google Analytics ID ein.</target>
</trans-unit>
<trans-unit id="tl_cookie.googleConsentMode_vendorId.0">
<source>Google Tag Manager ID</source>
<target>Google Tag Manager ID</target>
<source>Tag ID</source>
<target>Tag ID</target>
</trans-unit>
<trans-unit id="tl_cookie.googleConsentMode_vendorId.1">
<source>Enter your Google Tag Manager ID here.</source>
<target>Geben Sie hier Ihre Google Tag Manager ID ein.</target>
<source>Enter your Tag ID here.</source>
<target>Geben Sie hier Ihre Tag ID ein.</target>
</trans-unit>
<trans-unit id="tl_cookie.facebookPixel_vendorId.0">
<source>Facebook-ID</source>
Expand Down Expand Up @@ -313,12 +321,12 @@
<target>Globale Konfigurationen werden je nach Einstellung direkt beim betreten der Seite und ohne Bestätigung ausgeführt. Nützlich für Google Consent Mode o. ä. Skripte, welche bereits ohne Zustimmung ausgeführt werden dürfen.</target>
</trans-unit>
<trans-unit id="tl_cookie.gcmMode.0">
<source>Consent mode</source>
<target>Einwilligungsmodus</target>
<source>Consents</source>
<target>Einwilligungen</target>
</trans-unit>
<trans-unit id="tl_cookie.gcmMode.1">
<source>Define the consent mode here. If you want to ask for multiple consents through Google Consent Mode, please create another cookie type of Google Consent Mode.</source>
<target>Definieren Sie hier den Einwilligungsmodus. Sollten Sie mehrere Einwilligungen über den Google Consent Mode abfragen wollen, legen Sie bitte einen weiteren Cookie-Typen vom Typ Google Consent Mode an.</target>
<source>Here you can select the consents.</source>
<target>Hier können Sie die Einwilligungen auswählen.</target>
</trans-unit>
<trans-unit id="tl_cookie.tokenConfig_xlabel">
<source>Insert default token</source>
Expand Down Expand Up @@ -577,6 +585,14 @@
<source>Publish/unpublish cookie ID %s</source>
<target>Cookie ID %s veröffentlichen/unveröffentlichen</target>
</trans-unit>
<trans-unit id="tl_cookie.priority.0">
<source>Priority</source>
<target>Priorität</target>
</trans-unit>
<trans-unit id="tl_cookie.priority.1">
<source>Optionally configure the priority to affect the order of scripts. Default: 0</source>
<target>Optional kann die Priorität konfiguriert werden, um die Reihenfolge der Skripte zu beeinflussen. Standard: 0</target>
</trans-unit>
<trans-unit id="tl_cookie.editGlobalConfig">
<source>Edit global configuration</source>
<target>Globale Konfiguration bearbeiten</target>
Expand Down
Loading

0 comments on commit 0d75344

Please sign in to comment.