diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-04 16:22:42 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-04 16:22:42 +0000 |
commit | 8e56ebfaa05eb987e65bbff91aae268c479301de (patch) | |
tree | 7c890256842c60d2bf5a40dec669c746d12a6fd1 | |
parent | f52be8823d40d23e5a5ac7f6e2bf9c609ffcbe38 (diff) | |
download | elgg-8e56ebfaa05eb987e65bbff91aae268c479301de.tar.gz elgg-8e56ebfaa05eb987e65bbff91aae268c479301de.tar.bz2 |
Removing hard-coded plugin extensions from core topbar.
git-svn-id: http://code.elgg.org/elgg/trunk@5967 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | views/default/page_elements/elgg_topbar.php | 88 |
1 files changed, 37 insertions, 51 deletions
diff --git a/views/default/page_elements/elgg_topbar.php b/views/default/page_elements/elgg_topbar.php index c59360a3a..6348099bc 100644 --- a/views/default/page_elements/elgg_topbar.php +++ b/views/default/page_elements/elgg_topbar.php @@ -3,62 +3,48 @@ * Elgg top toolbar * The standard elgg top toolbar */ -?> -<?php - if (isloggedin()) { -?> - -<div id="elgg_topbar" class="clearfloat"> -<div id="elgg_topbar_contents"> - <a href="http://www.elgg.org"><img class="site_logo" src="<?php echo $vars['url']; ?>_graphics/elgg_toolbar_logo.gif" alt="Elgg logo" /></a> - <a href="<?php echo $_SESSION['user']->getURL(); ?>"><img class="user_mini_avatar" src="<?php echo $_SESSION['user']->getIcon('topbar'); ?>" alt="User avatar" /></a> - - <?php - // 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 = get_loggedin_user(); +if (($user instanceof ElggUser) && ($user->guid > 0)) { + echo '<div id="elgg_topbar" class="clearfloat">'; + echo '<div id="elgg_topbar_contents">'; - // add Friends to top toolbar - if profile mod is running - if ( is_plugin_enabled('profile') ) { - $user = get_loggedin_user(); - echo "<a class='myfriends' href=\"".$CONFIG->wwwroot . "pg/friends/" . $user->username."\" title=\"".elgg_echo('friends')."\">".elgg_echo('friends')."</a>"; - } - ?> + // Elgg logo + echo '<a href="http://www.elgg.org">'; + echo "<img class=\"site_logo\" src=\"{$vars['url']}_graphics/elgg_toolbar_logo.gif\" alt=\"Elgg logo\" />"; + echo '</a>'; - <div class="log_out"> - <?php echo elgg_view('output/url', array('href' => "{$vars['url']}action/logout", 'text' => elgg_echo('logout'), 'is_action' => TRUE)); ?> - </div> + // 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 '<div class="log_out">'; + echo elgg_view('output/url', array( + 'href' => "{$vars['url']}action/logout", + 'text' => elgg_echo('logout'), + 'is_action' => TRUE + )); + echo '</div>'; - <a href="<?php echo $vars['url']; ?>pg/settings/" class="settings"><?php echo elgg_echo('settings'); ?></a> + // user settings + $settings = elgg_echo('settings'); + echo "<a href=\"{$vars['url']}pg/settings\" class=\"settings\">$settings</a>"; - <?php // The administration link is for admin or site admin users only - if ($vars['user']->isAdmin()) { - ?> - <a href="<?php echo $vars['url']; ?>pg/admin/" class="admin"><?php echo elgg_echo("admin"); ?></a> - - <?php - } - - if(is_plugin_enabled('help')){ - ?> - <a href="<?php echo $vars['url']; ?>mod/help/index.php" class="help">Help</a> - <?php + if ($user->isAdmin()) { + $admin = elgg_echo("admin"); + echo "<a href=\"{$vars['url']}pg/admin\" class=\"admin\">$admin</a>"; } + + // 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); - if(is_plugin_enabled('shared_access')){ - ?> - <a href="<?php echo $vars['url']; ?>pg/shared_access/home" class="shared_access"><?php echo elgg_echo('shared_access:shared_access'); ?></a> - <?php - } - ?> - -</div> -</div> -<?php - } -?> + echo '</div>'; + echo '</div>'; +} |