diff --git a/modules/Blog/Article/Config/config.php b/modules/Blog/Article/Config/config.php deleted file mode 100644 index fb19fdc4..00000000 --- a/modules/Blog/Article/Config/config.php +++ /dev/null @@ -1,12 +0,0 @@ - 'Articles', - 'translatedName' => 'article::module.name', - 'translatedDescription' => 'article::module.description', - 'alias' => 'article', - 'handler' => \Modules\Blog\Article\Handlers\Article::class, - 'providers' => [\Modules\Blog\Article\Providers\ArticleServiceProvider::class], - 'files' => ['start.php'], - 'order' => 0, -]; \ No newline at end of file diff --git a/modules/Blog/Article/Entities/Article.php b/modules/Blog/Article/Entities/Article.php deleted file mode 100644 index 1222a7bb..00000000 --- a/modules/Blog/Article/Entities/Article.php +++ /dev/null @@ -1,15 +0,0 @@ -hasMany(Comment::class, 'content_id') - ->where('approved', true); - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Entities/Comment.php b/modules/Blog/Article/Entities/Comment.php deleted file mode 100644 index 25a5e4f8..00000000 --- a/modules/Blog/Article/Entities/Comment.php +++ /dev/null @@ -1,27 +0,0 @@ -belongsTo(User::class, 'user_id'); - } - - public function article() - { - return $this->belongsTo(Content::class, 'content_id'); - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Events/ApprovedComment.php b/modules/Blog/Article/Events/ApprovedComment.php deleted file mode 100644 index 3fab72bc..00000000 --- a/modules/Blog/Article/Events/ApprovedComment.php +++ /dev/null @@ -1,20 +0,0 @@ -comment = $comment; - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Events/CreatedComment.php b/modules/Blog/Article/Events/CreatedComment.php deleted file mode 100644 index d21f685b..00000000 --- a/modules/Blog/Article/Events/CreatedComment.php +++ /dev/null @@ -1,20 +0,0 @@ -comment = $comment; - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Events/DeletedComment.php b/modules/Blog/Article/Events/DeletedComment.php deleted file mode 100644 index 048341ab..00000000 --- a/modules/Blog/Article/Events/DeletedComment.php +++ /dev/null @@ -1,20 +0,0 @@ -comment = $comment; - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Handlers/Article.php b/modules/Blog/Article/Handlers/Article.php deleted file mode 100644 index f09ee57d..00000000 --- a/modules/Blog/Article/Handlers/Article.php +++ /dev/null @@ -1,153 +0,0 @@ -whereTitle(trans('article::module.blog')); - if (!$blogSubmenu) { - $blogSubmenu = $menu->dropdown(trans('article::module.blog'), function ($sub) { - }, 20, ['icon' => 'fa fa-fw fa-book']); - } - - $blogSubmenu->dropdown(trans('article::module.name'), function ($sub) { - $sub->route('content.new', trans('article::article.new'), ['id' => config('article.alias')], 10, ['icon' => 'fa fa-fw fa-pencil']); - $sub->route('content.overview', trans('article::article.overview'), ['id' => config('article.alias')], 30, ['icon' => 'fa fa-fw fa-book']); - }, 10, ['icon' => 'fa fa-fw fa-book']); - - $blogSubmenu->route('comments.overview', trans('article::module.commentsOverview'), [], 20, ['icon' => 'fa fa-fw fa-commenting-o']); - } - - /** - * Install module - */ - public static function install() - { - $types = [ - [ - 'string_id' => 'commentCreated', - 'name' => 'article::comments.events.names.commentCreated', - 'value' => 'article::comments.events.descriptions.commentCreated', - ], - [ - 'string_id' => 'commentDeleted', - 'name' => 'article::comments.events.names.commentDeleted', - 'value' => 'article::comments.events.descriptions.commentDeleted', - ], - [ - 'string_id' => 'commentApproved', - 'name' => 'article::comments.events.names.commentApproved', - 'value' => 'article::comments.events.descriptions.commentApproved', - ], - - ]; - foreach ($types as $type) { - ActionLogType::create($type); - } - } - - /** - * Uninstalls module - * - * @param Module $module - * - * @return mixed|void - */ - public static function uninstall(Module $module) - { - ActionLogType::whereIn('string_id', ['commentCreated', 'commentDeleted', 'commentApproved']) - ->delete(); - } - - /** - * Get translated title for pages overview of given type. - * - * This value is used for rendering list of all content pages of given type in administration. - * - * @return string - */ - public static function getOverviewTitle() - { - return trans('article::module.allArticles'); - } - - /** - * Title displayed above for for creating new content page - * - * @return string - */ - public static function getCreateNewTitle() - { - return trans('article::module.newArticle'); - } - - /** - * Title for form displayed for editin content page - * - * @param Content $content - * - * @return mixed - */ - public static function getEditTitle(Content $content) - { - return trans('article::module.editArticle'); - } - - /** - * Method called right after content page is marked as deleted - * - * This method is supposed to clean after "deleted" page. - * - * @param Content $content - * - * @return mixed - */ - public static function delete(Content $content) - { - } - - /** - * Does this module support categories? - * - * @return boolean - */ - public static function supportCategories() - { - return true; - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Http/Controllers/Admin/CommentsOverview.php b/modules/Blog/Article/Http/Controllers/Admin/CommentsOverview.php deleted file mode 100644 index 239bc6d6..00000000 --- a/modules/Blog/Article/Http/Controllers/Admin/CommentsOverview.php +++ /dev/null @@ -1,19 +0,0 @@ -with('author') - ->orderBy('approved') - ->orderBy('created_at', 'DESC') - ->paginate(25); - - return view('article::admin/comments.overview', ['comments' => $comments]); - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Http/Controllers/Admin/EditComment.php b/modules/Blog/Article/Http/Controllers/Admin/EditComment.php deleted file mode 100644 index bf6f6994..00000000 --- a/modules/Blog/Article/Http/Controllers/Admin/EditComment.php +++ /dev/null @@ -1,37 +0,0 @@ -approved = 1; - $comment->save(); - - Event::fire(new ApprovedComment($comment)); - - return redirect() - ->back() - ->with('success', trans('article::comments.approved')); - } - - public function delete($id) - { - $comment = Comment::findOrFail($id); - - Event::fire(new DeletedComment($comment)); - - $comment->delete(); - - return redirect() - ->back() - ->with('success', trans('article::comments.deleted')); - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Http/Controllers/Visitor/CreateNewComment.php b/modules/Blog/Article/Http/Controllers/Visitor/CreateNewComment.php deleted file mode 100644 index 88ac5c9e..00000000 --- a/modules/Blog/Article/Http/Controllers/Visitor/CreateNewComment.php +++ /dev/null @@ -1,49 +0,0 @@ -moduleSettings['allowComments']) || !$article->moduleSettings['allowComments']) { - return redirect() - ->route('page.content', ['url' => $article->url]) - ->with('error', trans('article::comments.disabledComments')); - } - - $content = $request->message; - $user = Auth::user(); - if ($user) { - $name = is_null($user->name) ? $user->email : $user->name; - $email = $user->email; - } else { - $name = $request->name; - $email = $request->email; - } - - $comment = Comment::create([ - 'user_id' => $user ? $user->id : null, - 'content_id' => $article->id, - 'name' => $name, - 'email' => $email, - 'content' => $content, - 'approved' => !is_null($user) - ]); - - // fire event about new comment - Event::fire(new CreatedComment($comment)); - - return redirect() - ->route('page.content', ['url' => $article->url]) - ->with('success', trans('article::comments.saved')); - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Http/Requests/CreateNewComment.php b/modules/Blog/Article/Http/Requests/CreateNewComment.php deleted file mode 100644 index 18044f43..00000000 --- a/modules/Blog/Article/Http/Requests/CreateNewComment.php +++ /dev/null @@ -1,28 +0,0 @@ - 'required']; - - if (!$user) { - $required['name'] = 'required'; - $required['email'] = 'required|email'; - } - - return $required; - } -} diff --git a/modules/Blog/Article/Http/routes.php b/modules/Blog/Article/Http/routes.php deleted file mode 100644 index 145c30ba..00000000 --- a/modules/Blog/Article/Http/routes.php +++ /dev/null @@ -1,28 +0,0 @@ - LaravelLocalization::setLocale(), - 'namespace' => 'Modules\Blog\Article\Http\Controllers' - ], function () { - Route::group([ - 'middleware' => ['admin'], - 'prefix' => 'admin/comments', - 'namespace' => 'Admin' - ], function () { - - Route::get('/', 'CommentsOverview@getOverview') - ->name('comments.overview'); - - Route::get('/delete/{id}', 'EditComment@delete') - ->name('comments.delete'); - - Route::get('/approve/{id}', 'EditComment@approve') - ->name('comments.approve'); - }); - - // public routes - Route::group(['middleware' => ['web'], 'namespace' => 'Visitor'], function () { - - Route::post('comments/new/{article}', 'CreateNewComment@store') - ->name('comments.new'); - }); -}); \ No newline at end of file diff --git a/modules/Blog/Article/Listeners/LogCommentApproval.php b/modules/Blog/Article/Listeners/LogCommentApproval.php deleted file mode 100644 index 2ff4f14b..00000000 --- a/modules/Blog/Article/Listeners/LogCommentApproval.php +++ /dev/null @@ -1,35 +0,0 @@ - $event->comment->name, - 'email' => $event->comment->email, - 'content' => $event->comment->content - ]; - - $this->saveLog($parameters); - } - - /** - * Getter for action name. Used only internally - * - * @return mixed - */ - protected function getName() - { - return 'commentApproved'; - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Listeners/LogDeletedComment.php b/modules/Blog/Article/Listeners/LogDeletedComment.php deleted file mode 100644 index 0a016e0c..00000000 --- a/modules/Blog/Article/Listeners/LogDeletedComment.php +++ /dev/null @@ -1,35 +0,0 @@ - $event->comment->name, - 'email' => $event->comment->email, - 'content' => $event->comment->content - ]; - - $this->saveLog($parameters); - } - - /** - * Getter for action name. Used only internally - * - * @return mixed - */ - protected function getName() - { - return 'commentDeleted'; - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Listeners/LogNewComment.php b/modules/Blog/Article/Listeners/LogNewComment.php deleted file mode 100644 index d2e6e313..00000000 --- a/modules/Blog/Article/Listeners/LogNewComment.php +++ /dev/null @@ -1,40 +0,0 @@ -comment->user_id) { - return; - } - - $parameters = [ - 'author' => $event->comment->name, - 'email' => $event->comment->email, - 'content' => $event->comment->content - ]; - - $this->saveLog($parameters); - } - - /** - * Getter for action name. Used only internally - * - * @return mixed - */ - protected function getName() - { - return 'commentCreated'; - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Modificators/PerexCreator.php b/modules/Blog/Article/Modificators/PerexCreator.php deleted file mode 100644 index ad76b0be..00000000 --- a/modules/Blog/Article/Modificators/PerexCreator.php +++ /dev/null @@ -1,60 +0,0 @@ -DOMDocument = new \DOMDocument('1.0', 'UTF-8'); - $this->maxLength = 300; - $this->maxImages = 2; - $this->perex = ''; - } - - private function addHtml($node) - { - $this->perex .= strip_tags($this->DOMDocument->saveHTML($node), '

'); - } - - public function create($html) - { - if (empty($html)) { - return null; - } - - $html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'); - $this->DOMDocument->loadHTML($html); - - $texts = $this->DOMDocument->getElementsByTagName('p'); - $images = $this->DOMDocument->getElementsByTagName('img'); - $iframes = $this->DOMDocument->getElementsByTagName('iframe'); - - $textId = 0; - $imgId = 0; - if ($texts->length > 1) { - $this->addHtml($texts[$textId++]); - } - - if (mb_strlen($this->perex) < $this->maxLength) { - if ($iframes->length > 0) { - $this->perex .= $this->DOMDocument->saveHTML($iframes[0]); - } elseif ($images->length > 0) { - while ($imgId < $images->length && $imgId < $this->maxImages) { - $this->perex .= $this->DOMDocument->saveHTML($images[$imgId++]); - } - } else { - while (mb_strlen($this->perex) < $this->maxLength && $textId < $texts->length) { - $this->addHtml($texts[$textId++]); - } - } - } - - return $this->perex; - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Pipeline/DisplayContent/LoadCommentsForBlogpost.php b/modules/Blog/Article/Pipeline/DisplayContent/LoadCommentsForBlogpost.php deleted file mode 100644 index 575f9249..00000000 --- a/modules/Blog/Article/Pipeline/DisplayContent/LoadCommentsForBlogpost.php +++ /dev/null @@ -1,33 +0,0 @@ -moduleHandler != Article::class) - return; - - $content->comments = new Collection(); - if (isset($content->moduleSettings['allowComments']) && $content->moduleSettings['allowComments']) { - $content->comments = Comment::where('content_id', $content->id) - ->with('author') - ->where('approved', 1) - ->orderBy('created_at') - ->get(); - } - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Pipeline/SaveContent/TurnCommentsOnOrOff.php b/modules/Blog/Article/Pipeline/SaveContent/TurnCommentsOnOrOff.php deleted file mode 100644 index f52e4bc1..00000000 --- a/modules/Blog/Article/Pipeline/SaveContent/TurnCommentsOnOrOff.php +++ /dev/null @@ -1,29 +0,0 @@ -moduleHandler, '\\') !== Article::class) { - return; - } - - $settings = $content->moduleSettings; - $settings['allowComments'] = isset($input['allowComments']) ? (int)$input['allowComments'] : 0; - $content->moduleSettings = $settings; - $content->save(); - } -} \ No newline at end of file diff --git a/modules/Blog/Article/Providers/ArticleEventServiceProvider.php b/modules/Blog/Article/Providers/ArticleEventServiceProvider.php deleted file mode 100644 index 08287d0e..00000000 --- a/modules/Blog/Article/Providers/ArticleEventServiceProvider.php +++ /dev/null @@ -1,26 +0,0 @@ - [LogCommentApproval::class], - DeletedComment::class => [LogDeletedComment::class], - CreatedComment::class => [LogNewComment::class], - ]; -} \ No newline at end of file diff --git a/modules/Blog/Article/Providers/ArticleServiceProvider.php b/modules/Blog/Article/Providers/ArticleServiceProvider.php deleted file mode 100644 index 5967f16e..00000000 --- a/modules/Blog/Article/Providers/ArticleServiceProvider.php +++ /dev/null @@ -1,34 +0,0 @@ -app->register(ArticleEventServiceProvider::class); - - // load comments for blogpost - app('displayPipeline')->add(LoadCommentsForBlogpost::class); - - app('saveContentPipeline')->add(TurnCommentsOnOrOff::class); - } - - protected function setModuleAlias() - { - $this->alias = 'article'; - } - - protected function setModulePath() - { - $this->path = __DIR__; - } -} diff --git a/modules/Blog/Article/Resources/lang/cs/article.php b/modules/Blog/Article/Resources/lang/cs/article.php deleted file mode 100644 index fd1c65c6..00000000 --- a/modules/Blog/Article/Resources/lang/cs/article.php +++ /dev/null @@ -1,6 +0,0 @@ - "Povolit komentáře?", -"new" => "Napsat", -"overview" => "Všechny články", -]; diff --git a/modules/Blog/Article/Resources/lang/cs/comments.php b/modules/Blog/Article/Resources/lang/cs/comments.php deleted file mode 100644 index fa9aca67..00000000 --- a/modules/Blog/Article/Resources/lang/cs/comments.php +++ /dev/null @@ -1,22 +0,0 @@ - "Schválit komentář a zobrazovat ho u článku", - "approved" => "Komentář úspěšně schválen", - "commentedArticle" => "Komentovaný článek", - "createdAt" => "Vloženo :date", - "deleted" => "Komentář smazán", - "events" => [ - "descriptions" => [ - "commentApproved" => "Schválen komentář od autora :authro (:email) s následujícím obsahem: :content", - "commentCreated" => "Přidán komentář od autora :author (e-mail :e-mail) s následujícím obsahem: :content", - "commentDeleted" => "Smazán komentář od autora :author (:email) s následujícím obsahem: :content", - ], - "names" => [ - "commentApproved" => "Komentář schválen", - "commentCreated" => "Komentář úspěšně přidán.", - "commentDeleted" => "Smazán komentář", - ], - ], - "noComments" => "Nejsou dostupné žádné komentáře", - "unknownArticle" => "Neznámý článek", -]; diff --git a/modules/Blog/Article/Resources/lang/cs/module.php b/modules/Blog/Article/Resources/lang/cs/module.php deleted file mode 100644 index 22653cac..00000000 --- a/modules/Blog/Article/Resources/lang/cs/module.php +++ /dev/null @@ -1,12 +0,0 @@ - "Všechny články", - "blog" => "Blog", - "comments" => "Komentáře", - "commentsOverview" => "Všechny komentáře", - "description" => "Základní submodul pro blog. Tento modul umožňuje psát články.", - "editArticle" => "Upravuji článek", - "name" => "Články", - "newArticle" => "Napsat nový článek", - "templatePath" => "Články", -]; diff --git a/modules/Blog/Article/Resources/lang/en/article.php b/modules/Blog/Article/Resources/lang/en/article.php deleted file mode 100644 index 2d1e8b44..00000000 --- a/modules/Blog/Article/Resources/lang/en/article.php +++ /dev/null @@ -1,6 +0,0 @@ - 'Allow comments?', - 'new' => 'Write new', - 'overview' => 'All articles' -]; \ No newline at end of file diff --git a/modules/Blog/Article/Resources/lang/en/comments.php b/modules/Blog/Article/Resources/lang/en/comments.php deleted file mode 100644 index de5e7301..00000000 --- a/modules/Blog/Article/Resources/lang/en/comments.php +++ /dev/null @@ -1,22 +0,0 @@ - 'Created at :date', - 'commentedArticle' => 'Article', - 'approve' => 'Approve comment', - 'approved' => 'Comment successfully approved', - 'deleted' => 'Comment deleted', - 'unknownArticle' => 'Unknown article', - 'noComments' => 'No comments available', - 'events' => [ - 'names' => [ - 'commentCreated' => 'Added comment', - 'commentApproved' => 'Approved comment', - 'commentDeleted' => 'Deleted comment', - ], - 'descriptions' => [ - 'commentCreated' => 'Added comment from author :author with e-mail :email and following content: :content', - 'commentApproved' => 'Approved comment from author :author with e-mail :email and following content: :content', - 'commentDeleted' => 'Deleted comment from author :author with e-mail :email and following content: :content', - ], - ] -]; \ No newline at end of file diff --git a/modules/Blog/Article/Resources/lang/en/module.php b/modules/Blog/Article/Resources/lang/en/module.php deleted file mode 100644 index 1e272945..00000000 --- a/modules/Blog/Article/Resources/lang/en/module.php +++ /dev/null @@ -1,12 +0,0 @@ - 'Articles', - 'description' => 'Base submodule for blog', - 'comments' => 'Comments', - 'commentsOverview' => 'All comments', - 'blog' => 'Blog', - 'allArticles' => 'All articles', - 'newArticle' => 'Write new article', - 'editArticle' => 'Editing article', - 'templatePath' => 'Articles', -]; \ No newline at end of file diff --git a/modules/Blog/Article/Resources/lang/sk/article.php b/modules/Blog/Article/Resources/lang/sk/article.php deleted file mode 100644 index 2a3ce3a6..00000000 --- a/modules/Blog/Article/Resources/lang/sk/article.php +++ /dev/null @@ -1,6 +0,0 @@ - "Povoliť komentáre?", - "new" => " Napísať nový", - "overview" => "Všetky články", -]; diff --git a/modules/Blog/Article/Resources/lang/sk/comments.php b/modules/Blog/Article/Resources/lang/sk/comments.php deleted file mode 100644 index 5bde58a3..00000000 --- a/modules/Blog/Article/Resources/lang/sk/comments.php +++ /dev/null @@ -1,8 +0,0 @@ - "Schváliť komentár", - "approved" => "Komentár úspešne schválený.", - "commentedArticle" => "Článok", - "createdAt" => "Vytvorené: :date", - "deleted" => "Komentár zmazaný.", -]; diff --git a/modules/Blog/Article/Resources/lang/sk/module.php b/modules/Blog/Article/Resources/lang/sk/module.php deleted file mode 100644 index 04b574c0..00000000 --- a/modules/Blog/Article/Resources/lang/sk/module.php +++ /dev/null @@ -1,9 +0,0 @@ - "Všetky články", - "blog" => "Blog", - "comments" => "Komentáre", - "commentsOverview" => "Všetky komentáre", - "description" => "Základný submodul pre blog", - "name" => "Články", -]; diff --git a/modules/Blog/Article/Resources/views/admin/comments/overview.blade.php b/modules/Blog/Article/Resources/views/admin/comments/overview.blade.php deleted file mode 100644 index adccff8f..00000000 --- a/modules/Blog/Article/Resources/views/admin/comments/overview.blade.php +++ /dev/null @@ -1,56 +0,0 @@ -@extends('admin.layoutWithNavigation') - -@section('pageHeading', trans('article::module.comments')) - -@section('content') - @if (count($comments)) - @foreach($comments as $comment) - -

-
-
-

- - {{$comment->name}} ({{$comment->email}}) -

-
-
-
-

- {{$comment->content}} -

-
- -
- @endforeach - @else -
- @lang('article::comments.noComments') -
- @endif -@endsection \ No newline at end of file diff --git a/modules/Blog/Article/Resources/views/admin/content/basicInfo.blade.php b/modules/Blog/Article/Resources/views/admin/content/basicInfo.blade.php deleted file mode 100644 index dd808110..00000000 --- a/modules/Blog/Article/Resources/views/admin/content/basicInfo.blade.php +++ /dev/null @@ -1,89 +0,0 @@ -
-
- - - @include('admin.snippets.hasError', ['field' => 'title']) -
-
- - - - @include('admin.snippets.hasError', ['field' => 'url']) -
-
- -
-
- -
-
- - - @include('admin.snippets.hasError', ['field' => 'status']) -
-
- - - @include('admin.snippets.hasError', ['field' => 'parentPage']) -
- -
- -
- - @if($module->support_categories && count($categories)) -
- -
- @endif -
- -
-
- -
-
- - - - - diff --git a/modules/Blog/Article/start.php b/modules/Blog/Article/start.php deleted file mode 100644 index 7d8ae759..00000000 --- a/modules/Blog/Article/start.php +++ /dev/null @@ -1,15 +0,0 @@ - 'Article list', - 'translatedName' => 'articlelist::module.name', - 'translatedDescription' => 'articlelist::module.description', - 'alias' => 'articlelist', - 'handler' => \Modules\Blog\ArticleList\Handlers\ArticleList::class, - 'providers' => [\Modules\Blog\ArticleList\Providers\ArticleListServiceProvider::class], - 'files' => ['start.php'], - 'order' => 0, -]; \ No newline at end of file diff --git a/modules/Blog/ArticleList/Handlers/ArticleList.php b/modules/Blog/ArticleList/Handlers/ArticleList.php deleted file mode 100644 index 5641925c..00000000 --- a/modules/Blog/ArticleList/Handlers/ArticleList.php +++ /dev/null @@ -1,28 +0,0 @@ -whereTitle(trans('article::module.blog')); - if (!$blogSubmenu) { - $blogSubmenu = $menu->dropdown(trans('article::module.blog'), function ($sub) { - }, 20, ['icon' => 'fa fa-fw fa-book']); - } - - $blogSubmenu->route('content.new', trans('articlelist::module.name'), ['id' => config('articlelist.alias')], 100, ['icon' => 'fa fa-fw fa-list-alt']); - } - - public static function supportCategories() - { - return false; - } -} \ No newline at end of file diff --git a/modules/Blog/ArticleList/Http/Controllers/.gitkeep b/modules/Blog/ArticleList/Http/Controllers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/modules/Blog/ArticleList/Http/Controllers/ArticleListController.php b/modules/Blog/ArticleList/Http/Controllers/ArticleListController.php deleted file mode 100644 index df742323..00000000 --- a/modules/Blog/ArticleList/Http/Controllers/ArticleListController.php +++ /dev/null @@ -1,12 +0,0 @@ -moduleHandler != ArticleList::class) - return; - - $articles = ArticleModel::where('moduleHandler', Article::class) - ->with('comments') - ->with('category') - ->where(function ($query) { - $query->where('publishedFrom', '<', Carbon::now()) - ->orWhereNull('publishedFrom'); - }) - ->where(function ($query) { - $query->where('publishedTo', '>', Carbon::now()) - ->orWhereNull('publishedTo'); - }) - ->orderBy('publishedFrom', 'DESC') - ->orderBy('created_at', 'DESC'); - - // show articles for not-logged users of even for logged onew? - $articles = !Auth::user() ? $articles->where('status', IContent::STATUS_PUBLIC) : $articles->whereIn('status', [ - IContent::STATUS_PUBLIC, - IContent::STATUS_PROTECTED - ]); - - // selected articles from archive? - $this->archive($articles); - - // is given any category? - $this->category($articles); - - // show articles only from specified user - $author = Input::get('author'); - if ($author) { - $user = User::findOrFail($author); - - $articles = $articles->where('user_id', $user->id); - } - - $page->articles = $articles->paginate(setting('articlesPerPage', 20)); - } - - /** - * Filter articles on article list using archive - * - * @param $articles - */ - protected function archive(&$articles) - { - $year = Input::get('y'); - $month = Input::get('m'); - $day = Input::get('d'); - - if ($year) { - $articles = $articles->where(DB::raw('YEAR(created_at)'), $year); - } - - if ($month) { - $articles = $articles->where(DB::raw('MONTH(created_at)'), $month); - } - - if ($day) { - $articles = $articles->where(DB::raw('DAY(created_at)'), $day); - } - } - - /** - * Filter article list to some specified category - * - * Category URL is specified as GET attribute "category" - * - * @param $articles - */ - protected function category(&$articles) - { - $categoryUrl = Input::get('category'); - - $categoriesEnabled = \Module::get('Categories') - ->enabled(); - - if ($categoryUrl && $categoriesEnabled) { - $category = Category::where('url', $categoryUrl) - ->firstOrFail(); - - $subcategories = $category->getChildren() - ->toArray(); - - $categories = [$category->id]; - $categories = array_merge($categories, array_map(function ($cat) { - return $cat['id']; - }, $subcategories)); - - $articles = $articles->whereIn('category_id', $categories); - } - } -} \ No newline at end of file diff --git a/modules/Blog/ArticleList/Providers/ArticleListServiceProvider.php b/modules/Blog/ArticleList/Providers/ArticleListServiceProvider.php deleted file mode 100644 index 3d5d2c58..00000000 --- a/modules/Blog/ArticleList/Providers/ArticleListServiceProvider.php +++ /dev/null @@ -1,24 +0,0 @@ -alias = 'articlelist'; - } - - protected function setModulePath() - { - $this->path = __DIR__; - } - - public function boot() - { - parent::boot(); - - app('displayPipeline')->add(LoadArticlesForList::class); - } -} diff --git a/modules/Blog/ArticleList/Resources/lang/cs/module.php b/modules/Blog/ArticleList/Resources/lang/cs/module.php deleted file mode 100644 index 09d24c67..00000000 --- a/modules/Blog/ArticleList/Resources/lang/cs/module.php +++ /dev/null @@ -1,6 +0,0 @@ - "Modul pro zobrazování seznamu článků na webu.", - "name" => "Seznam článků", - "templatePath" => "Seznam článků", -]; diff --git a/modules/Blog/ArticleList/Resources/lang/en/module.php b/modules/Blog/ArticleList/Resources/lang/en/module.php deleted file mode 100644 index 98b22ac7..00000000 --- a/modules/Blog/ArticleList/Resources/lang/en/module.php +++ /dev/null @@ -1,6 +0,0 @@ - 'Article list', - 'description' => 'Module for displaying list of articles on web', - 'templatePath' => 'Article list', -]; \ No newline at end of file diff --git a/modules/Blog/ArticleList/Resources/lang/sk/module.php b/modules/Blog/ArticleList/Resources/lang/sk/module.php deleted file mode 100644 index 2e2a64c4..00000000 --- a/modules/Blog/ArticleList/Resources/lang/sk/module.php +++ /dev/null @@ -1,5 +0,0 @@ - "Modul pre zobrazenie zoznamu článkov na webe", - "name" => "Zoznam článkov", -]; diff --git a/modules/Blog/ArticleList/Resources/views/admin/.gitkeep b/modules/Blog/ArticleList/Resources/views/admin/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/modules/Blog/ArticleList/start.php b/modules/Blog/ArticleList/start.php deleted file mode 100644 index 7d8ae759..00000000 --- a/modules/Blog/ArticleList/start.php +++ /dev/null @@ -1,15 +0,0 @@ -increments('id'); - $table->timestamps(); - $table->integer('user_id') - ->nullable(true) - ->default(null) - ->comment('When comment was inserted by logged user, save his ID here'); - $table->integer('content_id'); - $table->string('email'); - $table->string('name'); - $table->text('content'); - $table->boolean('approved'); - - $table->foreign('content_id') - ->references('id') - ->on('contents') - ->onDelete('cascade') - ->onUpdate('cascade'); - - $table->foreign('user_id') - ->references('id') - ->on('users') - ->onDelete('set null') - ->onUpdate('cascade'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('comments'); - } -} diff --git a/modules/Blog/Database/Migrations/2017_02_10_124658_update_alias_for_subdomodules.php b/modules/Blog/Database/Migrations/2017_02_10_124658_update_alias_for_subdomodules.php deleted file mode 100644 index 76970aeb..00000000 --- a/modules/Blog/Database/Migrations/2017_02_10_124658_update_alias_for_subdomodules.php +++ /dev/null @@ -1,34 +0,0 @@ -update(['alias' => 'articlelist']); - Module::where('alias', 'blog-article') - ->update(['alias' => 'article']); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Module::where('alias', 'articlelist') - ->update(['alias' => 'blog-articlelist']); - Module::where('alias', 'article') - ->update(['alias' => 'blog-article']); - } -} diff --git a/modules/Blog/info.php b/modules/Blog/info.php deleted file mode 100644 index 0c426fe5..00000000 --- a/modules/Blog/info.php +++ /dev/null @@ -1,7 +0,0 @@ - 'Blog', - 'translatedName' => 'article::module.blog', - 'description' => 'article.module.blogDescription', - 'hasSubmodules' => true, -]; \ No newline at end of file