aboutsummaryrefslogtreecommitdiff
path: root/views/default/page/elements
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-09 13:20:24 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-09 13:20:24 +0000
commit4f5271d975e7d07a2a3a654377a72c2e0f854b40 (patch)
tree1a27b7d36f4c8b54dcb17b4d9b1524701f34a45d /views/default/page/elements
parentffec407a4021861215143dacfba4ce82d6c14dde (diff)
downloadelgg-4f5271d975e7d07a2a3a654377a72c2e0f854b40.tar.gz
elgg-4f5271d975e7d07a2a3a654377a72c2e0f854b40.tar.bz2
cleaning up the topbar CSS
git-svn-id: http://code.elgg.org/elgg/trunk@7579 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/page/elements')
-rw-r--r--views/default/page/elements/topbar.php96
-rw-r--r--views/default/page/elements/topbar_logout.php6
2 files changed, 63 insertions, 39 deletions
diff --git a/views/default/page/elements/topbar.php b/views/default/page/elements/topbar.php
index 3a4507208..7d57ed684 100644
--- a/views/default/page/elements/topbar.php
+++ b/views/default/page/elements/topbar.php
@@ -5,40 +5,64 @@
*/
$user = get_loggedin_user();
-if (($user instanceof ElggUser) && ($user->guid > 0)) {
- echo '<div class="elgg-page-topbar">';
- echo '<div class="elgg-inner">';
-
- // Elgg logo
- echo '<a href="http://www.elgg.org">';
- echo "<img class=\"site-logo\" src=\"".elgg_get_site_url()."_graphics/elgg_toolbar_logo.gif\" alt=\"Elgg logo\" />";
- echo '</a>';
-
- // avatar
- $user_link = $user->getURL();
- $user_image = $user->getIcon('topbar');
- echo "<a href=\"$user_link\"><img class=\"user-mini-avatar\" src=\"$user_image\" alt=\"User avatar\" /></a>";
-
- // logout link
- echo elgg_view('page/elements/topbar_logout', $vars);
-
- // elgg tools menu
- // need to echo this empty view for backward compatibility.
- echo elgg_view("navigation/topbar_tools");
-
- // enable elgg topbar extending
- echo elgg_view('elgg_topbar/extend', $vars);
-
- // user settings
- $settings = elgg_echo('settings');
- echo "<a href=\"".elgg_get_site_url()."pg/settings\" class=\"settings\">$settings</a>";
-
- // The administration link is for admin or site admin users only
- if ($user->isAdmin()) {
- $admin = elgg_echo("admin");
- echo "<a href=\"".elgg_get_site_url()."pg/admin\" class=\"admin\">$admin</a>";
- }
-
- echo '</div>';
- echo '</div>';
+if (!elgg_instanceof($user, 'user')) {
+ // do not show tobpar to logged out users
+ return true;
}
+
+echo '<div class="elgg-page-topbar">';
+echo '<div class="elgg-inner clearfix">';
+
+// Elgg logo
+echo '<a href="http://www.elgg.org" class="main">';
+echo "<img class=\"site-logo\" src=\"".elgg_get_site_url()."_graphics/elgg_toolbar_logo.gif\" alt=\"Elgg logo\" />";
+echo '</a>';
+
+// avatar
+$user_link = $user->getURL();
+$user_image = $user->getIcon('topbar');
+echo "<a href=\"$user_link\" class=\"main\"><img class=\"user-mini-avatar\" src=\"$user_image\" alt=\"User avatar\" /></a>";
+
+// friends
+//$friends = elgg_echo('friends');
+//echo "<a class='myfriends main' href=\"".elgg_get_site_url()."pg/friends/{$user->username}\" title=\"$friends\">&nbsp;</a>";
+echo elgg_view('output/url', array(
+ 'href' => elgg_get_site_url() . "pg/settings/{$user->username}/",
+ 'text' => '<span class="elgg-icon elgg-icon-friends"></span>',
+ 'class' => 'main',
+ 'title' => elgg_echo('friends'),
+));
+
+// logout link
+echo elgg_view('output/url', array(
+ 'href' => "action/logout",
+ 'text' => elgg_echo('logout'),
+ 'is_action' => TRUE,
+ 'class' => 'alt',
+));
+
+// elgg tools menu
+// need to echo this empty view for backward compatibility.
+echo elgg_view("navigation/topbar_tools");
+
+// enable elgg topbar extending
+echo elgg_view('elgg_topbar/extend', $vars);
+
+// user settings
+echo elgg_view('output/url', array(
+ 'href' => elgg_get_site_url() . 'pg/settings/',
+ 'text' => '<span class="elgg-icon elgg-icon-settings"></span>' . elgg_echo('settings'),
+ 'class' => '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' => 'alt',
+ ));
+}
+
+echo '</div>';
+echo '</div>';
diff --git a/views/default/page/elements/topbar_logout.php b/views/default/page/elements/topbar_logout.php
index 2d2ecf67c..a4bc55e6e 100644
--- a/views/default/page/elements/topbar_logout.php
+++ b/views/default/page/elements/topbar_logout.php
@@ -5,10 +5,10 @@
* Called within the Elgg topbar view.
*/
-echo '<div class="log-out">';
+
echo elgg_view('output/url', array(
'href' => "action/logout",
'text' => elgg_echo('logout'),
- 'is_action' => TRUE
+ 'is_action' => TRUE,
+ 'class' => 'alt',
));
-echo '</div>';