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 ...@@ -40,6 +40,7 @@ class ModulesController extends AdminBaseController
unset($modules[$module]); unset($modules[$module]);
} }
} }
$this->moduleManager->disableModules($enabledModules); $this->moduleManager->disableModules($enabledModules);
$this->moduleManager->enableModules($modules); $this->moduleManager->enableModules($modules);
......
<?php namespace Modules\Workshop\Manager; <?php namespace Modules\Workshop\Manager;
use Illuminate\Config\Repository as Config; use Illuminate\Config\Repository as Config;
use Pingpong\Modules\Module;
class ModuleManager class ModuleManager
{ {
...@@ -15,12 +14,11 @@ class ModuleManager ...@@ -15,12 +14,11 @@ class ModuleManager
private $config; private $config;
/** /**
* @param Module $module
* @param Config $config * @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; $this->config = $config;
} }
...@@ -61,9 +59,12 @@ class ModuleManager ...@@ -61,9 +59,12 @@ class ModuleManager
public function getFlippedEnabledModules() public function getFlippedEnabledModules()
{ {
$enabledModules = $this->module->enabled(); $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 @@ ...@@ -11,7 +11,7 @@
@stop @stop
@section('styles') @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 @stop
@section('content') @section('content')
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<li> <li>
<div class="checkbox"> <div class="checkbox">
<label for="{{ $module }}"> <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> </label>
</div> </div>
</li> </li>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
@stop @stop
@section('styles') @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 @stop
@section('content') @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