location.php 460 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * Display a location
  4. *
  5. * @uses $vars['entity'] The ElggEntity that has a location
  6. * @uses $vars['value'] The location string if the entity is not passed
  7. */
  8. if (isset($vars['entity'])) {
  9. $vars['value'] = $vars['entity']->location;
  10. unset($vars['entity']);
  11. }
  12. // Fixes #4566 we used to allow arrays of strings for location
  13. if (is_array($vars['value'])) {
  14. $vars['value'] = implode(', ', $vars['value']);
  15. }
  16. echo elgg_view('output/tag', $vars);