aboutsummaryrefslogtreecommitdiff
path: root/views/default/groups/profile/profile_block.php
blob: 9dcad2715772851cec67ce321e98e983d9f804c1 (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
<?php
/**
 * Group profile
 *
 * Icon and profile fields
 *
 * @uses $vars['group']
 */

if (!isset($vars['entity']) || !$vars['entity']) {
	echo elgg_echo('groups:notfound');
	return true;
}

$group = $vars['entity'];
$owner = $group->getOwnerEntity();

$profile_fields = elgg_get_config('group');

?>
<div class="groups-profile clearfix">
	<div class="groups-profile-fields elgg-body">
		<p>
			<b><?php echo elgg_echo("groups:owner"); ?>: </b>
			<?php
				echo elgg_view('output/url', array(
					'text' => $owner->name,
					'value' => $owner->getURL(),
				));
			?>
		</p>
		<p>
		<?php
			echo elgg_echo('groups:members') . ": " . $group->getMembers(0, 0, TRUE);
		?>
		</p>
<?php
if (is_array($profile_fields) && count($profile_fields) > 0) {

	$even_odd = 'odd';
	foreach ($profile_fields as $key => $valtype) {
		// do not show the name
		if ($key == 'name') {
			continue;
		}

		$value = $group->$key;
		if (empty($value)) {
			continue;
		}

		$options = array('value' => $group->$key);
		if ($valtype == 'tags') {
			$options['tag_names'] = $key;
		}

		echo "<p class=\"{$even_odd}\">";
		echo "<b>";
		echo elgg_echo("groups:$key");
		echo ": </b>";
		echo elgg_view("output/$valtype", $options);
		echo "</p>";

		$even_odd = ($even_odd == 'even') ? 'odd' : 'even';
	}
}
?>
	</div>
</div>