FEATURE: directory separator for static pages provider

This commit is contained in:
peter
2016-04-04 11:01:49 +02:00
parent 08cb40b004
commit 1f3cc2eebb
6 changed files with 14 additions and 31 deletions
@@ -57,7 +57,7 @@ class StaticPagesServiceProvider extends ServiceProvider
*/
protected function registerConfig()
{
$config = __DIR__ . '/../Config/config.php';
$config = __DIR__ . '\..\Config\config.php';
$this->publishes([$config => config_path('staticpages.php')]);
$this->mergeConfigFrom($config, 'staticpages');
}
@@ -69,8 +69,10 @@ class StaticPagesServiceProvider extends ServiceProvider
*/
public function registerViews()
{
$viewPath = base_path('resources/views/modules/staticpages');
$sourcePath = __DIR__ . '/../Resources/views';
$viewPath = base_path('resources'.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.'gallery');
$sourcePath = __DIR__ . DIRECTORY_SEPARATOR .'..'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'views';
echo $viewPath;
$this->publishes([$sourcePath => $viewPath]);
@@ -84,7 +86,7 @@ class StaticPagesServiceProvider extends ServiceProvider
$registrator = $this->app->make('registerTemplateDir');
try {
// setup some global variables
$registrator->setBaseDirectory('resources/views/modules/staticpages/visitor');
$registrator->setBaseDirectory('resources'.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.'staticpages'.DIRECTORY_SEPARATOR.'visitor');
$registrator->setNamespace('staticpages');
$registrator->setModuleId(call_user_func([config('staticpages.handler'), 'getModuleId']));
@@ -102,6 +104,6 @@ class StaticPagesServiceProvider extends ServiceProvider
*/
public function registerTranslations()
{
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'staticpages');
$this->loadTranslationsFrom(__DIR__ . DIRECTORY_SEPARATOR. '..'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'lang', 'staticpages');
}
}