Skip to content
Snippets Groups Projects
Commit 949448f0 authored by Olav Morken's avatar Olav Morken
Browse files

Made IdP discovery service translateable.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@623 44740490-163a-0410-bde0-09ae8108e29a
parent 91278934
No related branches found
No related tags found
No related merge requests found
<?php
$lang = array(
'selectidp' => array (
'en' => 'Select your identity privider',
'no' => 'Velg din identitetsleverandør',
),
'selectidp_full' => array (
'en' => 'Please select the identity provider where you want to authenticate:',
'no' => 'Vennligst velg hvilken identitetsleverandør du vil bruke for å logge inn:',
),
'select' => array (
'en' => 'Select',
'no' => 'Velg',
),
);
?>
\ No newline at end of file
<?php $this->includeAtTemplateBase('includes/header.php'); ?>
<?php
if(!array_key_exists('header', $this->data)) {
$this->data['header'] = 'selectidp';
}
$this->data['header'] = $this->t($this->data['header']);
$this->includeAtTemplateBase('includes/header.php');
?>
<div id="content">
<h2><?php if (isset($this->data['header'])) { echo $this->data['header']; } else { echo "Select your IdP"; } ?></h2>
<h2><?php echo $this->data['header']; ?></h2>
<p>Please select the identity provider where you want to authenticate:</p>
<p><?php echo $this->t('selectidp_full'); ?></p>
<form method="get" action="<?php echo $this->data['urlpattern']; ?>">
<input type="hidden" name="entityID" value="<?php echo htmlspecialchars($this->data['entityID']); ?>" />
......@@ -27,7 +33,7 @@
}
?>
</select>
<input type="submit" value="Select"/>
<input type="submit" value="<?php echo $this->t('select'); ?>"/>
</form>
......
<?php $this->includeAtTemplateBase('includes/header.php'); ?>
<?php
if(!array_key_exists('header', $this->data)) {
$this->data['header'] = 'selectidp';
}
$this->data['header'] = $this->t($this->data['header']);
$this->includeAtTemplateBase('includes/header.php');
?>
<div id="content">
<h2><?php if (isset($this->data['header'])) { echo $this->data['header']; } else { echo "Select your IdP"; } ?></h2>
<h2><?php echo $this->data['header']; ?></h2>
<p>Please select the identity provider where you want to authenticate:</p>
<p><?php echo $this->t('selectidp_full'); ?></p>
<?php
......
......@@ -62,8 +62,7 @@ if (!empty($_COOKIE['preferedidp'])) {
* Currently the supported options is either a drop down menu or a list view.
*/
$templatefile = ($config->getValue('idpdisco.layout') == 'dropdown' ? 'selectidp-dropdown.php' : 'selectidp-links.php');
$t = new SimpleSAML_XHTML_Template($config, $templatefile);
$t->data['header'] = 'Select your identity provider';
$t = new SimpleSAML_XHTML_Template($config, $templatefile, 'disco.php');
$t->data['idplist'] = $idplist;
$t->data['preferredidp'] = $preferredidp;
......@@ -71,11 +70,11 @@ if ($config->getValue('idpdisco.layout') == 'dropdown') {
$t->data['return']= $return;
$t->data['returnIDParam'] = $returnidparam;
$t->data['entityID'] = $spentityid;
$t->data['urlpattern'] = htmlentities(SimpleSAML_Utilities::selfURLNoQuery());
$t->data['urlpattern'] = htmlspecialchars(SimpleSAML_Utilities::selfURLNoQuery());
$t->show();
} else {
$t->data['urlpattern'] = htmlentities(SimpleSAML_Utilities::selfURL() . '&idpentityid=');
$t->data['urlpattern'] = htmlspecialchars(SimpleSAML_Utilities::selfURL() . '&idpentityid=');
$t->show();
}
......
......@@ -48,22 +48,20 @@ try {
}
if ($config->getValue('idpdisco.layout') == 'dropdown') {
$t = new SimpleSAML_XHTML_Template($config, 'selectidp-dropdown.php');
$t->data['header'] = 'Select your identity provider';
$t = new SimpleSAML_XHTML_Template($config, 'selectidp-dropdown.php', 'disco.php');
$t->data['idplist'] = $idplist;
$t->data['return']= $return;
$t->data['returnIDParam'] = $returnidparam;
$t->data['entityID'] = $spentityid;
$t->data['preferedidp'] = (!empty($_COOKIE['preferedidp'])) ? $_COOKIE['preferedidp'] : null;
$t->data['urlpattern'] = htmlentities(SimpleSAML_Utilities::selfURLNoQuery());
$t->data['urlpattern'] = htmlspecialchars(SimpleSAML_Utilities::selfURLNoQuery());
$t->show();
}
else
{
$t = new SimpleSAML_XHTML_Template($config, 'selectidp-links.php');
$t->data['header'] = 'Select your identity provider';
$t = new SimpleSAML_XHTML_Template($config, 'selectidp-links.php', 'disco.php');
$t->data['idplist'] = $idplist;
$t->data['urlpattern'] = htmlentities(SimpleSAML_Utilities::selfURL() . '&idpentityid=');
$t->data['urlpattern'] = htmlspecialchars(SimpleSAML_Utilities::selfURL() . '&idpentityid=');
$t->show();
}
......
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