summaryrefslogtreecommitdiff
path: root/app/Template/user/avatar.php
blob: c285f44d624dc37fac223a6d147074392ef0fca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<div class="page-header">
    <h2><?= t('Avatar') ?></h2>
</div>

<?= $this->avatar->render($user['id'], $user['username'], $user['name'], $user['email'], $user['avatar_path'], '') ?>

<form method="post" enctype="multipart/form-data" action="<?= $this->url->href('user', 'uploadAvatar', array('user_id' => $user['id'])) ?>">
    <?= $this->form->csrf() ?>
    <?= $this->form->label(t('Upload my avatar image'), 'avatar') ?>
    <?= $this->form->file('avatar') ?>

    <div class="form-actions">
        <?php if (! empty($user['avatar_path'])): ?>
            <?= $this->url->link(t('Remove my image'), 'User', 'removeAvatar', array('user_id' => $user['id']), true, 'btn btn-red') ?>
        <?php endif ?>
        <button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
        <?= t('or') ?>
        <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
    </div>
</form>