location.php 538 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * Location input field
  4. *
  5. * @uses $vars['entity'] The ElggEntity that has a location
  6. * @uses $vars['value'] The default value for the location
  7. * @uses $vars['class'] Additional CSS class
  8. */
  9. $vars['class'] = (array) elgg_extract('class', $vars, []);
  10. $vars['class'][] = 'elgg-input-location';
  11. $defaults = array(
  12. 'disabled' => false,
  13. );
  14. if (isset($vars['entity'])) {
  15. $defaults['value'] = $vars['entity']->location;
  16. unset($vars['entity']);
  17. }
  18. $vars = array_merge($defaults, $vars);
  19. echo elgg_view('input/tag', $vars);