You are here

protected function PersonalInformationFormTrait::getGdprWording in EU Cookie Compliance (GDPR Compliance) 2.0.x

Same name and namespace in other branches
  1. 8 src/PersonalInformationFormTrait.php \Drupal\eu_cookie_compliance\PersonalInformationFormTrait::getGdprWording()

Translated wording that should accompany the GDPR checkbox.

Return value

string String for the checkbox.

1 call to PersonalInformationFormTrait::getGdprWording()
PersonalInformationFormTrait::formInjectGdprCheckbox in src/PersonalInformationFormTrait.php
Inject the GDPR checkbox into the form.

File

src/PersonalInformationFormTrait.php, line 90

Class

PersonalInformationFormTrait
Trait that implements PersonalInformationFormInterface.

Namespace

Drupal\eu_cookie_compliance

Code

protected function getGdprWording() {
  $popup_link = $this
    ->getConfig('eu_cookie_compliance.settings')
    ->get('popup_link');
  if (UrlHelper::isExternal($popup_link)) {
    $popup_link = Url::fromUri($popup_link);
  }
  else {
    $popup_link = $popup_link === '<front>' ? '/' : $popup_link;
    $popup_link = Url::fromUserInput($popup_link);
  }
  return $this
    ->t('I accept processing of my personal data. For more information, read the <a href="@url">privacy policy</a>,', [
    '@url' => $popup_link
      ->toString(),
  ]);
}