crop.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Avatar crop form
  4. *
  5. * @uses $vars['entity']
  6. */
  7. elgg_load_js('jquery.imgareaselect');
  8. elgg_load_js('elgg.avatar_cropper');
  9. elgg_load_css('jquery.imgareaselect');
  10. $master_img = elgg_view('output/img', array(
  11. 'src' => $vars['entity']->getIconUrl('master'),
  12. 'alt' => elgg_echo('avatar'),
  13. 'class' => 'mrl',
  14. 'id' => 'user-avatar-cropper',
  15. ));
  16. $preview_img = elgg_view('output/img', array(
  17. 'src' => $vars['entity']->getIconUrl('master'),
  18. 'alt' => elgg_echo('avatar'),
  19. ));
  20. ?>
  21. <div class="clearfix">
  22. <?php echo $master_img; ?>
  23. <div id="user-avatar-preview-title"><label><?php echo elgg_echo('avatar:preview'); ?></label></div>
  24. <div id="user-avatar-preview"><?php echo $preview_img; ?></div>
  25. </div>
  26. <div class="elgg-foot">
  27. <?php
  28. $coords = array('x1', 'x2', 'y1', 'y2');
  29. foreach ($coords as $coord) {
  30. echo elgg_view('input/hidden', array('name' => $coord, 'value' => $vars['entity']->$coord));
  31. }
  32. echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid));
  33. echo elgg_view('input/submit', array('value' => elgg_echo('avatar:create')));
  34. ?>
  35. </div>