aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/tag.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/output/tag.php')
-rw-r--r--views/default/output/tag.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/views/default/output/tag.php b/views/default/output/tag.php
new file mode 100644
index 000000000..6bd9a72a7
--- /dev/null
+++ b/views/default/output/tag.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Elgg single tag output
+ *
+ * @uses $vars['value'] String
+ * @uses $vars['type'] The entity type, optional
+ * @uses $vars['subtype'] The entity subtype, optional
+ *
+ */
+
+if (!empty($vars['type'])) {
+ $type = "&type=" . rawurlencode($vars['type']);
+} else {
+ $type = "";
+}
+if (!empty($vars['subtype'])) {
+ $subtype = "&subtype=" . rawurlencode($vars['subtype']);
+} else {
+ $subtype = "";
+}
+if (!empty($vars['object'])) {
+ $object = "&object=" . rawurlencode($vars['object']);
+} else {
+ $object = "";
+}
+
+if (isset($vars['value'])) {
+ $url = elgg_get_site_url() . 'search?q=' . rawurlencode($vars['value']) . "&search_type=tags{$type}{$subtype}{$object}";
+ $vars['value'] = htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8', false);
+ echo elgg_view('output/url', array(
+ 'href' => $url,
+ 'text' => $vars['value'],
+ 'rel' => 'tag',
+ ));
+}