upload.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Avatar upload view
  4. *
  5. * @uses $vars['entity']
  6. */
  7. $user_avatar = elgg_view('output/img', array(
  8. 'src' => $vars['entity']->getIconUrl('medium'),
  9. 'alt' => elgg_echo('avatar'),
  10. ));
  11. $current_label = elgg_echo('avatar:current');
  12. $remove_button = '';
  13. if ($vars['entity']->icontime) {
  14. $remove_button = elgg_view('output/url', array(
  15. 'text' => elgg_echo('remove'),
  16. 'title' => elgg_echo('avatar:remove'),
  17. 'href' => 'action/avatar/remove?guid=' . elgg_get_page_owner_guid(),
  18. 'is_action' => true,
  19. 'class' => 'elgg-button elgg-button-cancel mll',
  20. ));
  21. }
  22. $form_params = array('enctype' => 'multipart/form-data');
  23. $upload_form = elgg_view_form('avatar/upload', $form_params, $vars);
  24. ?>
  25. <p class="mtm">
  26. <?php echo elgg_echo('avatar:upload:instructions'); ?>
  27. </p>
  28. <?php
  29. $image = <<<HTML
  30. <div id="current-user-avatar" class="mrl prl">
  31. <label>$current_label</label><br />
  32. $user_avatar
  33. </div>
  34. $remove_button
  35. HTML;
  36. $body = <<<HTML
  37. <div id="avatar-upload">
  38. $upload_form
  39. </div>
  40. HTML;
  41. echo elgg_view_image_block($image, $upload_form);