aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/location.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/output/location.php')
-rw-r--r--views/default/output/location.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/views/default/output/location.php b/views/default/output/location.php
new file mode 100644
index 000000000..e1009f17d
--- /dev/null
+++ b/views/default/output/location.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Display a location
+ *
+ * @uses $vars['entity'] The ElggEntity that has a location
+ * @uses $vars['value'] The location string if the entity is not passed
+ */
+
+if (isset($vars['entity'])) {
+ $vars['value'] = $vars['entity']->location;
+ unset($vars['entity']);
+}
+
+// Fixes #4566 we used to allow arrays of strings for location
+if (is_array($vars['value'])) {
+ $vars['value'] = implode(', ', $vars['value']);
+}
+
+echo elgg_view('output/tag', $vars);