Commit 994a3656 authored by Nicolas Widart's avatar Nicolas Widart

Squashed 'Modules/Core/' changes from 8c8f7be..ccf32bf

ccf32bf Removing unused method
bfa4c81 Adding a base view composer
3e83717 Adding permission check
5e79ee8 Adding hasAccess

git-subtree-dir: Modules/Core
git-subtree-split: ccf32bf9bfa02539d43b8072e867b5714c73e4fd
parent b66d9325
<?php namespace Modules\Core\Composers;
use Modules\Core\Contracts\Authentication;
abstract class BaseSidebarViewComposer
{
/**
* @var Authentication
*/
protected $auth;
public function __construct(Authentication $auth)
{
$this->auth = $auth;
}
}
......@@ -129,14 +129,6 @@ class InstallCommand extends Command
$this->call('module:seed', ['module' => 'User']);
}
/**
* Run the seeds
*/
private function runSeeds()
{
$this->info('Application seeded!');
}
/**
* Symfony style block messages
* @param $title
......
......@@ -61,4 +61,11 @@ interface Authentication
* @return bool
*/
public function completeResetPassword($user, $code, $password);
/**
* Determines if the current user has access to given permission
* @param $permission
* @return bool
*/
public function hasAccess($permission);
}
......@@ -6,26 +6,32 @@
<?php $items = \Modules\Core\Navigation\NavigationOrdener::order($items); ?>
<?php foreach($items as $i => $item): ?>
<?php if (is_object($item)): ?>
<li class="treeview {{ $item[0]['request'] ? 'active' : ''}}">
<a href="#">
<i class="{{ $item[0]['icon-class'] }}"></i> <span>{{ $item[0]['title'] }}</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<?php $item->shift(); ?>
<ul class="treeview-menu">
<?php foreach($item as $subItem): ?>
<li class="{{ Request::is($subItem['request']) ? 'active' : ''}}">
<a href="{{ URL::route($subItem['route']) }}"><i class="{{$subItem['icon-class']}}"></i> {{ $subItem['title'] }}</a>
</li>
<?php endforeach; ?>
</ul>
</li>
<?php if ($item[0]['permission']): ?>
<li class="treeview {{ $item[0]['request'] ? 'active' : ''}}">
<a href="#">
<i class="{{ $item[0]['icon-class'] }}"></i> <span>{{ $item[0]['title'] }}</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<?php $item->shift(); ?>
<ul class="treeview-menu">
<?php foreach($item as $subItem): ?>
<?php if ($subItem['permission']): ?>
<li class="{{ Request::is($subItem['request']) ? 'active' : ''}}">
<a href="{{ URL::route($subItem['route']) }}"><i class="{{$subItem['icon-class']}}"></i> {{ $subItem['title'] }}</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</li>
<?php endif; ?>
<?php else: ?>
<li class="{{ Request::is($item['request']) ? 'active' : ''}}">
<a href="{{ URL::route($item['route']) }}">
<i class="{{ $item['icon-class'] }}"></i> <span>{{ $item['title'] }}</span>
</a>
</li>
<?php if ($item['permission']): ?>
<li class="{{ Request::is($item['request']) ? 'active' : ''}}">
<a href="{{ URL::route($item['route']) }}">
<i class="{{ $item['icon-class'] }}"></i> <span>{{ $item['title'] }}</span>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment