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

$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>";
		}
	}
}