aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/views/default/profile/profile_contents/details.php
blob: 360ea0f9eabee0f0202555457bd2f0cb6c4a5972 (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
<?php
/**
 * Elgg user display (details)
 * @uses $vars['entity'] The user entity
 */

// Simple XFN
$rel = "";
if (elgg_get_page_owner_guid() == $vars['entity']->guid) {
	$rel = 'me';
} else if (check_entity_relationship(elgg_get_page_owner_guid(), 'friend', $vars['entity']->guid)) {
	$rel = 'friend';
}

$even_odd = null;
if (is_array($vars['config']->profile) && sizeof($vars['config']->profile) > 0) {
	foreach($vars['config']->profile as $shortname => $valtype) {
		if ($shortname != "description") {
			$value = $vars['entity']->$shortname;
			if (!empty($value)) {
				//This function controls the alternating class
				$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
				?>
				<p class="<?php echo $even_odd; ?>">
				<b><?php
						echo elgg_echo("profile:{$shortname}");
				?>: </b>
				<?php
					echo elgg_view("output/{$valtype}", array('value' => $vars['entity']->$shortname));
				?>
				</p>
				<?php
			}
		}
	}
}

if (!get_plugin_setting('user_defined_fields', 'profile')) {
	if ($vars['entity']->isBanned()) {
		echo "<div class='banned_user'>";
		echo elgg_echo('profile:banned');
		echo "</div>";
	} else {
		if ($vars['entity']->description) {
			echo "<p class='aboutme_title'><b>" . elgg_echo("profile:aboutme") . "</b></p>";
			echo "<div class='aboutme_contents'>" . elgg_view('output/longtext', array('value' => $vars['entity']->description)) . "</div>";
		}
	}
}