aboutsummaryrefslogtreecommitdiff
path: root/mod/file/views/default/file/typecloud.php
blob: b85960849cafaafc21e1958ea4bdeb6d299c1c2d (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php

	$types = $vars['types'];
	
	if (is_array($vars['types']) && sizeof($vars['types'])) {
		
?>
	
		<!--  <div class="filerepo_types"> -->
			<!-- <p><b><?php echo elgg_echo('file:types'); ?>:</b> -->
			
		<div id="canvas_header_submenu">
			<ul>
<?php

		$all = new stdClass;
		$all->tag = "all";
		$vars['types'][] = $all;
		$vars['types'] = array_reverse($vars['types']);
		foreach($vars['types'] as $type) {

			$tag = $type->tag;
			if ($tag != "all") {
				$label = elgg_echo("file:type:" . $tag);
			} else {
				$label = elgg_echo('all');
			}
			
			$url = $vars['url'] . "mod/file/search.php?subtype=file";
			if ($tag != "all")
				$url .= "&md_type=simpletype&tag=" . urlencode($tag);
			if (isset($vars['friend_guid']) && $vars['friend_guid'] != false) {
				$url .= "&friends_guid={$vars['friend_guid']}";
			} else if ($vars['owner_guid'] != "") {
				if (is_array($vars['owner_guid'])) {
					$owner_guid = implode(",",$vars['owner_guid']);
				} else {
					$owner_guid = $vars['owner_guid'];
				}
				$url .= "&owner_guid={$owner_guid}";
			}
			if ($tag == "image")
				$url .= "&search_viewtype=gallery";
			
			$url .= "&page_owner=" . page_owner();
				
			$inputtag = get_input('tag');
			if ($inputtag == $tag || (empty($inputtag) && $tag == "all")) {
				// $class = "class=\"filerepo_types_current\"";
				$class = " class=\"selected\" ";
			} else {
				$class = "";
			}
				
			add_submenu_item($label, $url, 'filetypes');
			
			//echo "<li {$class} ><a href=\"{$url}\">{$label}</a></li>";
			
		}
		
?>
			<!-- </p> -->
			</ul>
		</div>

<?php
		
	}

?>