Skip to content

Commit 2ef1ac6

Browse files
olgabraniathinab
authored andcommitted
Move 'enable_cookies_banner' setting to module config file
1 parent 3336356 commit 2ef1ac6

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ directories (`js.zip` and `css.zip`) from the [release page](https://github.com/
9898
extract them under `modules/themevanilla/www/resources`. If you want to produce
9999
them, you may read the customisation instructions below.
100100

101+
### Cookie Policy
102+
103+
In order to use Cookie Policy page you must copy the configuration file
104+
from the `config-example` folder to core config directory.
105+
```
106+
cp <path-to-module>/config-example/module_themevanilla.php <path-to-simplesamlphp>/config
107+
```
108+
To disable the feature, set `enable_cookies_banner` to `false` in the above
109+
file.
101110

102111
## Configuration
103112

@@ -237,10 +246,7 @@ compiling options.
237246
To modify the cookie banner and cookie policy page, you must edit the following files:
238247
`<path-to-module>/dictionaries/policy.definition.json`
239248
and to modify the table in cookie policy page:
240-
`<path-to-simplesamlphp>/config/module_themevanilla.php`
241-
To disable the feature, set `enable_cookies_banner` to `false` in
242-
`<path-to-module>/dictionaries/policy.definition.json` file.
243-
249+
`<path-to-simplesamlphp>/config/module_themevanilla.php`.
244250

245251
## Compatibility Note
246252

config-example/module_themevanilla.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
array('type' => 'Preferences', 'provider' => 'aai.rciam.eu', 'name' => 'rciam_co_registry_tz', 'thirdParty' => false, 'category' => 'Persistent', 'purpose' => 'Preserve preferred timezone selection for COmanage RCIAM Account Registry'),
1717
array('type' => 'Preferences', 'provider' => 'aai.rciam.eu', 'name' => 'i18next', 'thirdParty' => false, 'category' => 'Session', 'purpose' => 'Preserve preferred language for RCIAM AAI OpenID Connect Provider'),
1818
array('type' => 'Session State', 'provider' => 'aai.rciam.eu', 'name' => 'JSESSIONID', 'thirdParty' => false, 'category' => 'Session', 'purpose' => 'Preserve user session ID to retrieve session information')
19-
)
19+
),
20+
'enable_cookies_banner' => false
2021
);
2122

2223
?>

dictionaries/discopower.definition.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
"cookies_link_text": {
1818
"en": "updated privacy policy and cookie policy."
1919
},
20-
"enable_cookies_banner": {
21-
"en": true
22-
},
2320
"cookies_text": {
2421
"en": "We use cookies to identify you, thereby enabling us to grant you access to the services and resources provided by the Infrastructure, and also to improve your experience on our site. To find out more, read our "
2522
},

themes/ssp/default/includes/footer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

22
<?php
3+
$themeConfig = SimpleSAML_Configuration::getConfig('module_themevanilla.php');
4+
$enable_cookies_banner = $themeConfig->getValue('enable_cookies_banner');
5+
36
if(!empty($this->data['htmlinject']['htmlContentPost'])) {
47
foreach($this->data['htmlinject']['htmlContentPost'] AS $c) {
58
echo $c;
@@ -9,7 +12,7 @@
912
</div><!-- /container -->
1013
</div><!-- /ssp-container -->
1114

12-
<?php if ($this->t('{themevanilla:discopower:enable_cookies_banner}')) { ?>
15+
<?php if ($enable_cookies_banner) { ?>
1316
<!-- cookies popup -->
1417
<div id="cookies">
1518
<div id="cookies-wrapper">

0 commit comments

Comments
 (0)