Skip to content

Commit

Permalink
Merge pull request #233 from silinternational/feature/ssp2-about2expi…
Browse files Browse the repository at this point in the history
…re-twig

convert about2expire template to Twig
  • Loading branch information
briskt authored Jun 25, 2024
2 parents cf4de70 + 9f0af8e commit 4b8a3bd
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 141 deletions.
Empty file.
4 changes: 2 additions & 2 deletions modules/expirychecker/public/about2expire.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@

$globalConfig = Configuration::getInstance();

$t = new Template($globalConfig, 'expirychecker:about2expire.php');
$t = new Template($globalConfig, 'expirychecker:about2expire');
$t->data['formTarget'] = Module::getModuleURL('expirychecker/about2expire.php');
$t->data['formData'] = ['StateId' => $stateId];
$t->data['daysLeft'] = $state['daysLeft'];
$t->data['dayOrDays'] = (intval($state['daysLeft']) === 1 ? 'day' : 'days');
$t->data['expiresAtTimestamp'] = $state['expiresAtTimestamp'];
$t->data['accountName'] = $state['accountName'];
$t->show();
$t->send();

Logger::info('expirychecker - User has been warned that their password will expire soon.');
45 changes: 0 additions & 45 deletions modules/material/dictionaries/about2expire.definition.json

This file was deleted.

27 changes: 0 additions & 27 deletions modules/material/dictionaries/expired.definition.json

This file was deleted.

9 changes: 0 additions & 9 deletions modules/material/dictionaries/footer.definition.json

This file was deleted.

58 changes: 0 additions & 58 deletions modules/material/themes/material/expirychecker/about2expire.php

This file was deleted.

50 changes: 50 additions & 0 deletions modules/material/themes/material/expirychecker/about2expire.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="{{ currentLanguage }}">
<head>
<title>{{ '{about2expire:title}'|trans }}</title>

{% include 'header.twig' %}
</head>
<body>
<div class="mdl-layout mdl-layout--fixed-header fill-viewport">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<span class="mdl-layout-title">
{{ '{about2expire:header}'|trans }}
</span>
</div>
</header>
<main class="mdl-layout__content" layout-children="column">
<form layout-children="column">
{% for name, value in formData %}
<input type="hidden" name="{{ name|e }}" value="{{ value|e }}">
{% endfor %}

<p class="mdl-typography--title margin">
{% if daysLeft < 2 %}
{{ '{about2expire:expiring_in_a_day}'|trans }}
{% else %}
{{ '{about2expire:expiring_soon}'|trans({'%daysLeft%': daysLeft}) }}
{% endif %}
</p>

<p class="mdl-typography--body-1">
{{ '{about2expire:change_now}'|trans }}
</p>

<div class="fill-parent" layout-children="row" child-spacing="space-around">
<button name="continue" type="submit" class="mdl-button mdl-button--raised">
{{ '{about2expire:button_continue}'|trans }}
</button>

<button name="changepwd" type="submit" class="mdl-button mdl-button--raised mdl-button--primary">
{{ '{about2expire:button_change}'|trans }}
</button>
</div>
</form>
</main>

{% include 'footer.twig' %}
</div>
</body>
</html>

0 comments on commit 4b8a3bd

Please sign in to comment.