Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 25d802e

Browse files
author
Dominik František Bučík
authored
Merge pull request #197 from dBucik/test_sp
fix: 🐛 Remove fixed footer for warning_test_sp
2 parents 610c309 + 8cd30fe commit 25d802e

File tree

3 files changed

+15
-40
lines changed

3 files changed

+15
-40
lines changed

config-templates/module_perun.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,15 @@
264264
],
265265

266266
'warning_test_sp_config' => [
267+
// text to be injected into header of the page (h1 element)
267268
'header' => [
268-
'en' => '<h3>Warning - service in test environment</h3>',
269-
'cs' => '<h3>Varování - testovací služba</h3>',
269+
'en' => 'Warning - service in test environment',
270+
'cs' => 'Varování - testovací služba',
270271
],
272+
// Custom text that will be displayed between the header and continue button. Use paragraphs for formatting.
271273
'text' => [
272-
'en' => '<p>Service is in the test environment.<br class="spacer"/>Hit the continue button.</p>',
273-
'cs' => '<p>Služba je v testovacím režimu.<br class="spacer"/>Pokračujte zmáčknutím tlačítka.</p>',
274+
'en' => '<p>Service is in the test environment.<br/>You can access it, but it might not work as expected.</p><p>Hit the continue button.</p>',
275+
'cs' => '<p>Služba je v testovacím režimu.<br/>Služba v testovacím režimu nemusí správně fungovat.</p><p>Pokračujte zmáčknutím tlačítka.</p>',
274276
],
275277
],
276278
];

templates/warning-test-sp-tpl.php

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php declare(strict_types=1);
22

33
use SimpleSAML\Module;
4+
use SimpleSAML\Module\perun\Auth\Process\WarningTestSP;
45
use SimpleSAML\XHTML\Template;
56

67
/**
@@ -11,29 +12,23 @@
1112
* @var Template $this
1213
*/
1314

14-
$this->data['head'] = '<link rel="stylesheet" media="screen" type="text/css" href="' .
15-
Module::getModuleUrl('perun/res/css/warning_test_sp.css') . '" />';
15+
$customHeaderEnabled = isset($this->data[WarningTestSP::CUSTOM_HEADER_ENABLED])
16+
&& $this->data[WarningTestSP::CUSTOM_HEADER_ENABLED];
17+
$customTextEnabled = isset($this->data[WarningTestSP::CUSTOM_TEXT_ENABLED])
18+
&& $this->data[WarningTestSP::CUSTOM_TEXT_ENABLED];
1619

17-
$this->data['header'] = '';
20+
$this->data['header'] = $customTextEnabled ?
21+
$this->t(WarningTestSP::CUSTOM_HEADER_KEY) :
22+
$this->t('{perun:perun:warning-test-sp-tpl_text}');
1823

1924
$this->includeAtTemplateBase('includes/header.php');
20-
$customHeaderEnabled = isset($this->data[Module\perun\Auth\Process\WarningTestSP::CUSTOM_HEADER_ENABLED])
21-
&& $this->data[Module\perun\Auth\Process\WarningTestSP::CUSTOM_HEADER_ENABLED];
22-
$customTextEnabled = isset($this->data[Module\perun\Auth\Process\WarningTestSP::CUSTOM_TEXT_ENABLED])
23-
&& $this->data[Module\perun\Auth\Process\WarningTestSP::CUSTOM_TEXT_ENABLED];
2425
?>
2526

2627
<form method="post" action="<?php echo Module::getModuleURL('perun/warning_test_sp_continue.php'); ?>">
27-
2828
<input type="hidden" name="StateId" value="<?php echo $_REQUEST['StateId'] ?>">
29-
<h3><?php echo $customTextEnabled ?
30-
$this->t(Module\perun\Auth\Process\WarningTestSP::CUSTOM_HEADER_KEY) :
31-
$this->t('{perun:perun:warning-test-sp-tpl_text}')
32-
?>
33-
</h3>
3429
<?php
3530
if ($customTextEnabled) {
36-
echo '<div>' . $this->t(Module\perun\Auth\Process\WarningTestSP::CUSTOM_TEXT_KEY) . '</div>' . PHP_EOL;
31+
echo '<div>' . $this->t(WarningTestSP::CUSTOM_TEXT_KEY) . '</div>' . PHP_EOL;
3732
}
3833
?>
3934
<br/>

www/res/css/warning_test_sp.css

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)