aboutsummaryrefslogtreecommitdiff
path: root/views/default/groups/profile/fields.php
blob: 41b0de9a0b2ccd86cd5e1820d21237353c436845 (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
<?php
/**
 * Group profile fields
 */

$group = $vars['entity'];

$profile_fields = elgg_get_config('group');

if (is_array($profile_fields) && count($profile_fields) > 0) {

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

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

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

		if ($output = elgg_view("output/$valtype", $options)) {

			echo "<div class=\"{$even_odd}\">";
			echo "<b>";
			echo elgg_echo("groups:$key");
			echo ": </b>";
			echo $output;
			echo "</div>";

			$even_odd = ($even_odd == 'even') ? 'odd' : 'even';
		}
	}
}