Skip to content

Commit 132050c

Browse files
committed
fix: single language handling in form
1 parent b19f78e commit 132050c

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

snippets/form.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
<?php
2-
$formName = '';
3-
$formEmail = '';
4-
$pageLanguage = $kirby->language()->code() ?? 'en';
5-
$user = $kirby->user();
6-
7-
if (!is_null($user) && $user->isLoggedIn()) {
8-
$formName = $user->name();
9-
$formEmail = $user->email();
10-
}
2+
$formName = '';
3+
$formEmail = '';
4+
$pageLanguage = $kirby->language() ? $kirby->language()->code() : 'en';
5+
$user = $kirby->user();
6+
7+
if (!is_null($user) && $user->isLoggedIn()) {
8+
$formName = $user->name();
9+
$formEmail = $user->email();
10+
}
1111
?>
1212
<form action="<?= $kirby->url('index') ?>/komments/send" method="post" id="kommentform">
1313

1414
<div class="form-feedback">
1515
<div class="msg user-feedback"></div>
1616
<div class="msg loader">
17-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path></svg>
17+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
18+
<path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path>
19+
</svg>
1820
<span><?php echo t('mauricerenck.komments.sending'); ?></span>
1921
</div>
2022
</div>
@@ -50,4 +52,4 @@
5052
<span class="komment-privacy"><?php echo t('mauricerenck.komments.form.privacy'); ?></span>
5153
<input type="submit" value="<?php echo t('mauricerenck.komments.form.submit'); ?>" class="<?php echo option('mauricerenck.komments.form.submit.classNames', 'button button-tiny button-primary'); ?>">
5254
</form>
53-
<?php echo js(['/media/plugins/mauricerenck/komments/komments.js']); ?>
55+
<?php echo js(['/media/plugins/mauricerenck/komments/komments.js']); ?>

0 commit comments

Comments
 (0)