aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/tag.php
blob: 3c002a31b593790d13e2926caec5b63d03280d53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?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['subtype'])) {
	$subtype = "&subtype=" . urlencode($vars['subtype']);
} else {
	$subtype = "";
}
if (!empty($vars['object'])) {
	$object = "&object=" . urlencode($vars['object']);
} else {
	$object = "";
}

if (isset($vars['value'])) {
	if (!empty($vars['type'])) {
		$type = "&type={$vars['type']}";
	} else {
		$type = "";
	}
	$url = elgg_get_site_url() . 'search?q=' . urlencode($vars['value']) . "&search_type=tags{$type}{$subtype}{$object}";
	echo elgg_view('output/url', array(
		'href' => $url,
		'text' => $vars['value'],
		'rel' => 'tag',
	));
}