Skip to content

Commit

Permalink
Updated default layout to support authenticated users.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjsaylor committed Aug 31, 2013
1 parent b48fe16 commit 5aea89f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion app/View/Elements/nav.ctp
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
<?php
echo $this->Html->link(__('Login'), '/login', array('class' => 'btn btn-primary navbar-btn navbar-right'));
if (empty($User)) {
echo $this->Html->link(__('Login'), '/login', array('class' => 'btn btn-primary navbar-btn navbar-right'));
} else {
?>
<ul class="nav navbar-nav navbar-right">
<li>
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle navbar-btn" data-toggle="dropdown">
<i class="icon-user" style="margin-right: 5px"></i> <?php echo __('Account') ?> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="/account"><i class="icon-gears"></i> <?php echo __('Settings') ?></a></li>
<li><a href="<?php echo Router::url(array('controller' => 'users', 'action' => 'auth')) ?>"><i class="icon-lock"></i> <?php echo __('Applications') ?></a></li>
<li class="divider"></li>
<li><a href="/logout"><i class="icon-off"></i> <?php echo __('Sign Out') ?></a></li>
</ul>
</div>
</li>
</ul>
<?php
}
echo $this->Form->create('Language', array('id' => 'change-language', 'url' => array('controller' => 'users', 'action' => 'change_language'), 'class' => 'navbar-form navbar-right'));
echo $this->Form->input('locale', array('id' => 'change-language-locale', 'label' => false, 'div' => false, 'class' => 'form-control', 'options' => $availableLanguages, 'empty' => __('Choose Language'), 'style' => 'width: 200px;'));
echo $this->Form->end();
Expand Down

0 comments on commit 5aea89f

Please sign in to comment.