Skip to content

Commit

Permalink
Realize v.1 Юху
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiynovos committed Jun 24, 2015
1 parent 3dceda0 commit 4e5e926
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 8 deletions.
9 changes: 1 addition & 8 deletions plugins/MenuBuilder/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,8 @@ function build($menu)
else
$active = '';

echo "<li class='{$active}'><a href='{$item['link']}' class='{$item['class']}'>{$item['title']}</a>";
echo "<li class='{$active}'><a href='{$item['link']}'>{$item['title']}</a>";

if ($item['children'] !== null) {
echo "<ul class='{$item['clild_class']}'>";
foreach ($item['children'] as $sub) {
echo "<li><a href='{$sub['link']}' class='{$sub['class']}'>{$sub['title']}</a></li>";
}
echo "</ul>";
}

echo '</li>';
}
Expand Down
53 changes: 53 additions & 0 deletions templates/chnu/nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<nav class="navbar">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#bs-example-navbar-collapse-1">
<img src="/templates/chnu/images/menu.png">
</button>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<?
$menuBuilder = LoadPlugin('MenuBuilder');
require_once 'menu.php';
$menuBuilder->build($menu);
?>

<ul class="nav navbar-nav navbar-right">
<li><a href="/language/ua"><img src="/languages/ua.png"></a></li>
<li><a href="/language/en"><img src="/languages/en.png" width="24"></a></li>

<?
if (!$user->isAuth()) { ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
aria-haspopup="true"
aria-expanded="false"><?= PERSONAL ?> <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/account/login"><?= SIGN_IN ?></a></li>
<li><a href="/account/registration"><?= REGISTRATION ?></a></li>
</ul>
</li>
<? } else { ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
aria-haspopup="true"
aria-expanded="false"><?= WELCOME ?> <?= $user->user->login ?> <span
class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/messages"><?= MESSAGES ?></a></li>
<li><a href="/discussions"><?= DISCUSSIONS ?></a></li>
<li><a href="/account"><?= PROFILE ?></a></li>
<li><a href="/account/sign_out"><?= SIGN_OUT ?></a></li>
</ul>
</li>
<? } ?>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>

0 comments on commit 4e5e926

Please sign in to comment.