Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Create a new "configpage" hook for those modules that need to inject …
…anything in the configuration page. This allows us to change the signature of the hook, so that we pass it the \SimpleSAML\XHTML\Template object and then the hook can not only add data to be passed to the twig template, but also add its own translation domain. This was needed because many modules were putting their translations inside "core", and when moving those to the modules themselves, the new translation system cannot perform the translation because only the translations for the current module in use are loaded (in the config page, that's the core module). Therefore, we needed a way to get the Localization instance from the template, and a way to pass that to the hook so that the hook can register the translations for its own module.
- Loading branch information
1 parent
409862b
commit d42f26f
Showing
41 changed files
with
233 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* Hook to add the consentAdmin module to the config page. | ||
* | ||
* @param \SimpleSAML\XHTML\Template The template that we should alter in this hook. | ||
*/ | ||
|
||
function consentAdmin_hook_configpage(\SimpleSAML\XHTML\Template &$template) | ||
{ | ||
$template->data['links_config']['consentAdmin'] = [ | ||
'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'), | ||
'text' => '{consentAdmin:consentadmin:link_consentAdmin}', | ||
]; | ||
|
||
$config = \SimpleSAML\Configuration::getInstance(); | ||
if ($config->getBoolean('usenewui', false)) { | ||
$template->getLocalization()->addModuleDomain('consentAdmin'); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,8 @@ | |
}, | ||
"cron_report_title": { | ||
"en": "Cron report" | ||
}, | ||
"link_cron": { | ||
"en": "Cron module information page" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* Hook to add the cron module to the config page. | ||
* | ||
* @param \SimpleSAML\XHTML\Template &$template The template that we should alter in this hook. | ||
*/ | ||
|
||
function cron_hook_configpage(\SimpleSAML\XHTML\Template &$template) | ||
{ | ||
$template->data['links_config']['cron'] = [ | ||
'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'), | ||
'text' => '{cron:cron:link_cron}', | ||
]; | ||
|
||
$config = \SimpleSAML\Configuration::getInstance(); | ||
if ($config->getBoolean('usenewui', false)) { | ||
$template->getLocalization()->addModuleDomain('cron'); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* Hook to add the memcacheMonitor module to the config page. | ||
* | ||
* @param \SimpleSAML\XHTML\Template &$template The template that we should alter in this hook. | ||
*/ | ||
|
||
function memcacheMonitor_hook_configpage(\SimpleSAML\XHTML\Template &$template) | ||
{ | ||
$template->data['links_config']['memcacheMonitor'] = [ | ||
'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'), | ||
'text' => '{memcacheMonitor:memcachestat:link_memcacheMonitor}', | ||
]; | ||
|
||
$config = \SimpleSAML\Configuration::getInstance(); | ||
if ($config->getBoolean('usenewui', false)) { | ||
$template->getLocalization()->addModuleDomain('memcacheMonitor'); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"link_sanitycheck": { | ||
"en": "Sanity check of your SimpleSAMLphp setup" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"link_sanitycheck": { | ||
"es": "Comprobaciones básicas de la instalación", | ||
"no": "Sjekk din installasjon", | ||
"nn": "Sjekk din installasjon" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* Hook to add the sanitycheck link to the config page. | ||
* | ||
* @param \SimpleSAML\XHTML\Template The template that we should alter in this hook. | ||
*/ | ||
function sanitycheck_hook_configpage(\SimpleSAML\XHTML\Template &$template) | ||
{ | ||
$template->data['links_config']['sanitycheck'] = [ | ||
'href' => SimpleSAML\Module::getModuleURL('sanitycheck/index.php'), | ||
'text' => '{sanitycheck:strings:link_sanitycheck}', | ||
]; | ||
|
||
$config = \SimpleSAML\Configuration::getInstance(); | ||
if ($config->getBoolean('usenewui', false)) { | ||
$template->getLocalization()->addModuleDomain('sanitycheck'); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
msgid "These checks failed:" | ||
msgstr "Las siguientes comprobaciones han fallado:" | ||
|
||
msgid "These checks succeeded:" | ||
msgstr "Las siguientes comprobaciones fueron satisfactorias:" | ||
|
||
msgid "{sanitycheck:strings:link_sanitycheck}" | ||
msgstr "Comprobaciones básicas de la instalación" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
msgid "These checks failed:" | ||
msgstr "Disse sjekkene har feila:" | ||
|
||
msgid "These checks succeeded:" | ||
msgstr "Disse sjekkene var suksessfulle:" | ||
|
||
msgid "{sanitycheck:strings:link_sanitycheck}" | ||
msgstr "Sjekk din installasjon" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
msgid "These checks failed:" | ||
msgstr "These checks failed:" | ||
|
||
msgid "These checks succeeded:" | ||
msgstr "Desse sjekkane var suksessfulle:" | ||
|
||
msgid "{sanitycheck:strings:link_sanitycheck}" | ||
msgstr "Sjekk din installasjon" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"link_statistics": { | ||
"en": "Show statistics" | ||
}, | ||
"link_statistics_metadata": { | ||
"en": "Show statistics metadata" | ||
} | ||
} |
Oops, something went wrong.