settings.php

main 52 lines · 1.7 KB Raw
Alex Alex Commit Initial commit 01/10/2026 09:20
1<?php
2/**
3 * Account settings.
4 *
5 * Prepared by settings.php:
6 * $formState 'success' | 'errors' | 'form'
7 * $errors array of messages, when $formState is 'errors'
8 *
9 * The account write happens in settings.php, never here.
10 */
11?>
12<div class="znx-acct">
13
14<div class="znx-acct-head"><?= t('settings.title') ?></div>
15
16<?php if ($formState === 'success'): ?>
17
18 <div class="znx-acct-info znx-editchar-notice znx-editchar-notice--ok"><?= t('settings.success') ?></div>
19
20<?php else: ?>
21
22 <?php if ($formState === 'errors'): ?>
23 <div class="znx-acct-info znx-editchar-notice znx-editchar-notice--error"><?= output_errors($errors) ?></div>
24 <?php endif; ?>
25
26 <form action="" method="post" class="znx-editchar-box">
27 <div class="znx-settings-field">
28 <label><?= t('settings.email') ?></label>
29 <input type="text" name="new_email" value="<?php echo $user_data['email']; ?>" class="znx-acct-select">
30 </div>
31 <div class="znx-settings-field">
32 <label><?= t('settings.country') ?></label>
33 <select name="new_flag" id="flag_select" class="znx-acct-select">
34 <option value=""><?= t('settings.choose') ?></option>
35 <?php
36 foreach(array('pl', 'se', 'br', 'us', 'gb', ) as $c)
37 echo '<option value="' . $c . '">' . $config['countries'][$c] . '</option>';
38
39 echo '<option value="">----------</option>';
40 foreach($config['countries'] as $code => $c)
41 echo '<option value="' . $code . '"' . (isset($user_znote_data['flag']) && $user_znote_data['flag'] == $code ? ' selected' : '') . '>' . $c . '</option>';
42 ?>
43 </select>
44 </div>
45 <?php Token::create(); ?>
46 <button type="submit" class="znx-acct-btn"><?= t('settings.submit') ?></button>
47 </form>
48
49<?php endif; ?>
50
51</div><!-- .znx-acct -->
52
Top