diff options
Diffstat (limited to 'views/default/core/avatar/upload.php')
| -rw-r--r-- | views/default/core/avatar/upload.php | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/views/default/core/avatar/upload.php b/views/default/core/avatar/upload.php index 8d920a900..6f9124192 100644 --- a/views/default/core/avatar/upload.php +++ b/views/default/core/avatar/upload.php @@ -5,7 +5,26 @@ * @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); ?> @@ -13,14 +32,20 @@ $user_avatar = $vars['entity']->getIcon('medium'); <?php echo elgg_echo('avatar:upload:instructions'); ?> </p> -<div id="current-user-avatar"> - <label><?php echo elgg_echo('avatar:current'); ?></label> - <?php echo "<img src=\"{$user_avatar}\" alt=\"avatar\" />"; ?> +<?php + +$image = <<<HTML +<div id="current-user-avatar" class="mrl prl"> + <label>$current_label</label><br /> + $user_avatar </div> +$remove_button +HTML; +$body = <<<HTML <div id="avatar-upload"> -<?php - $form_params = array('enctype' => 'multipart/form-data'); - echo elgg_view_form('avatar/upload', $form_params, $vars); -?> + $upload_form </div> +HTML; + +echo elgg_view_image_block($image, $upload_form); |
