Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit 5896012

Browse files
authored
Merge pull request #46 from silinternational/feature/announcement-change
Get announcements by calling the utils method directly rather than from the config.php
2 parents 9e4e4c7 + 9a48550 commit 5896012

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ Update `/simplesamlphp/config/config.php`:
3939
_[ssp-base](https://github.com/silinternational/ssp-base) provides a convenience by loading this config with whatever is in the environment variable `ANALYTICS_ID`._
4040

4141
### Announcements
42-
Update `/simplesamlphp/config/config.php`:
42+
Update `/simplesamlphp/announcement/announcement.php`:
4343

4444
```
45-
'announcement' => 'Some <strong>important</strong> announcement'
45+
return 'Some <strong>important</strong> announcement';
4646
```
4747

48-
_[ssp-base](https://github.com/silinternational/ssp-base) provides a convenience by loading this config with whatever is returned by `/simplesamlphp/announcement/announcement.php`._
48+
_[ssp-utilities](https://github.com/silinternational/ssp-utilities) provides whatever is returned by `/simplesamlphp/announcement/announcement.php`._
4949

50-
If configured, an alert will be shown to the user filled with the content of that announcement. HTML is supported.
50+
If provided, an alert will be shown to the user filled with the content of that announcement. HTML is supported.
5151

5252
## Testing theme
5353

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"php": ">=5.4",
1515
"roave/security-advisories": "dev-master",
1616
"simplesamlphp/composer-module-installer": "^1.1.5",
17-
"simplesamlphp/simplesamlphp": "^1.14.10"
17+
"simplesamlphp/simplesamlphp": "^1.14.10",
18+
"silinternational/ssp-utilities": "^1.0"
1819
}
1920
}

themes/material/common-announcement.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
2-
$announcementHtml = $this->configuration->getValue('announcement');
2+
3+
use Sil\SspUtils\AnnouncementUtils;
4+
5+
$announcementHtml = AnnouncementUtils::getAnnouncement();
36

47
if (! empty($announcementHtml)) {
58
?>

0 commit comments

Comments
 (0)