FEATURE: merge template namespace and module alias
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace Modules\Blog\ArticleList\Handlers;
|
||||
|
||||
use App\CMS\Contracts\Repositories\Content as IContent;
|
||||
use App\CMS\Handlers\Handler;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Content\Content;
|
||||
@@ -109,11 +110,10 @@ class ArticleList extends Handler
|
||||
->orderBy('created_at', 'DESC');
|
||||
|
||||
// show articles for not-logged users of even for logged onew?
|
||||
if (!Auth::user()) {
|
||||
$articles = $articles->where('status', Content::STATUS_PUBLIC);
|
||||
} else {
|
||||
$articles = $articles->whereIn('status', [Content::STATUS_PUBLIC, Content::STATUS_PROTECTED]);
|
||||
}
|
||||
$articles = !Auth::user() ? $articles->where('status', IContent::STATUS_PUBLIC) : $articles->whereIn('status', [
|
||||
IContent::STATUS_PUBLIC,
|
||||
IContent::STATUS_PROTECTED
|
||||
]);
|
||||
|
||||
// selected articles from archive?
|
||||
self::archive($articles);
|
||||
@@ -129,12 +129,7 @@ class ArticleList extends Handler
|
||||
$articles = $articles->where('user_id', $user->id);
|
||||
}
|
||||
|
||||
$articles = $articles->paginate(20);
|
||||
|
||||
// decode module settings
|
||||
foreach ($articles as $article) {
|
||||
$article->moduleSettings = json_decode($article->moduleSettings);
|
||||
}
|
||||
$articles = $articles->paginate(setting('articlesPerPage', 20));
|
||||
|
||||
return Controller::VisitorsView($content->template, [
|
||||
'page' => $content,
|
||||
|
||||
Reference in New Issue
Block a user