FEATURE #2350 @1h: move beforeRender methods into pipeline
This commit is contained in:
@@ -16,28 +16,6 @@ use Modules\Blog\Article\Entities\Comment;
|
||||
|
||||
class Article extends Handler implements ContentTitles, AdvancedContentModifier, InstallableModule
|
||||
{
|
||||
/**
|
||||
* Render given module into visitor area.
|
||||
*
|
||||
* @param Content $content DB model from table contents
|
||||
* @param array $parameters parameters used for modifications/custom settings of given model
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function render(Content $content, $parameters)
|
||||
{
|
||||
$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();
|
||||
}
|
||||
|
||||
return Controller::VisitorsView($content->template, ['page' => $content, 'extra' => $parameters]);
|
||||
}
|
||||
|
||||
public static function getExtendedFormInputsCreate()
|
||||
{
|
||||
$sections = parent::getExtendedFormInputsCreate();
|
||||
@@ -198,17 +176,6 @@ class Article extends Handler implements ContentTitles, AdvancedContentModifier,
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Load some extra data for content management form?
|
||||
*
|
||||
* @param Content $content
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function loadExtraData(Content $content)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this module support categories?
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user