<?php
/*
 * Copyright (c) 2013, webvariants GbR, http://www.webvariants.de
 *
 * This file is released under the terms of the MIT license. You can find the
 * complete text in the attached LICENSE file or online at:
 *
 * http://www.opensource.org/licenses/mit-license.php
 */

$user = sly_Util_User::getCurrentUser();

if ($user && $this->hasNavigation()) {
	$user_name = $user->getName() != '' ? $user->getName() : $user->getLogin();
	?>
	<ul class="sly-meta">
		<li class="sly-first"><span><?php echo t('logged_in_as').' '.sly_html($user_name) ?></span></li>
		<li><a href="<?php print $_router->getUrl('profile') ?>"><?php echo t('my_profile') ?></a></li>
		<li><a href="<?php print $_router->getUrl('login', 'logout') ?>" class="sly-postlink"><?php echo t('logout') ?></a></li>
		<li><a href="../" class="sly-blank"><?php echo t('to_website') ?></a></li>
	</ul>
	<?php
}
elseif ($this->hasNavigation()) {
	print '<p class="sly-meta">'.t('logged_out').'</p>';
}
