Merge branch 'static_pages' into dev
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
|
||||
return [
|
||||
'name' => 'StaticPages',
|
||||
'description' => '',
|
||||
'translatedName' => 'staticpages::module.name',
|
||||
'translatedDescription' => 'staticpages::module.description',
|
||||
'alias' => 'staticpages',
|
||||
'handler' => '\\Modules\\StaticPages\\Handlers\\StaticPage',
|
||||
'providers' => [\Modules\Staticpages\Providers\StaticPagesServiceProvider::class],
|
||||
'keywords' => [],
|
||||
'files' => ['start.php'],
|
||||
'order' => 0,
|
||||
];
|
||||
@@ -86,4 +86,14 @@ class StaticPage extends Handler
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install module
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function install()
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
@@ -27,8 +27,6 @@ class StaticPagesServiceProvider extends ServiceProvider
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
|
||||
$this->install();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,52 +40,17 @@ class StaticPagesServiceProvider extends ServiceProvider
|
||||
$this->app->register('Modules\StaticPages\Providers\EventServiceProvider');
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for installing module into database
|
||||
*/
|
||||
protected function install()
|
||||
{
|
||||
$handler = config('staticpages.handler');
|
||||
$installedModules = ModulesHandlerToId::getWithTranslations();
|
||||
if (!isset($installedModules[$handler])) {
|
||||
|
||||
// insert module into database
|
||||
Module::create([
|
||||
'handler' => $handler,
|
||||
'name' => 'staticpages::module.name',
|
||||
'description' => 'staticpages::module.description',
|
||||
'alias' => 'staticpages'
|
||||
]);
|
||||
|
||||
// insert action log types into database
|
||||
// ActionLogType::create([
|
||||
// 'string_id' => 'staticpages::createNew',
|
||||
// 'name' => 'staticpages::log.nameCreateNew',
|
||||
// 'value' => 'staticpages::log.nameCreateNew'
|
||||
// ]);
|
||||
// ActionLogType::create([
|
||||
// 'string_id' => 'staticpages::edit',
|
||||
// 'name' => 'staticpages::log.nameEdit',
|
||||
// 'value' => 'staticpages::log.edit'
|
||||
// ]);
|
||||
// ActionLogType::create([
|
||||
// 'string_id' => 'staticpages::delete',
|
||||
// 'name' => 'staticpages::log.nameDelete',
|
||||
// 'value' => 'staticpages::log.delete'
|
||||
// ]);
|
||||
// ActionLogType::create([
|
||||
// 'string_id' => 'staticpages::makeDraft',
|
||||
// 'name' => 'staticpages::log.nameMakeDraft',
|
||||
// 'value' => 'staticpages::log.makeDraft'
|
||||
// ]);
|
||||
//
|
||||
// ActionLogType::create([
|
||||
// 'string_id' => 'staticpages::publish',
|
||||
// 'name' => 'staticpages::log.namePublish',
|
||||
// 'value' => 'staticpages::log.publish'
|
||||
// ]);
|
||||
}
|
||||
}
|
||||
// /**
|
||||
// * Method for installing module into database
|
||||
// */
|
||||
// protected function install()
|
||||
// {
|
||||
// $handler = config('staticpages.handler');
|
||||
// $installedModules = ModulesHandlerToId::getWithTranslations();
|
||||
// if (!isset($installedModules[$handler])) {
|
||||
// Module::install('staticpages::module.name', 'staticpages', 'staticpages::module.description');
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
|
||||
Reference in New Issue
Block a user