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 ...@@ -129,14 +129,6 @@ class InstallCommand extends Command
$this->call('module:seed', ['module' => 'User']); $this->call('module:seed', ['module' => 'User']);
} }
/**
* Run the seeds
*/
private function runSeeds()
{
$this->info('Application seeded!');
}
/** /**
* Symfony style block messages * Symfony style block messages
* @param $title * @param $title
......
...@@ -61,4 +61,11 @@ interface Authentication ...@@ -61,4 +61,11 @@ interface Authentication
* @return bool * @return bool
*/ */
public function completeResetPassword($user, $code, $password); 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 @@ ...@@ -6,26 +6,32 @@
<?php $items = \Modules\Core\Navigation\NavigationOrdener::order($items); ?> <?php $items = \Modules\Core\Navigation\NavigationOrdener::order($items); ?>
<?php foreach($items as $i => $item): ?> <?php foreach($items as $i => $item): ?>
<?php if (is_object($item)): ?> <?php if (is_object($item)): ?>
<li class="treeview {{ $item[0]['request'] ? 'active' : ''}}"> <?php if ($item[0]['permission']): ?>
<a href="#"> <li class="treeview {{ $item[0]['request'] ? 'active' : ''}}">
<i class="{{ $item[0]['icon-class'] }}"></i> <span>{{ $item[0]['title'] }}</span> <a href="#">
<i class="fa fa-angle-left pull-right"></i> <i class="{{ $item[0]['icon-class'] }}"></i> <span>{{ $item[0]['title'] }}</span>
</a> <i class="fa fa-angle-left pull-right"></i>
<?php $item->shift(); ?> </a>
<ul class="treeview-menu"> <?php $item->shift(); ?>
<?php foreach($item as $subItem): ?> <ul class="treeview-menu">
<li class="{{ Request::is($subItem['request']) ? 'active' : ''}}"> <?php foreach($item as $subItem): ?>
<a href="{{ URL::route($subItem['route']) }}"><i class="{{$subItem['icon-class']}}"></i> {{ $subItem['title'] }}</a> <?php if ($subItem['permission']): ?>
</li> <li class="{{ Request::is($subItem['request']) ? 'active' : ''}}">
<?php endforeach; ?> <a href="{{ URL::route($subItem['route']) }}"><i class="{{$subItem['icon-class']}}"></i> {{ $subItem['title'] }}</a>
</ul> </li>
</li> <?php endif; ?>
<?php endforeach; ?>
</ul>
</li>
<?php endif; ?>
<?php else: ?> <?php else: ?>
<li class="{{ Request::is($item['request']) ? 'active' : ''}}"> <?php if ($item['permission']): ?>
<a href="{{ URL::route($item['route']) }}"> <li class="{{ Request::is($item['request']) ? 'active' : ''}}">
<i class="{{ $item['icon-class'] }}"></i> <span>{{ $item['title'] }}</span> <a href="{{ URL::route($item['route']) }}">
</a> <i class="{{ $item['icon-class'] }}"></i> <span>{{ $item['title'] }}</span>
</li> </a>
</li>
<?php endif; ?>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </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