aboutsummaryrefslogtreecommitdiff
path: root/views/default/page/elements/topbar.php
blob: 98732611910abe36a5a8894ddff709d0935184aa (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
<?php
/**
 * Elgg top toolbar
 * The standard elgg top toolbar
 */

$user = elgg_get_logged_in_user_entity();

//@todo echo elgg_view_menu('topbar', array('class' => 'elgg-menu-topbar'));

// Elgg logo
$image = '<img src="' . elgg_get_site_url() . '_graphics/elgg_toolbar_logo.gif" alt="Elgg logo" />';
echo elgg_view('output/url', array(
	'href' => 'http://www.elgg.org/',
	'text' => $image,
));

// avatar
$user_link = $user->getURL();
$user_image = $user->getIconURL('topbar');
$image = "<img src=\"$user_image\" alt=\"$user->name\" class=\"bab\" />";
echo elgg_view('output/url', array(
	'href' => $user_link,
	'text' => $image,
));

// friends
echo elgg_view('output/url', array(
	'href' => elgg_get_site_url() . "pg/friends/{$user->username}/",
	'text' => '<span class="elgg-icon elgg-icon-friends"></span>',
	'title' => elgg_echo('friends'),
));

// logout link
echo elgg_view('output/url', array(
	'href' => "action/logout",
	'text' => elgg_echo('logout'),
	'is_action' => TRUE,
	'class' => 'elgg-alt',
));

// elgg tools menu
// need to echo this empty view for backward compatibility.
// @todo -- do we really?  So much else is broken, and the new menu system is so much nicer...
echo elgg_view("navigation/topbar_tools");

// enable elgg topbar extending
echo elgg_view('elgg_topbar/extend', $vars);

//@todo echo elgg_view_menu('topbar2', array('class' => 'elgg-menu-topbar elgg-alt'));

// user settings
echo elgg_view('output/url', array(
	'href' => elgg_get_site_url() . "pg/settings/user/{$user->username}",
	'text' => '<span class="elgg-icon elgg-icon-settings"></span>' . elgg_echo('settings'),
	'class' => 'elgg-alt',
));

// The administration link is for admin or site admin users only
if ($user->isAdmin()) {
	echo elgg_view('output/url', array(
		'href' => elgg_get_site_url() . 'pg/admin/',
		'text' => '<span class="elgg-icon elgg-icon-settings"></span>' . elgg_echo('admin'),
		'class' => 'elgg-alt',
	));
}