Skip to content

Commit dc58030

Browse files
olgabraniathinab
authored andcommitted
Merge branch 'feature-cookie-settings' into devel
2 parents f68b6e4 + cc93bc5 commit dc58030

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- OpenAIRE
1212
- OpenMinTeD
1313
- Add info about compatiblity in README.
14+
- Enable/disable cookie banner functionality via setting in config file.
1415

1516

1617
## [v2.1.0](https://github.com/rciam/simplesamlphp-module-themevanilla/compare/v2.0.0...v2.1.0) - 2018-10-18

README.md

Lines changed: 10 additions & 2 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,8 +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-
249+
`<path-to-simplesamlphp>/config/module_themevanilla.php`.
242250

243251
## Compatibility Note
244252

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
?>

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(strpos($this->t('{themevanilla:discopower:cookies_text}'), 'not translated') === FALSE || strpos($this->t('{themevanilla:discopower:cookies_accept_btn_text}'), 'not translated') === FALSE) { ?>
15+
<?php if ($enable_cookies_banner) { ?>
1316
<!-- cookies popup -->
1417
<div id="cookies">
1518
<div id="cookies-wrapper">

0 commit comments

Comments
 (0)