diff --git a/modules/StaticPages/Config/config.php b/modules/StaticPages/Config/config.php index d3434db4..67df171e 100644 --- a/modules/StaticPages/Config/config.php +++ b/modules/StaticPages/Config/config.php @@ -1,6 +1,11 @@ 'StaticPages', - 'handler' => '\\Modules\\StaticPages\\Handlers\\StaticPage' + 'name' => 'StaticPages', + 'description' => '', + 'handler' => '\\Modules\\StaticPages\\Handlers\\StaticPage', + 'providers' => [\Modules\Staticpages\Providers\StaticPagesServiceProvider::class], + 'keywords' => [], + 'files' => ['start.php'], + 'order' => 0, ]; \ No newline at end of file diff --git a/modules/StaticPages/Handlers/StaticPage.php b/modules/StaticPages/Handlers/StaticPage.php index 6bf9e3ae..d1657f28 100644 --- a/modules/StaticPages/Handlers/StaticPage.php +++ b/modules/StaticPages/Handlers/StaticPage.php @@ -24,8 +24,9 @@ class StaticPage extends Handler public static function getModuleId() { + $handler = config('staticpages.handler'); $allModules = ModulesHandlerToId::getWithTranslations(); - $moduleId = $allModules[config('staticpages.handler')]; + $moduleId = isset($allModules[$handler]) ? $allModules[$handler] : null; return $moduleId; } diff --git a/modules/StaticPages/Providers/StaticPagesServiceProvider.php b/modules/StaticPages/Providers/StaticPagesServiceProvider.php index 609c1100..9255500b 100644 --- a/modules/StaticPages/Providers/StaticPagesServiceProvider.php +++ b/modules/StaticPages/Providers/StaticPagesServiceProvider.php @@ -1,6 +1,5 @@ install(); $this->registerTranslations(); $this->registerConfig(); $this->registerViews(); + + $this->install(); } /** @@ -55,36 +55,37 @@ class StaticPagesServiceProvider extends ServiceProvider Module::create([ 'handler' => $handler, 'name' => 'staticpages::module.name', - 'description' => 'staticpages::module.description' + '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' - ]); +// 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' +// ]); } } diff --git a/modules/StaticPages/module.json b/modules/StaticPages/module.json deleted file mode 100644 index aa759b08..00000000 --- a/modules/StaticPages/module.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "StaticPages", - "alias": "staticpages", - "description": "", - "keywords": [], - "active": 1, - "order": 0, - "providers": [ - "Modules\\StaticPages\\Providers\\StaticPagesServiceProvider" - ], - "aliases":{}, - "files": [ - "start.php" - ] -} \ No newline at end of file