Skip to content

Commit

Permalink
Merge branch 'master' into magento2.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 committed Jul 31, 2018
2 parents 617f6d6 + 9573482 commit 387b3ac
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
22 changes: 21 additions & 1 deletion Block/Messages/PrivacyMessagePopup.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Opengento\Gdpr\Block\Messages;

use Magento\Cms\Block\Block;
use Magento\Cms\Helper\Page as HelperPage;
use Magento\Framework\Json\Encoder;
use Magento\Framework\View\Element\Template;
Expand Down Expand Up @@ -68,7 +69,7 @@ public function getJsLayout()
$this->jsLayout['components']['enhanced-privacy-cookie-policy']['config'] = [
'cookieName' => self::COOKIE_NAME,
'learnMore' => $this->helperPage->getPageUrl($this->config->getPrivacyInformationPageId()),
'notificationText' => $this->config->getCookieDisclosureInformationBlockId()
'notificationText' => $this->getCookieDisclosureInformation(),
];

return $this->jsonEncoder->encode($this->jsLayout);
Expand All @@ -81,4 +82,23 @@ protected function _toHtml()
{
return $this->config->isCookieDisclosureEnabled() ? parent::_toHtml() : '';
}

/**
* Retrieve the cookie disclosure information html
*
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
*/
private function getCookieDisclosureInformation(): string
{
if (!$this->hasData('cookie_disclosure_information')) {
$block = $this->getLayout()->createBlock(
Block::class,
['data' => ['block_id' => $this->config->getCookieDisclosureInformationBlockId()]]
);
$this->setData('cookie_disclosure_information', $block);
}

return (string) $this->_getData('cookie_disclosure_information');
}
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ This extension allows customers to delete, anonymize, and export their personal
Magento 2 Open Source or Commerce edition is required.

The Version `2.x` is compliant with Magento `2.2.x`.
The Version `1.x` is compliant with Magento `2.0.x` and `2.1.x`.
The Version `1.x` is compliant with Magento `2.1.x`.

This module does not support Magento `2.0.x`, as this version is not anymore maintained.

### Get the package

Expand Down
1 change: 1 addition & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Anonymization,Anonymization
"We will delete the customer if he has no orders.","We will delete the customer if he has no orders."
"Apply Deletion Strategy","Apply Deletion Strategy"
"This processors list allows to configure specific erasure strategy by component.","This processors list allows to configure specific erasure strategy by component."
"Privacy Settings","Privacy Settings"
"Export Settings","Export Settings"
Export,Export
Renderer,Renderer
Expand Down
1 change: 1 addition & 0 deletions i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Anonymization,Anonymisation
"We will delete the customer if he has no orders.","Nous allons supprimer le client si il n'a pas de commandes"
"Apply Deletion Strategy","Appliquer la stratégie de suppression"
"This processors list allows to configure specific erasure strategy by component.","This processors list allows to configure specific erasure strategy by component."
"Privacy Settings","Paramètres de confidentialité"
"Export Settings","Exporter les paramètres"
Export,Exporter
Renderer,Renderer
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="after.body.start">
<referenceContainer name="before.body.end">
<block class="Opengento\Gdpr\Block\Messages\PrivacyMessagePopup" name="privacy_message_popup" after="-" ifconfig="gdpr/general/enabled">
<arguments>
<argument name="jsLayout" xsi:type="array">
Expand Down

0 comments on commit 387b3ac

Please sign in to comment.