Skip to content
Snippets Groups Projects
Unverified Commit 1892d3e4 authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Do not use the new configpage hook yet.

We'll use it in the new admin interface. For now, we just fix the old hook so that translations work for strings stored in dictionaries in the hooking module.
parent d42f26f3
No related branches found
No related tags found
No related merge requests found
Showing
with 99 additions and 30 deletions
...@@ -7,13 +7,9 @@ ...@@ -7,13 +7,9 @@
function consentAdmin_hook_configpage(\SimpleSAML\XHTML\Template &$template) function consentAdmin_hook_configpage(\SimpleSAML\XHTML\Template &$template)
{ {
$template->data['links_config']['consentAdmin'] = [ $template->data['links']['consentAdmin'] = [
'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'), 'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'),
'text' => '{consentAdmin:consentadmin:link_consentAdmin}', 'text' => \SimpleSAML\Locale\Translate::noop('Consent administration'),
]; ];
$template->getLocalization()->addModuleDomain('consentAdmin');
$config = \SimpleSAML\Configuration::getInstance();
if ($config->getBoolean('usenewui', false)) {
$template->getLocalization()->addModuleDomain('consentAdmin');
}
} }
<?php
/**
* Hook to add the consentAdmin module to the frontpage.
*
* @param array &$links The links on the frontpage, split into sections.
*/
function consentAdmin_hook_frontpage(&$links)
{
assert(is_array($links));
assert(array_key_exists('links', $links));
$links['config'][] = [
'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'),
'text' => '{consentAdmin:consentadmin:link_consentAdmin}',
];
}
...@@ -168,3 +168,6 @@ msgstr "show/hide attributes" ...@@ -168,3 +168,6 @@ msgstr "show/hide attributes"
msgid "Organisation" msgid "Organisation"
msgstr "Organisation" msgstr "Organisation"
msgid "Consent administration"
msgstr "Consent administration"
...@@ -162,3 +162,5 @@ msgstr "Mostrar/ocultar atributos" ...@@ -162,3 +162,5 @@ msgstr "Mostrar/ocultar atributos"
msgid "Organisation" msgid "Organisation"
msgstr "Organización" msgstr "Organización"
msgid "Consent administration"
msgstr "Administración del consentimiento"
...@@ -158,3 +158,5 @@ msgstr "vis/skjul persondata" ...@@ -158,3 +158,5 @@ msgstr "vis/skjul persondata"
msgid "Organisation" msgid "Organisation"
msgstr "Organisasjon" msgstr "Organisasjon"
msgid "Consent administration"
msgstr "Samtykke administrasjon"
...@@ -158,3 +158,5 @@ msgstr "vis/skjul personinformasjon" ...@@ -158,3 +158,5 @@ msgstr "vis/skjul personinformasjon"
msgid "Organisation" msgid "Organisation"
msgstr "Organisasjon" msgstr "Organisasjon"
msgid "Consent administration"
msgstr "Samtykke administrasjon"
...@@ -199,6 +199,4 @@ $t->data['requiredmap'] = [ ...@@ -199,6 +199,4 @@ $t->data['requiredmap'] = [
$t->data['version'] = $config->getVersion(); $t->data['version'] = $config->getVersion();
$t->data['directory'] = dirname(dirname(dirname(dirname(__FILE__)))); $t->data['directory'] = dirname(dirname(dirname(dirname(__FILE__))));
\SimpleSAML\Module::callHooks('configpage', $t);
$t->show(); $t->show();
...@@ -7,13 +7,9 @@ ...@@ -7,13 +7,9 @@
function cron_hook_configpage(\SimpleSAML\XHTML\Template &$template) function cron_hook_configpage(\SimpleSAML\XHTML\Template &$template)
{ {
$template->data['links_config']['cron'] = [ $template->data['links']['cron'] = [
'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'), 'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'),
'text' => '{cron:cron:link_cron}', 'text' => \SimpleSAML\Locale\Translate::noop('Cron module information page'),
]; ];
$template->getLocalization()->addModuleDomain('cron');
$config = \SimpleSAML\Configuration::getInstance();
if ($config->getBoolean('usenewui', false)) {
$template->getLocalization()->addModuleDomain('cron');
}
} }
<?php
/**
* Hook to add the modinfo module to the frontpage.
*
* @param array &$links The links on the frontpage, split into sections.
*/
function cron_hook_frontpage(&$links)
{
assert(is_array($links));
assert(array_key_exists('links', $links));
$links['config'][] = [
'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'),
'text' => '{cron:cron:link_cron}',
];
}
...@@ -65,3 +65,6 @@ msgstr "Cron result page" ...@@ -65,3 +65,6 @@ msgstr "Cron result page"
msgid "{cron:cron:link_cron}" msgid "{cron:cron:link_cron}"
msgstr "Cron module information page" msgstr "Cron module information page"
msgid "Cron module information page"
msgstr "Cron module information page"
...@@ -65,3 +65,6 @@ msgstr "Página de resultado del cron" ...@@ -65,3 +65,6 @@ msgstr "Página de resultado del cron"
msgid "{cron:cron:link_cron}" msgid "{cron:cron:link_cron}"
msgstr "Informe de cron" msgstr "Informe de cron"
msgid "Cron module information page"
msgstr "Informe de cron"
...@@ -65,3 +65,6 @@ msgstr "Cron resultatside" ...@@ -65,3 +65,6 @@ msgstr "Cron resultatside"
msgid "{cron:cron:link_cron}" msgid "{cron:cron:link_cron}"
msgstr "Informasjon om cron" msgstr "Informasjon om cron"
msgid "Cron module information page"
msgstr "Informasjon om cron"
...@@ -65,3 +65,6 @@ msgstr "Cron resultatside" ...@@ -65,3 +65,6 @@ msgstr "Cron resultatside"
msgid "{cron:cron:link_cron}" msgid "{cron:cron:link_cron}"
msgstr "Informasjon om cron" msgstr "Informasjon om cron"
msgid "Cron module information page"
msgstr "Informasjon om cron"
...@@ -7,13 +7,9 @@ ...@@ -7,13 +7,9 @@
function memcacheMonitor_hook_configpage(\SimpleSAML\XHTML\Template &$template) function memcacheMonitor_hook_configpage(\SimpleSAML\XHTML\Template &$template)
{ {
$template->data['links_config']['memcacheMonitor'] = [ $template->data['links']['memcacheMonitor'] = [
'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'), 'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'),
'text' => '{memcacheMonitor:memcachestat:link_memcacheMonitor}', 'text' => \SimpleSAML\Locale\Translate::noop('Memcache statistics'),
]; ];
$template->getLocalization()->addModuleDomain('memcacheMonitor');
$config = \SimpleSAML\Configuration::getInstance();
if ($config->getBoolean('usenewui', false)) {
$template->getLocalization()->addModuleDomain('memcacheMonitor');
}
} }
<?php
/**
* Hook to add the simple consenet admin module to the frontpage.
*
* @param array &$links The links on the frontpage, split into sections.
*/
function memcacheMonitor_hook_frontpage(&$links)
{
assert(is_array($links));
assert(array_key_exists('links', $links));
$links['config'][] = [
'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'),
'text' => '{memcacheMonitor:memcachestat:link_memcacheMonitor}',
];
}
...@@ -266,3 +266,6 @@ msgstr "Total connections" ...@@ -266,3 +266,6 @@ msgstr "Total connections"
msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}" msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}"
msgstr "Memcache statistics" msgstr "Memcache statistics"
msgid "Memcache statistics"
msgstr "Memcache statistics"
...@@ -131,3 +131,6 @@ msgstr "Total de conexiones" ...@@ -131,3 +131,6 @@ msgstr "Total de conexiones"
msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}" msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}"
msgstr "Estadísticas de memcache" msgstr "Estadísticas de memcache"
msgid "Memcache statistics"
msgstr "Estadísticas de memcache"
...@@ -131,3 +131,6 @@ msgstr "Totalt antall forbindelser" ...@@ -131,3 +131,6 @@ msgstr "Totalt antall forbindelser"
msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}" msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}"
msgstr "Memcache statistikker" msgstr "Memcache statistikker"
msgid "Memcache statistics"
msgstr "Memcache statistikker"
...@@ -131,3 +131,6 @@ msgstr "Opne tilkoplingar (totalt)" ...@@ -131,3 +131,6 @@ msgstr "Opne tilkoplingar (totalt)"
msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}" msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}"
msgstr "Memcache statistikkar" msgstr "Memcache statistikkar"
msgid "Memcache statistics"
msgstr "Memcache statistikkar"
...@@ -6,13 +6,9 @@ ...@@ -6,13 +6,9 @@
*/ */
function sanitycheck_hook_configpage(\SimpleSAML\XHTML\Template &$template) function sanitycheck_hook_configpage(\SimpleSAML\XHTML\Template &$template)
{ {
$template->data['links_config']['sanitycheck'] = [ $template->data['links']['sanitycheck'] = [
'href' => SimpleSAML\Module::getModuleURL('sanitycheck/index.php'), 'href' => SimpleSAML\Module::getModuleURL('sanitycheck/index.php'),
'text' => '{sanitycheck:strings:link_sanitycheck}', 'text' => \SimpleSAML\Locale\Translate::noop('Sanity check of your SimpleSAMLphp setup'),
]; ];
$template->getLocalization()->addModuleDomain('sanitycheck');
$config = \SimpleSAML\Configuration::getInstance();
if ($config->getBoolean('usenewui', false)) {
$template->getLocalization()->addModuleDomain('sanitycheck');
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment