diff options
Diffstat (limited to 'app/Template/user')
-rw-r--r-- | app/Template/user/avatar.php | 20 | ||||
-rw-r--r-- | app/Template/user/sidebar.php | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/app/Template/user/avatar.php b/app/Template/user/avatar.php new file mode 100644 index 00000000..c285f44d --- /dev/null +++ b/app/Template/user/avatar.php @@ -0,0 +1,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> diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php index 20fd2ad2..ecadc60d 100644 --- a/app/Template/user/sidebar.php +++ b/app/Template/user/sidebar.php @@ -37,6 +37,9 @@ <li <?= $this->app->checkMenuSelection('user', 'edit') ?>> <?= $this->url->link(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?> </li> + <li <?= $this->app->checkMenuSelection('user', 'avatar') ?>> + <?= $this->url->link(t('Avatar'), 'user', 'avatar', array('user_id' => $user['id'])) ?> + </li> <?php endif ?> <?php if ($user['is_ldap_user'] == 0): ?> |