aboutsummaryrefslogtreecommitdiff
path: root/views/default/core/avatar/upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/core/avatar/upload.php')
-rw-r--r--views/default/core/avatar/upload.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/views/default/core/avatar/upload.php b/views/default/core/avatar/upload.php
index 6887eab5c..6f9124192 100644
--- a/views/default/core/avatar/upload.php
+++ b/views/default/core/avatar/upload.php
@@ -5,10 +5,24 @@
* @uses $vars['entity']
*/
-$user_avatar = $vars['entity']->getIcon('medium');
+$user_avatar = elgg_view('output/img', array(
+ 'src' => $vars['entity']->getIconUrl('medium'),
+ 'alt' => elgg_echo('avatar'),
+));
$current_label = elgg_echo('avatar:current');
+$remove_button = '';
+if ($vars['entity']->icontime) {
+ $remove_button = elgg_view('output/url', array(
+ 'text' => elgg_echo('remove'),
+ 'title' => elgg_echo('avatar:remove'),
+ 'href' => 'action/avatar/remove?guid=' . elgg_get_page_owner_guid(),
+ 'is_action' => true,
+ 'class' => 'elgg-button elgg-button-cancel mll',
+ ));
+}
+
$form_params = array('enctype' => 'multipart/form-data');
$upload_form = elgg_view_form('avatar/upload', $form_params, $vars);
@@ -23,8 +37,9 @@ $upload_form = elgg_view_form('avatar/upload', $form_params, $vars);
$image = <<<HTML
<div id="current-user-avatar" class="mrl prl">
<label>$current_label</label><br />
- <img src="$user_avatar" alt="avatar" />
+ $user_avatar
</div>
+$remove_button
HTML;
$body = <<<HTML