Commit 97f5da74 authored by Nicolas Widart's avatar Nicolas Widart

First commit

parents
<?php namespace Modules\Workshop\Composers;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Request;
class SidebarViewComposer
{
public function compose($view)
{
$view->items->put('workbench', Collection::make([
[
'weight' => '1',
'request' => Request::is("{$view->prefix}/workshop*"),
'route' => '#',
'icon-class' => 'fa fa-cogs',
'title' => 'Workshop',
],
[
'request' => "{$view->prefix}/workshop/modules*",
'route' => 'dashboard.modules.index',
'icon-class' => 'fa fa-cog',
'title' => 'Modules',
]
]));
}
}
\ No newline at end of file
<?php namespace Modules\Workshop\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class WorkshopDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
}
\ No newline at end of file
<?php namespace Modules\Workshop\Http\Controllers;
use Illuminate\Support\Facades\View;
use Modules\Core\Http\Controllers\Admin\AdminBaseController;
use Pingpong\Modules\Module;
class WorkshopController extends AdminBaseController
{
/**
* @var Module
*/
private $module;
public function __construct(Module $module)
{
parent::__construct();
$this->module = $module;
}
public function index()
{
$modules = $this->module->all();
return View::make('workshop::admin.modules.index', compact('modules'));
}
}
\ No newline at end of file
<?php
Route::group(['prefix' => Config::get('core::core.admin-prefix').'/workshop', 'namespace' => 'Modules\Workshop\Http\Controllers'],
function () {
Route::get('modules', ['as' => 'dashboard.modules.index', 'uses' => 'WorkshopController@index']);
}
);
\ No newline at end of file
<?php namespace Modules\Workshop\Providers;
use Illuminate\Support\ServiceProvider;
class WorkshopServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array();
}
}
@extends('core::layouts.master')
@section('content-header')
<h1>
Module management
</h1>
<ol class="breadcrumb">
<li><a href="{{ URL::route('dashboard.index') }}"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Modules</li>
</ol>
@stop
@section('styles')
<link href="{{{ core_asset('css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
{!! Form::open(['route' => 'dashboard.user.store', 'method' => 'post']) !!}
<div class="row">
<div class="col-md-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_1-1" data-toggle="tab">Module list</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_1-1">
<ul>
@foreach($modules as $module)
<li>
<div class="checkbox">
<label for="{{ $module }}">
<input id="{{ $module }}" name="modules[]" type="checkbox" class="flat-blue" <?php echo Module::active($module) ? 'checked' : '' ?> value="true" /> {{ $module }}
</label>
</div>
</li>
@endforeach
</ul>
</div>
</div>
</div>
</div>
</div>
{!! Form::close() !!}
@stop
@section('scripts')
<script>
$( document ).ready(function() {
$('input[type="checkbox"].flat-blue, input[type="radio"].flat-blue').iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat-blue'
});
});
</script>
@stop
\ No newline at end of file
<?php
View::composer('core::partials.sidebar-nav', 'Modules\Workshop\Composers\SidebarViewComposer');
{
"name": "Workshop",
"alias": "workshop",
"description": "",
"keywords": [
],
"active": 1
}
\ No newline at end of file
<?php
/*
|--------------------------------------------------------------------------
| Register The Module Namespaces
|--------------------------------------------------------------------------
|
| Here is you can register the namespace for this module.
| You may to edit this namespace if you want.
|
*/
View::addNamespace('workshop', __DIR__ . '/Resources/views/');
Lang::addNamespace('workshop', __DIR__ . '/Resources/lang/');
Config::addNamespace('workshop', __DIR__ . '/Config/');
/*
|--------------------------------------------------------------------------
| Require The Routes file.
|--------------------------------------------------------------------------
|
| Next, this module will load filters and routes file.
|
*/
require __DIR__ . '/Http/routes.php';
require __DIR__ . '/composers.php';
\ No newline at end of file
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