navbar for mobiles devices

This commit is contained in:
Diego Najar 2018-08-04 12:44:37 +02:00
parent 1caddac331
commit 96f44aa286
6 changed files with 44 additions and 7 deletions

View File

@ -148,10 +148,10 @@ class dbList extends dbJSON
return $tmp; return $tmp;
} }
// Returns the amount of items for some key // Returns the number of items in the list
public function countItems($key) public function countItems($key)
{ {
if( isset($this->db[$key]) ) { if (isset($this->db[$key])) {
return count($this->db[$key]['list']); return count($this->db[$key]['list']);
} }
return 0; return 0;

View File

@ -0,0 +1,34 @@
<nav class="navbar navbar-light bg-light d-block d-sm-none">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#"><?php echo (defined('BLUDIT_PRO'))?'BLUDIT PRO':'BLUDIT' ?></a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><?php $L->p('Dashboard') ?></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>"><?php $L->p('New content') ?></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>"></span><?php $L->p('Content') ?></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'categories' ?>"><?php $L->p('Categories') ?></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"><?php $L->p('Users') ?></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'settings' ?>"><?php $L->p('Settings') ?></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>"><?php $L->p('Plugins') ?></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>"><?php $L->p('Themes') ?></a>
</li>
</ul>
</div>
</nav>

View File

@ -54,6 +54,9 @@
<!-- Alert --> <!-- Alert -->
<?php include('html/alert.php'); ?> <?php include('html/alert.php'); ?>
<!-- Navbar, only for small devices -->
<?php include('html/navbar.php'); ?>
<div class="container"> <div class="container">
<!-- 25%/75% split on large devices, small, medium devices hide --> <!-- 25%/75% split on large devices, small, medium devices hide -->
<div class="row"> <div class="row">

View File

@ -11,12 +11,12 @@ if($url->whereAmI()=='admin') {
elseif($url->whereAmI()=='tag') { elseif($url->whereAmI()=='tag') {
$itemsPerPage = $site->itemsPerPage(); $itemsPerPage = $site->itemsPerPage();
$tagKey = $url->slug(); $tagKey = $url->slug();
$amountOfItems = $tags->countPagesByTag($tagKey); $amountOfItems = $tags->numberOfPages($tagKey);
} }
elseif($url->whereAmI()=='category') { elseif($url->whereAmI()=='category') {
$itemsPerPage = $site->itemsPerPage(); $itemsPerPage = $site->itemsPerPage();
$categoryKey = $url->slug(); $categoryKey = $url->slug();
$amountOfItems = $categories->countPagesByCategory($categoryKey); $amountOfItems = $categories->numberOfPages($categoryKey);
} }
else { else {
$itemsPerPage = $site->itemsPerPage(); $itemsPerPage = $site->itemsPerPage();

View File

@ -7,7 +7,7 @@ class Categories extends dbList {
parent::__construct(DB_CATEGORIES); parent::__construct(DB_CATEGORIES);
} }
function countPagesByCategory($key) function numberOfPages($key)
{ {
return $this->countItems($key); return $this->countItems($key);
} }

View File

@ -7,9 +7,9 @@ class Tags extends dbList {
parent::__construct(DB_TAGS); parent::__construct(DB_TAGS);
} }
function countPagesByTag($tagKey) function numberOfPages($key)
{ {
return $this->countItems($tagKey); return $this->countItems($key);
} }
public function reindex() public function reindex()