Commit f941fd93 authored by Nicolas Widart's avatar Nicolas Widart

Merge commit '6a241a81'

* commit '6a241a81':
  Squashed 'Modules/Workshop/' changes from cbf71cf..adc4bf6
parents dfcedff2 6a241a81
......@@ -40,6 +40,7 @@ class ModulesController extends AdminBaseController
unset($modules[$module]);
}
}
$this->moduleManager->disableModules($enabledModules);
$this->moduleManager->enableModules($modules);
......
<?php namespace Modules\Workshop\Manager;
use Illuminate\Config\Repository as Config;
use Pingpong\Modules\Module;
class ModuleManager
{
......@@ -15,12 +14,11 @@ class ModuleManager
private $config;
/**
* @param Module $module
* @param Config $config
*/
public function __construct(Module $module, Config $config)
public function __construct(Config $config)
{
$this->module = $module;
$this->module = app('modules');
$this->config = $config;
}
......@@ -61,9 +59,12 @@ class ModuleManager
public function getFlippedEnabledModules()
{
$enabledModules = $this->module->enabled();
$enabledModules = array_flip($enabledModules);
return $enabledModules;
$enabledModules = array_map(function($module) {
return $module->getName();
}, $enabledModules);
return array_flip($enabledModules);
}
/**
......
......@@ -11,7 +11,7 @@
@stop
@section('styles')
<link href="{{{ Module::asset('core', 'css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
<link href="{{{ Module::asset('core:css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
......@@ -29,7 +29,7 @@
<li>
<div class="checkbox">
<label for="{{ $module }}">
<input id="{{ $module }}" name="modules[{{ $module }}]" type="checkbox" class="flat-blue" <?php echo Module::active($module) ? 'checked' : '' ?> <?php echo isset($coreModules[$module]) ? 'disabled' : ''; ?> value="true" /> {{ $module }}
<input id="{{ $module }}" name="modules[{{ $module }}]" type="checkbox" class="flat-blue" <?php echo Module::active($module) ? 'checked' : '' ?> <?php echo isset($coreModules[$module->getName()]) ? 'disabled' : ''; ?> value="true" /> {{ $module }}
</label>
</div>
</li>
......
......@@ -11,7 +11,7 @@
@stop
@section('styles')
<link href="{{{ Module::asset('core', 'css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
<link href="{{{ Module::asset('core:css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
......
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