aboutsummaryrefslogtreecommitdiff
path: root/mod/riverdashboard/views/default/riverdashboard/nav.php
blob: 820ebb5ae37398d141a7eacdbee94301f99206ab (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
<?php

$contents = array();
$contents['all'] = 'all';
if (!empty($vars['config']->registered_entities)) {
	foreach ($vars['config']->registered_entities as $type => $ar) {
		foreach ($vars['config']->registered_entities[$type] as $object) {
			if ($object != 'helppage'){
				if (!empty($object )) {
					$keyname = 'item:'.$type.':'.$object;
				} else {
					$keyname = 'item:'.$type;
				}
				$contents[$keyname] = "{$type},{$object}";
			}
		}
	}
}
	
$allselect = $friendsselect = $mineselect = $display_option = '';
switch($vars['orient']) {
	case '':
		$allselect = 'class="selected"';
		break;
	case 'friends':
		$friendsselect = 'class="selected"';
		$display_option = '&amp;display=friends';
		break;
	case 'mine':
		$mineselect = 'class="selected"';
		$display_option = '&amp;display=mine';
		break;
}
?>
<div class="riverdashboard_filtermenu"> 
	<?php
		$location_filter = "<select onchange=\"window.open(this.options[this.selectedIndex].value,'_top')\" name=\"file_filter\" class='Notstyled' >";
		$current = get_input('subtype');
		foreach($contents as $label => $content) {
			$get_values = explode(",", $content);
			//select the current filter
			if ($get_values[1] == $current) {
				$selected = "SELECTED";
			}
			//set the drop down filter
			if ($content[0] && $content[1]) {
				$location_filter .= "<option {$selected} class='Nomenuoption' value=\"{$CONFIG->url}pg/activity/?type={$get_values[0]}&subtype={$get_values[1]}{$display_option}\" >" . elgg_echo('Show') . " " . elgg_echo($label) . "</option>";
			}
			//reset selected
			$selected = '';
		}
		$location_filter .= "</select>";
		echo $location_filter;
	?>
	<input type="hidden" name="display" id="display" value="<?php echo htmlentities($vars['orient']); ?>" />
</div>
<div id="riverdashboard_updates" class="clearfix"></div>