diff --git a/administrator/language/en-GB/plg_content_confirmconsent.ini b/administrator/language/en-GB/plg_content_confirmconsent.ini index 0818359b2238c..ebe9600666c26 100644 --- a/administrator/language/en-GB/plg_content_confirmconsent.ini +++ b/administrator/language/en-GB/plg_content_confirmconsent.ini @@ -7,7 +7,11 @@ PLG_CONTENT_CONFIRMCONSENT="Content - Confirm Consent" PLG_CONTENT_CONFIRMCONSENT_CONSENTBOX_LABEL="Privacy Note" PLG_CONTENT_CONFIRMCONSENT_FIELD_ARTICLE_DESC="Select the article from the list or create a new one." PLG_CONTENT_CONFIRMCONSENT_FIELD_ARTICLE_LABEL="Privacy Article" +PLG_CONTENT_CONFIRMCONSENT_FIELD_MENU_ITEM_LABEL="Privacy Menu Item" PLG_CONTENT_CONFIRMCONSENT_FIELD_NOTE_DEFAULT="By submitting this form you agree to the Privacy Policy of this website and the storing of the submitted information." PLG_CONTENT_CONFIRMCONSENT_FIELD_NOTE_DESC="A summary of the site's privacy policy. If left blank then the default message will be used." PLG_CONTENT_CONFIRMCONSENT_FIELD_NOTE_LABEL="Short Privacy Policy" +PLG_CONTENT_CONFIRMCONSENT_FIELD_TYPE_ARTICLE="Article" +PLG_CONTENT_CONFIRMCONSENT_FIELD_TYPE_LABEL="Privacy Type" +PLG_CONTENT_CONFIRMCONSENT_FIELD_TYPE_MENU_ITEM="Menu Item" PLG_CONTENT_CONFIRMCONSENT_XML_DESCRIPTION="This plugin adds a required consent checkbox to a form eg the core contact component." diff --git a/administrator/language/en-GB/plg_system_privacyconsent.ini b/administrator/language/en-GB/plg_system_privacyconsent.ini index d0fd53cb401ae..23d5922a6b3a5 100644 --- a/administrator/language/en-GB/plg_system_privacyconsent.ini +++ b/administrator/language/en-GB/plg_system_privacyconsent.ini @@ -27,6 +27,10 @@ PLG_SYSTEM_PRIVACYCONSENT_FIELD_ENABLED_DESC="When enabled it performs checks fo PLG_SYSTEM_PRIVACYCONSENT_FIELD_ENABLED_LABEL="Enable" PLG_SYSTEM_PRIVACYCONSENT_FIELD_ERROR="Agreement to the site's Privacy Policy is required." PLG_SYSTEM_PRIVACYCONSENT_FIELD_LABEL="Privacy Policy" +PLG_SYSTEM_PRIVACYCONSENT_FIELD_MENU_ITEM_LABEL="Privacy Menu Item" +PLG_SYSTEM_PRIVACYCONSENT_FIELD_TYPE_ARTICLE="Article" +PLG_SYSTEM_PRIVACYCONSENT_FIELD_TYPE_LABEL="Privacy Type" +PLG_SYSTEM_PRIVACYCONSENT_FIELD_TYPE_MENU_ITEM="Menu Item" PLG_SYSTEM_PRIVACYCONSENT_LABEL="Website Privacy" PLG_SYSTEM_PRIVACYCONSENT_NOTE_FIELD_DEFAULT="By signing up to this website and agreeing to the Privacy Policy you agree to this website storing your information." PLG_SYSTEM_PRIVACYCONSENT_NOTE_FIELD_DESC="A summary of the site's privacy policy. If left blank then the default message will be used." diff --git a/layouts/plugins/system/privacyconsent/label.php b/layouts/plugins/system/privacyconsent/label.php index 27c5c53c25ee2..1e57ed60a3aad 100644 --- a/layouts/plugins/system/privacyconsent/label.php +++ b/layouts/plugins/system/privacyconsent/label.php @@ -47,8 +47,9 @@ * @var array $translateLabel Should the label be translated? * @var array $translateDescription Should the description be translated? * @var array $translateHint Should the hint be translated? - * @var array $privacyArticle The Article ID holding the Privacy Article - * @var object $article The Article object + * @var array $privacyArticle The Article ID holding the Privacy Article. + * @var object $article The Article object. + * @var object $privacyLink Link to the privacy article or menu item. */ // Get the label text from the XML element, defaulting to the element name. @@ -82,20 +83,20 @@ $label .= ' data-placement="left"'; } -if ($article) +if ($privacyLink) { $attribs = [ 'data-toggle' => 'modal', 'data-target' => '#consentModal', ]; - $link = HTMLHelper::_('link', Route::_($article->link . '&tmpl=component'), $text, $attribs); + $link = HTMLHelper::_('link', Route::_($privacyLink . '&tmpl=component'), $text, $attribs); echo HTMLHelper::_( 'bootstrap.renderModal', 'consentModal', [ - 'url' => Route::_($article->link . '&tmpl=component'), + 'url' => Route::_($privacyLink . '&tmpl=component'), 'title' => $text, 'height' => '100%', 'width' => '100%', diff --git a/plugins/content/confirmconsent/confirmconsent.php b/plugins/content/confirmconsent/confirmconsent.php index 05d40dc69a9be..34a0d045b35d7 100644 --- a/plugins/content/confirmconsent/confirmconsent.php +++ b/plugins/content/confirmconsent/confirmconsent.php @@ -67,6 +67,8 @@ public function onContentPrepareForm(Form $form, $data) // Get the consent box Text & the selected privacyarticle $consentboxText = (string) $this->params->get('consentbox_text', Text::_('PLG_CONTENT_CONFIRMCONSENT_FIELD_NOTE_DEFAULT')); $privacyArticle = $this->params->get('privacy_article', false); + $privacyType = $this->params->get('privacy_type', 'article'); + $privacyMenuItem = $this->params->get('privacy_menu_item', false); $form->load('