Loading config/schema/eu_cookie_compliance.schema.yml +3 −0 Original line number Diff line number Diff line Loading @@ -293,3 +293,6 @@ eu_cookie_compliance.cookie_compliance_set.*: consent_by_clicking: type: boolean label: 'Consent by clicking' enable_policy_versioning: type: boolean label: 'Enable policy versioning' src/Entity/CookieComplianceSet.php +9 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,8 @@ use Drupal\eu_cookie_compliance\CookieComplianceSetInterface; * "reload_options", * "reload_routes_list", * "set_cookie_session_zero_on_disagree", * "consent_by_clicking" * "consent_by_clicking", * "enable_policy_versioning" * } * ) */ Loading Loading @@ -293,5 +294,12 @@ class CookieComplianceSet extends ConfigEntityBase implements CookieComplianceSe */ protected $consent_by_clicking; /** * Whether to allow policy versioning. * * @var bool */ protected $enable_policy_versioning; } src/Form/CookieComplianceSetForm.php +11 −0 Original line number Diff line number Diff line Loading @@ -334,12 +334,23 @@ class CookieComplianceSetForm extends EntityForm { '#default_value' => $this->entity->get('open_privacy_link_in_new_window'), ]; $form['privacy_policy']['enable_policy_versioning'] = [ '#type' => 'checkbox', '#title' => $this->t('Enable policy versioning.'), '#default_value' => $this->entity->get('enable_policy_versioning') === NULL ? TRUE : $this->entity->get('enable_policy_versioning'), ]; $form['privacy_policy']['privacy_policy_version'] = [ '#type' => 'textfield', '#title' => $this->t('Privacy policy version'), '#description' => $this->t('Change this value to make the cookie information banner reappear for all visitors. A typical usage of this field is to increase the value when the privacy policy has been changed.'), '#default_value' => $this->entity->get('privacy_policy_version') ?: '1.0.0', '#required' => TRUE, '#states' => [ 'visible' => [ "input[name='enable_policy_versioning']" => ['checked' => TRUE], ], ], ]; $form['cookie'] = [ Loading Loading
config/schema/eu_cookie_compliance.schema.yml +3 −0 Original line number Diff line number Diff line Loading @@ -293,3 +293,6 @@ eu_cookie_compliance.cookie_compliance_set.*: consent_by_clicking: type: boolean label: 'Consent by clicking' enable_policy_versioning: type: boolean label: 'Enable policy versioning'
src/Entity/CookieComplianceSet.php +9 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,8 @@ use Drupal\eu_cookie_compliance\CookieComplianceSetInterface; * "reload_options", * "reload_routes_list", * "set_cookie_session_zero_on_disagree", * "consent_by_clicking" * "consent_by_clicking", * "enable_policy_versioning" * } * ) */ Loading Loading @@ -293,5 +294,12 @@ class CookieComplianceSet extends ConfigEntityBase implements CookieComplianceSe */ protected $consent_by_clicking; /** * Whether to allow policy versioning. * * @var bool */ protected $enable_policy_versioning; }
src/Form/CookieComplianceSetForm.php +11 −0 Original line number Diff line number Diff line Loading @@ -334,12 +334,23 @@ class CookieComplianceSetForm extends EntityForm { '#default_value' => $this->entity->get('open_privacy_link_in_new_window'), ]; $form['privacy_policy']['enable_policy_versioning'] = [ '#type' => 'checkbox', '#title' => $this->t('Enable policy versioning.'), '#default_value' => $this->entity->get('enable_policy_versioning') === NULL ? TRUE : $this->entity->get('enable_policy_versioning'), ]; $form['privacy_policy']['privacy_policy_version'] = [ '#type' => 'textfield', '#title' => $this->t('Privacy policy version'), '#description' => $this->t('Change this value to make the cookie information banner reappear for all visitors. A typical usage of this field is to increase the value when the privacy policy has been changed.'), '#default_value' => $this->entity->get('privacy_policy_version') ?: '1.0.0', '#required' => TRUE, '#states' => [ 'visible' => [ "input[name='enable_policy_versioning']" => ['checked' => TRUE], ], ], ]; $form['cookie'] = [ Loading