Skip to content

Commit 0dc37b5

Browse files
committed
refactor: use Translation class
1 parent cd39bfd commit 0dc37b5

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

phpmyfaq/admin/login.php

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22

33
/**
44
* The login form.
5+
*
56
* This Source Code Form is subject to the terms of the Mozilla Public License,
67
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
78
* obtain one at https://mozilla.org/MPL/2.0/.
89
*
9-
* @package phpMyFAQ
10-
* @author Thorsten Rinne <[email protected]>
11-
* @author Alexander M. Turek <[email protected]>
12-
* @copyright 2005-2022 phpMyFAQ Team
13-
* @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
14-
* @link https://www.phpmyfaq.de
15-
* @since 2013-02-05
10+
* @package phpMyFAQ
11+
* @author Thorsten Rinne <[email protected]>
12+
* @author Alexander M. Turek <[email protected]>
13+
* @copyright 2013-2022 phpMyFAQ Team
14+
* @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
15+
* @link https://www.phpmyfaq.de
16+
* @since 2013-02-05
1617
*/
1718

1819
use phpMyFAQ\Component\Alert;
20+
use phpMyFAQ\Translation;
1921

2022
if (isset($error) && 0 < strlen($error)) {
2123
$message = sprintf(
@@ -25,7 +27,7 @@
2527
$error
2628
);
2729
} else {
28-
$message = sprintf('<p>%s</p>', $PMF_LANG['ad_auth_insert']);
30+
$message = sprintf('<p>%s</p>', Translation::get('ad_auth_insert'));
2931
}
3032
if ($action === 'logout') {
3133
$message = Alert::success('ad_logout');
@@ -52,34 +54,35 @@
5254
accept-charset="utf-8" role="form">
5355
<input type="hidden" name="redirect-action" value="<?= $action ?>">
5456
<div class="form-floating mb-3">
55-
<input class="form-control" id="faqusername" name='faqusername' type="text"
56-
placeholder="<?= $PMF_LANG['ad_auth_user'] ?>" />
57-
<label for="faqusername"><?= $PMF_LANG['ad_auth_user'] ?></label>
57+
<input class="form-control" id="faqusername" name="faqusername" type="text"
58+
placeholder="<?= Translation::get('ad_auth_user') ?>" />
59+
<label for="faqusername"><?= Translation::get('ad_auth_user') ?></label>
5860
</div>
5961
<div class="form-floating mb-3">
60-
<input class="form-control" id="faqpassword" name='faqpassword'
61-
type="password" placeholder="<?= $PMF_LANG['ad_auth_passwd'] ?>" />
62-
<label for="faqpassword"><?= $PMF_LANG['ad_auth_passwd'] ?></label>
62+
<input class="form-control" id="faqpassword" name="faqpassword"
63+
type="password" autocomplete="off"
64+
placeholder="<?= Translation::get('ad_auth_passwd') ?>" />
65+
<label for="faqpassword"><?= Translation::get('ad_auth_passwd') ?></label>
6366
</div>
6467
<div class="form-check mb-3">
6568
<input class="form-check-input" id="faqrememberme" type="checkbox"
6669
value="rememberMe" />
6770
<label class="form-check-label"
68-
for="faqrememberme"><?= $PMF_LANG['rememberMe'] ?></label>
71+
for="faqrememberme"><?= Translation::get('rememberMe') ?></label>
6972
</div>
7073
<div class="d-flex align-items-center justify-content-between mt-4 mb-0">
7174
<a class="small"
72-
href="../?action=password"><?= $PMF_LANG['lostPassword'] ?></a>
75+
href="../?action=password"><?= Translation::get('lostPassword') ?></a>
7376
<button type="submit"
74-
class="btn btn-primary"><?= $PMF_LANG['msgLoginUser'] ?></button>
77+
class="btn btn-primary"><?= Translation::get('msgLoginUser') ?></button>
7578
</div>
7679
</form>
7780
</div>
7881
<?php
7982
if ($faqConfig->get('security.enableRegistration')) { ?>
8083
<div class="card-footer text-center py-3">
8184
<div class="small"><a
82-
href="../?action=register"><?= $PMF_LANG['msgRegistration'] ?></a></div>
85+
href="../?action=register"><?= Translation::get('msgRegistration') ?></a></div>
8386
</div>
8487
<?php
8588
} ?>
@@ -97,6 +100,6 @@ class="btn btn-primary"><?= $PMF_LANG['msgLoginUser'] ?></button>
97100
'<p><a href="https://%s%s">%s</a></p>',
98101
$_SERVER['HTTP_HOST'],
99102
$_SERVER['REQUEST_URI'],
100-
$PMF_LANG['msgSecureSwitch']
103+
Translation::get('msgSecureSwitch')
101104
);
102105
}

0 commit comments

Comments
 (0)