Merge branch 'template_support' into dev

This commit is contained in:
Michal Kváček
2016-09-20 20:17:06 +02:00
148 changed files with 890 additions and 5299 deletions
@@ -62,22 +62,6 @@ class ArticleServiceProvider extends ServiceProvider {
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/article';
}, \Config::get('view.paths')), [$sourcePath]), 'article');
/**
* @var $registrator TemplateRegistrator
*/
try {
// setup some global variables
$registrator = $this->app->make('registerTemplateDir');
$registrator->setBaseDirectory('resources/views/modules/article/visitor');
$registrator->setNamespace('article');
$registrator->setModuleId(Article::getModuleId());
// register path with current template name
$registrator->register(config('app.theme'), 'article::admin/adminMenu.templatePath');
} catch (InvalidArgumentException $e) {
// ignore this exception
}
}
/**
@@ -62,22 +62,6 @@ class ContactFormServiceProvider extends ServiceProvider
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/contactform';
}, \Config::get('view.paths')), [$sourcePath]), 'contactform');
/**
* @var $registrator TemplateRegistrator
*/
$registrator = $this->app->make('registerTemplateDir');
try {
// setup some global variables
$registrator->setBaseDirectory('resources/views/modules/contactform/visitor');
$registrator->setNamespace('contactform');
$registrator->setModuleId(call_user_func([config('contactform.handler'), 'getModuleId']));
// register path with current template name
$registrator->register(config('app.theme'), 'contactform::admin/adminMenu.templatePath');
} catch (InvalidArgumentException $e) {
// ignore this exception
}
}
/**
@@ -62,22 +62,6 @@ class GalleryServiceProvider extends ServiceProvider
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path.'/modules/gallery';
}, \Config::get('view.paths')), [$sourcePath]), 'gallery');
/**
* @var $registrator TemplateRegistrator
*/
$registrator = $this->app->make('registerTemplateDir');
try {
// setup some global variables
$registrator->setBaseDirectory('resources/views/modules/gallery/visitor');
$registrator->setNamespace('gallery');
$registrator->setModuleId(call_user_func([config('gallery.handler'), 'getModuleId']));
// register path with current template name
$registrator->register(config('app.theme'), 'gallery::admin/adminMenu.templatePath');
} catch (InvalidArgumentException $e) {
// ignore this exception
}
}
/**
@@ -38,18 +38,6 @@ class StaticPagesServiceProvider extends ServiceProvider
{
}
// /**
// * 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.
*
@@ -69,30 +57,14 @@ class StaticPagesServiceProvider extends ServiceProvider
*/
public function registerViews()
{
$viewPath = base_path('resources/views/modules/staticpages');
$sourcePath = __DIR__ . '/../Resources/views';
$viewPath = base_path('resources/views/modules/staticpages');
$this->publishes([$sourcePath => $viewPath], 'module-views');
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/staticpages';
}, \Config::get('view.paths')), [$sourcePath]), 'staticpages');
/**
* @var $registrator TemplateRegistrator
*/
$registrator = $this->app->make('registerTemplateDir');
try {
// setup some global variables
$registrator->setBaseDirectory('resources/views/modules/staticpages/visitor');
$registrator->setNamespace('staticpages');
$registrator->setModuleId(call_user_func([config('staticpages.handler'), 'getModuleId']));
// register path with current template name
$registrator->register(config('app.theme'), 'staticpages::admin.templatePath');
} catch (InvalidArgumentException $e) {
// ignore this exception
}
}
/**