diff --git a/psgdpr.php b/psgdpr.php index ecd47512..9d82a284 100755 --- a/psgdpr.php +++ b/psgdpr.php @@ -311,9 +311,10 @@ public function getContent() 'id_shop' => $id_shop, 'module_version' => $this->version, 'moduleAdminLink' => $moduleAdminLink, + 'link' => $this->context->link, 'id_lang' => $id_lang, 'api_controller' => $this->getAdminLinkWithoutToken($apiController), - 'admin_token' => $this->getTokenFromAdminLink($apiController), + 'admin_token' => Tools::getAdminTokenLite('AdminModules'), 'faq' => $this->loadFaq(), 'doc' => $this->getReadmeByLang($isoLang), 'youtubeLink' => $this->getYoutubeLinkByLang($isoLang), @@ -357,24 +358,6 @@ private function getAdminLinkWithoutToken(string $link): string return substr($link, 0, $pos); } - /** - * Get token from an admin controller link - * - * @param string $link - * - * @return string - */ - public function getTokenFromAdminLink(string $link): string - { - parse_str((string) parse_url($link, PHP_URL_QUERY), $result); - - if (is_array($result['_token'])) { - throw new \PrestaShopException('Invalid token'); - } - - return $result['_token']; - } - /** * load dependencies in the configuration of the module * diff --git a/views/js/menu.js b/views/js/menu.js index 7856c28a..35e58238 100755 --- a/views/js/menu.js +++ b/views/js/menu.js @@ -19,6 +19,12 @@ $(window).ready(function () { moduleAdminLink = moduleAdminLink.replace(/\amp;/g, ""); + function setQueryParameter(url, key, value) { + const u = new URL(url, window.location.origin); + u.searchParams.set(key, value); + return u.toString(); + } + window.vMenu = new Vue({ el: "#psgdpr-menu", data: { @@ -27,7 +33,7 @@ $(window).ready(function () { methods: { makeActive: function (item) { this.selectedTabName = item; - window.history.pushState({}, "", moduleAdminLink + "&page=" + item); + window.history.pushState({}, "", setQueryParameter(moduleAdminLink, "page", item)); }, isActive: function (item) { if (this.selectedTabName == item) { diff --git a/views/templates/admin/tabs/dataConfig.tpl b/views/templates/admin/tabs/dataConfig.tpl index cec185f4..a76b26c8 100755 --- a/views/templates/admin/tabs/dataConfig.tpl +++ b/views/templates/admin/tabs/dataConfig.tpl @@ -13,15 +13,14 @@ * to license@prestashop.com so we can send you a copy immediately. * * @author PrestaShop SA - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) - *} - +* @copyright Since 2007 PrestaShop SA and Contributors +* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) +*}

{l s='Data visualization and automatic actions' d='Modules.Psgdpr.Admin'} {$module_display|escape:'htmlall':'UTF-8'}

-
+

{l s='Find here listed all personal data collected by PrestaShop and your installed modules.' d='Modules.Psgdpr.Admin'}

{l s='These data will be used at 2 different levels :' d='Modules.Psgdpr.Admin'}

diff --git a/views/templates/admin/tabs/dataConsent.tpl b/views/templates/admin/tabs/dataConsent.tpl index 309aff5f..bc966a99 100755 --- a/views/templates/admin/tabs/dataConsent.tpl +++ b/views/templates/admin/tabs/dataConsent.tpl @@ -13,14 +13,14 @@ * to license@prestashop.com so we can send you a copy immediately. * * @author PrestaShop SA - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) - *} +* @copyright Since 2007 PrestaShop SA and Contributors +* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) +*}

{l s='Configure your checkboxes' d='Modules.Psgdpr.Admin'} {$module_display|escape:'htmlall':'UTF-8'}

- +

{l s='Please customize your consent request messages in the dedicated fields below :' d='Modules.Psgdpr.Admin'}