Skip to content

Commit

Permalink
Fixed #183
Browse files Browse the repository at this point in the history
  • Loading branch information
Parziphal committed Jul 26, 2016
1 parent 708bddf commit 7865238
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions app/views/layouts/_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
* having placeholders for user id and name that will be replaced with current user's
* data right before echoing the menu.
*/
$key = 'menu.'.current_user()->level;
$key = 'menu.' . Rails::application()->I18n()->locale() . '.'.current_user()->level;
$menu = Rails::cache()->read($key);

if (!$menu) :
ob_start();
?>
<ul>
<li class="user"><?= $this->linkTo($this->t('.account._'), ['user#home'], ['onclick' => 'if(!User.run_login_onclick(event)) return false;', 'class' => 'login-button']) ?>
<?= $this->linkTo('', '#', ['class' => 'submenu-button']) ?>
<ul class="submenu">
<?php if (current_user()->is_anonymous()) : ?>
<?php if (current_user()->is_anonymous()) : ?>
<li><?= $this->linkTo($this->t('.account.login'), ['controller' => 'user', 'action' => 'login'], ['id' => 'login-link', 'class' => 'login-button']) ?></li>
<li><?= $this->linkTo($this->t('.account.reset'), ['controller' => 'user', 'action' => 'reset_password']) ?></li>
<?php else: ?>
<?php else: ?>
<li><?= $this->linkTo($this->t('.account.profile'), ['controller' => 'user', 'action' => 'show', 'id' => "-user.id-"]) // MI: -user.id- ?></li>
<li><?= $this->linkTo($this->t('.account.mail'), ['controller' => 'dmail', 'action' => 'inbox']) ?></li>
<li><?= $this->linkTo($this->t('.account.favorites'), ['controller' => 'post', 'action' => 'index', 'tags' => "order:vote vote:3:-user.name-"]) // MI: -user.name- ?></li>
Expand All @@ -28,15 +28,15 @@
<?php endif ?>
</ul>
</li>
<li class="post"><?= $this->linkTo($this->t('.posts._'), ['controller' => 'post', 'action' => 'index']) ?>
<?= $this->linkTo('', '#', ['class' => 'submenu-button']) ?>
<li class="post"><?= $this->linkTo($this->t('.posts._'), ['controller' => 'post', 'action' => 'index']) ?>
<?= $this->linkTo('', '#', ['class' => 'submenu-button']) ?>
<ul class="search-box">
<li>
<div>
<?= $this->formTag('post#', ['method' => 'get'], function(){ ?>
<?= $this->formTag('post#', ['method' => 'get'], function(){ ?>
<?= $this->textFieldTag('tags', '', ['id' => '']) ?><br />
<?= $this->submitTag($this->t('.posts.search')) ?>
<?php }) ?>
<?= $this->submitTag($this->t('.posts.search')) ?>
<?php }) ?>
</div>
</li>
</ul>
Expand Down Expand Up @@ -207,10 +207,7 @@
<li><?= $this->linkTo($this->t('.help.site'), "help#") ?></li>
</ul>
</li>





<li class="static"><?= $this->linkTo($this->t('.more'), ['controller' => 'static', 'action' => 'more']) ?>
</li>
<li class="has-mail">
Expand Down

0 comments on commit 7865238

Please sign in to comment.