Skip to content
Snippets Groups Projects
Commit 543399ca authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Stop calling deprecated methods in SimpleSAML_XHTML_Template.

parent 4f3aadd1
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ $this->includeAtTemplateBase('includes/header.php');
echo('<h2>' . $this->data['header'] . '</h2>');
echo('<p>' . $this->t('{logout:logged_out_text}') . '</p>');
if($this->getTag($this->data['text']) !== NULL) {
if($this->getTranslator()->getTag($this->data['text']) !== NULL) {
$this->data['text'] = $this->t($this->data['text']);
}
echo('<p>[ <a href="' . htmlspecialchars($this->data['link']) . '">' .
......
......@@ -9,12 +9,18 @@ $this->includeAtTemplateBase('includes/header.php');
foreach ($this->data['idplist'] as $idpentry) {
if (!empty($idpentry['name'])) {
$this->includeInlineTranslation('idpname_'.$idpentry['entityid'], $idpentry['name']);
$this->getTranslator()->includeInlineTranslation(
'idpname_'.$idpentry['entityid'],
$idpentry['name']
);
} elseif (!empty($idpentry['OrganizationDisplayName'])) {
$this->includeInlineTranslation('idpname_'.$idpentry['entityid'], $idpentry['OrganizationDisplayName']);
$this->getTranslator()->includeInlineTranslation(
'idpname_'.$idpentry['entityid'],
$idpentry['OrganizationDisplayName']
);
}
if (!empty($idpentry['description'])) {
$this->includeInlineTranslation('idpdesc_'.$idpentry['entityid'], $idpentry['description']);
$this->getTranslator()->includeInlineTranslation('idpdesc_'.$idpentry['entityid'], $idpentry['description']);
}
}
?>
......@@ -28,6 +34,7 @@ foreach ($this->data['idplist'] as $idpentry) {
<select id="dropdownlist" name="idpentityid">
<?php
usort($this->data['idplist'], function ($idpentry1, $idpentry2) {
// TODO: this is only compatible with PHP >= 5.4, fix compat with 5.3!
return strcmp($this->t('idpname_'.$idpentry1['entityid']), $this->t('idpname_'.$idpentry2['entityid']));
});
......
......@@ -8,12 +8,15 @@ $this->data['autofocus'] = 'preferredidp';
$this->includeAtTemplateBase('includes/header.php');
foreach ($this->data['idplist'] as $idpentry) {
if (isset($idpentry['name'])) {
$this->includeInlineTranslation('idpname_'.$idpentry['entityid'], $idpentry['name']);
$this->getTranslator()->includeInlineTranslation('idpname_'.$idpentry['entityid'], $idpentry['name']);
} elseif (isset($idpentry['OrganizationDisplayName'])) {
$this->includeInlineTranslation('idpname_'.$idpentry['entityid'], $idpentry['OrganizationDisplayName']);
$this->getTranslator()->includeInlineTranslation(
'idpname_'.$idpentry['entityid'],
$idpentry['OrganizationDisplayName']
);
}
if (isset($idpentry['description'])) {
$this->includeInlineTranslation('idpdesc_'.$idpentry['entityid'], $idpentry['description']);
$this->getTranslator()->includeInlineTranslation('idpdesc_'.$idpentry['entityid'], $idpentry['description']);
}
}
?>
......
<?php
if (array_key_exists('header', $this->data)) {
if ($this->getTag($this->data['header']) !== null) {
if ($this->getTranslator()->getTag($this->data['header']) !== null) {
$this->data['header'] = $this->t($this->data['header']);
}
}
......
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