img.php 454 B

123456789101112131415161718
  1. <?php
  2. /**
  3. * Elgg image view
  4. *
  5. * @uses string $vars['src'] The image src url (required).
  6. * @uses string $vars['alt'] The alternate text for the image (required).
  7. */
  8. if (!isset($vars['alt'])) {
  9. elgg_log("The view output/img requires that the alternate text be set.", 'NOTICE');
  10. }
  11. $vars['src'] = elgg_normalize_url($vars['src']);
  12. $vars['src'] = elgg_format_url($vars['src']);
  13. $attributes = elgg_format_attributes($vars);
  14. echo "<img $attributes/>";