mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
revert
This commit is contained in:
parent
930eede804
commit
cf6029e453
@ -16,7 +16,6 @@ return [
|
|||||||
'free_currencyconverterapi_key',
|
'free_currencyconverterapi_key',
|
||||||
'hide_price_categories',
|
'hide_price_categories',
|
||||||
'tcmb_exchange_url',
|
'tcmb_exchange_url',
|
||||||
'enabled_modules',
|
|
||||||
'enabled_currencies',
|
'enabled_currencies',
|
||||||
'disable_sentry',
|
'disable_sentry',
|
||||||
'hide_ad_cat',
|
'hide_ad_cat',
|
||||||
|
|||||||
@ -194,22 +194,6 @@ return [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'enabled_modules' => [
|
|
||||||
'type' => 'anomaly.field_type.checkboxes',
|
|
||||||
'config' => [
|
|
||||||
'mode' => 'tags',
|
|
||||||
'default_value' => function () {
|
|
||||||
$addons = app('module.collection')->enabled()->pluck('namespace')->all();
|
|
||||||
|
|
||||||
return $addons;
|
|
||||||
},
|
|
||||||
'options' => function () {
|
|
||||||
$addons = app('module.collection')->pluck('namespace', 'namespace');
|
|
||||||
|
|
||||||
return $addons;
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'market_place' => [
|
'market_place' => [
|
||||||
'type' => 'anomaly.field_type.boolean',
|
'type' => 'anomaly.field_type.boolean',
|
||||||
'config' => [
|
'config' => [
|
||||||
|
|||||||
@ -125,10 +125,6 @@ return [
|
|||||||
'enabled_currencies' => [
|
'enabled_currencies' => [
|
||||||
'name' => 'Enabled Currencies',
|
'name' => 'Enabled Currencies',
|
||||||
],
|
],
|
||||||
'enabled_modules' => [
|
|
||||||
'name' => 'Enabled Modules',
|
|
||||||
'warning' => 'Change at your own risk.',
|
|
||||||
],
|
|
||||||
'google_statistic_code' => [
|
'google_statistic_code' => [
|
||||||
'name' => 'Google Statistic Code',
|
'name' => 'Google Statistic Code',
|
||||||
],
|
],
|
||||||
|
|||||||
@ -2,13 +2,11 @@
|
|||||||
|
|
||||||
use Anomaly\Streams\Platform\Addon\AddonServiceProvider;
|
use Anomaly\Streams\Platform\Addon\AddonServiceProvider;
|
||||||
use Anomaly\Streams\Platform\Ui\ControlPanel\Component\Navigation\Event\SortNavigation;
|
use Anomaly\Streams\Platform\Ui\ControlPanel\Component\Navigation\Event\SortNavigation;
|
||||||
use Anomaly\Streams\Platform\Ui\Form\Event\FormWasSaved;
|
|
||||||
use Anomaly\Streams\Platform\Ui\Table\Event\TableIsQuerying;
|
use Anomaly\Streams\Platform\Ui\Table\Event\TableIsQuerying;
|
||||||
use Illuminate\Pagination\AbstractPaginator;
|
use Illuminate\Pagination\AbstractPaginator;
|
||||||
use Visiosoft\DefaultadminTheme\Listener\AddGsmFilter;
|
use Visiosoft\DefaultadminTheme\Listener\AddGsmFilter;
|
||||||
use Visiosoft\DefaultadminTheme\Listener\AddViewAdsButton;
|
use Visiosoft\DefaultadminTheme\Listener\AddViewAdsButton;
|
||||||
use Visiosoft\DefaultadminTheme\Listener\ApplySorting;
|
use Visiosoft\DefaultadminTheme\Listener\ApplySorting;
|
||||||
use Visiosoft\DefaultadminTheme\Listener\CheckEnabledModules;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class DefaultadminThemeServiceProvider
|
* Class DefaultadminThemeServiceProvider
|
||||||
@ -27,9 +25,6 @@ class DefaultadminThemeServiceProvider extends AddonServiceProvider
|
|||||||
AddGsmFilter::class,
|
AddGsmFilter::class,
|
||||||
AddViewAdsButton::class,
|
AddViewAdsButton::class,
|
||||||
],
|
],
|
||||||
FormWasSaved::class => [
|
|
||||||
CheckEnabledModules::class,
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $overrides = [
|
protected $overrides = [
|
||||||
|
|||||||
@ -1,41 +0,0 @@
|
|||||||
<?php namespace Visiosoft\DefaultadminTheme\Listener;
|
|
||||||
|
|
||||||
use Anomaly\SettingsModule\Setting\Form\SettingFormBuilder;
|
|
||||||
use Anomaly\Streams\Platform\Addon\Module\Command\InstallModule;
|
|
||||||
use Anomaly\Streams\Platform\Addon\Module\Command\UninstallModule;
|
|
||||||
use Anomaly\Streams\Platform\Addon\Module\Contract\ModuleRepositoryInterface;
|
|
||||||
use Anomaly\Streams\Platform\Ui\Form\Event\FormWasSaved;
|
|
||||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
|
||||||
|
|
||||||
class CheckEnabledModules
|
|
||||||
{
|
|
||||||
use DispatchesJobs;
|
|
||||||
|
|
||||||
private $moduleRepository;
|
|
||||||
|
|
||||||
public function __construct(ModuleRepositoryInterface $moduleRepository)
|
|
||||||
{
|
|
||||||
$this->moduleRepository = $moduleRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function handle(FormWasSaved $event)
|
|
||||||
{
|
|
||||||
$builder = $event->getBuilder();
|
|
||||||
|
|
||||||
if (get_class($builder) == SettingFormBuilder::class) {
|
|
||||||
$value = $builder->getFormFields()->where('field', 'enabled_modules')->first()->getValue();
|
|
||||||
$disabledModules = app('module.collection')->whereNotIn('namespace', $value);
|
|
||||||
$enabledModules = app('module.collection')->whereIn('namespace', $value);
|
|
||||||
foreach ($disabledModules as $module) {
|
|
||||||
if ($module->isInstalled()) {
|
|
||||||
$this->dispatchNow(new UninstallModule($module, true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach ($enabledModules as $module) {
|
|
||||||
if (!$module->isInstalled()) {
|
|
||||||
$this->dispatchNow(new InstallModule($module, true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user