Skip to content
Snippets Groups Projects
Commit fd7e9cae authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Add support for filtering tabs in discopower module...

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1291 44740490-163a-0410-bde0-09ae8108e29a
parent 6190a60e
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,11 @@ $config = array ( ...@@ -15,6 +15,11 @@ $config = array (
* All other available tabs will be listed after the ones specified below. * All other available tabs will be listed after the ones specified below.
*/ */
'taborder' => array('norway'), 'taborder' => array('norway'),
/*
* the 'tab' parameter allows you to limit the tabs to a specific list. (excluding unlisted tags)
*
* 'tabs' => array('norway', 'finland'),
*/
); );
......
...@@ -8,16 +8,25 @@ $lang = array( ...@@ -8,16 +8,25 @@ $lang = array(
), ),
'kalmar' => array ( 'kalmar' => array (
'no' => 'Kalmar',
'en' => 'Kalmar', 'en' => 'Kalmar',
'no' => 'Kalmar',
), ),
'haka' => array ( 'finland' => array (
'no' => 'Finnland', 'no' => 'Finnland',
'en' => 'Finland', 'en' => 'Finland',
), ),
'sweden' => array (
'no' => 'Sverige',
'en' => 'Sweden',
),
'switch' => array ( 'denmark' => array (
'no' => 'Danmark',
'en' => 'Denmark',
),
'switzerland' => array (
'no' => 'Sveits', 'no' => 'Sveits',
'en' => 'Switzerland', 'en' => 'Switzerland',
), ),
......
...@@ -58,12 +58,15 @@ class sspmod_discopower_PowerIdPDisco extends SimpleSAML_XHTML_IdPDisco { ...@@ -58,12 +58,15 @@ class sspmod_discopower_PowerIdPDisco extends SimpleSAML_XHTML_IdPDisco {
} }
} }
$enableTabs = $this->discoconfig->getValue('tabs', NULL);
foreach($list AS $key => $val) { foreach($list AS $key => $val) {
$tags = array('misc'); $tags = array('misc');
if (array_key_exists('tags', $val)) { if (array_key_exists('tags', $val)) {
$tags = $val['tags']; $tags = $val['tags'];
} }
foreach ($tags AS $tag) { foreach ($tags AS $tag) {
if (!empty($enableTabs) && !in_array($tag, $enableTabs)) continue;
$slist[$tag][$key] = $val; $slist[$tag][$key] = $val;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment