Merge branch 'dev' into binarity.cz

This commit is contained in:
Michal Kváček
2016-10-04 11:16:59 +02:00
3 changed files with 81 additions and 80 deletions
+2 -1
View File
@@ -11,7 +11,8 @@ class Comment extends Model
'content_id',
'content',
'email',
'name'
'name',
'approved'
];
public function author()
@@ -40,7 +40,8 @@ class CreateNewComment extends Controller
'content_id' => $article->id,
'name' => $name,
'email' => $email,
'content' => $content
'content' => $content,
'approved' => !is_null($user)
]);
// fire event about new comment
@@ -1,92 +1,91 @@
<?php namespace Modules\Blog\ArticleList\Providers;
use App\Handlers\Registrators\TemplateRegistrator;
use Illuminate\Support\ServiceProvider;
use InvalidArgumentException;
use Modules\Blog\ArticleList\Handlers\ArticleList;
class ArticleListServiceProvider extends ServiceProvider {
class ArticleListServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
}
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([__DIR__ . '/../Config/config.php' => config_path('articlelist.php')]);
$this->mergeConfigFrom(__DIR__ . '/../Config/config.php', 'articlelist');
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([__DIR__.'/../Config/config.php' => config_path('articlelist.php')]);
$this->mergeConfigFrom(__DIR__.'/../Config/config.php', 'articlelist');
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = base_path('resources/views/modules/articlelist');
$sourcePath = __DIR__ . '/../Resources/views';
if (!is_dir($sourcePath)) {
return;
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = base_path('resources/views/modules/articlelist');
$sourcePath = __DIR__.'/../Resources/views';
$this->publishes([$sourcePath => $viewPath]);
$this->publishes([$sourcePath => $viewPath]);
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/articlelist';
}, \Config::get('view.paths')), [$sourcePath]), 'articlelist');
}
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/articlelist';
}, \Config::get('view.paths')), [$sourcePath]), 'articlelist');
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = base_path('resources/lang/modules/articlelist');
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = base_path('resources/lang/modules/articlelist');
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, 'articlelist');
} else {
$this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'articlelist');
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array();
}
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, 'articlelist');
} else {
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'articlelist');
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array ();
}
}