Merge branch 'static_pages' into dev

This commit is contained in:
Michal Kváček
2016-03-14 10:14:50 +01:00
4 changed files with 39 additions and 47 deletions
+7 -2
View File
@@ -1,6 +1,11 @@
<?php
return [
'name' => '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,
];
+2 -1
View File
@@ -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;
}
@@ -1,6 +1,5 @@
<?php namespace Modules\Staticpages\Providers;
use App\Enumerations\Modules;
use App\Enumerations\ModulesHandlerToId;
use App\Enumerations\ModulesWithIds;
use App\Handlers\Registrators\TemplateRegistrator;
@@ -25,10 +24,11 @@ class StaticPagesServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->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'
// ]);
}
}
-15
View File
@@ -1,15 +0,0 @@
{
"name": "StaticPages",
"alias": "staticpages",
"description": "",
"keywords": [],
"active": 1,
"order": 0,
"providers": [
"Modules\\StaticPages\\Providers\\StaticPagesServiceProvider"
],
"aliases":{},
"files": [
"start.php"
]
}