Skip to content

Commit 9b0965e

Browse files
committed
[Discopower] Move ribbon_text option to config file
1 parent 29ddc73 commit 9b0965e

4 files changed

Lines changed: 9 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ If you want to make any changes in the footer you need to modify the template
202202
### Header ribbon
203203

204204
The text in the header ribbon can be altered by changing the `ribbon_text`
205-
definition in `dictionaries/default.definition.json` file.
205+
definition in `module_themevanilla.php` file.
206206
If you want to hide the ribbon, set `ribbon_text` to `""`.
207207

208208
### CSS

config-example/module_themevanilla.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
2+
23
/**
34
* This is example configuration of SimpleSAMLphp themevanila.
45
* Copy this file to default config directory and edit the properties.
56
*
67
* copy command (from SimpleSAML base dir)
78
* cp modules/themevanilla/module_themevanilla.php config/
89
*/
10+
911
$config = array(
1012
'cookiePolicy' => array(
1113
array('type' => 'Session State', 'provider' => 'aai.rciam.eu', 'name' => 'rciam_proxy_authtoken, rciam_google_proxy_authtoken, rciam_google_proxy_authtoken, rciam_facebook_proxy_authtoken, rciam_linkedin_proxy_authtoken, rciam_orcid_proxy_authtoken', 'thirdParty' => false, 'category' => 'Session', 'purpose' => 'Preserve user authentication token to prevent session fixation attacks'),
@@ -17,7 +19,6 @@
1719
array('type' => 'Preferences', 'provider' => 'aai.rciam.eu', 'name' => 'i18next', 'thirdParty' => false, 'category' => 'Session', 'purpose' => 'Preserve preferred language for RCIAM AAI OpenID Connect Provider'),
1820
array('type' => 'Session State', 'provider' => 'aai.rciam.eu', 'name' => 'JSESSIONID', 'thirdParty' => false, 'category' => 'Session', 'purpose' => 'Preserve user session ID to retrieve session information')
1921
),
20-
'enable_cookies_banner' => false
22+
'enable_cookies_banner' => false,
23+
'ribbon_text' => '',
2124
);
22-
23-
?>

dictionaries/default.definition.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@
1010
},
1111
"logo_link_url": {
1212
"en": "https://www.example.com"
13-
},
14-
"ribbon_text": {
15-
"en": "Demo"
1613
}
1714
}

themes/ssp/default/includes/header.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

3-
3+
$themeConfig = SimpleSAML\Configuration::getConfig('module_themevanilla.php');
4+
$ribbonText = $themeConfig->getValue('ribbon_text');
45

56
/**
67
* Support the htmlinject hook, which allows modules to change header, pre and post body on all pages.
@@ -127,9 +128,9 @@
127128

128129
<div class="header">
129130
<?php
130-
if (strpos($this->t('{themevanilla:default:ribbon_text}'), 'not translated') === FALSE || $this->t('{themevanilla:default:ribbon_text}')) {
131+
if (!empty($ribbonText)) {
131132
echo '<div class="corner-ribbon red">';
132-
echo $this->t('{themevanilla:default:ribbon_text}');
133+
echo $ribbonText;
133134
echo '</div>';
134135
}
135136
?>

0 commit comments

Comments
 (0)