FEATURE: move default Handler::render() into parent class
This commit is contained in:
@@ -31,7 +31,7 @@ class Article extends Handler
|
||||
->get();
|
||||
}
|
||||
|
||||
return Controller::VisitorsView($content->template, ['page' => $content]);
|
||||
return Controller::VisitorsView($content->template, ['page' => $content, 'extra' => $parameters]);
|
||||
}
|
||||
|
||||
public static function getExtendedFormInputsCreate()
|
||||
|
||||
@@ -98,7 +98,7 @@ class ArticleList extends Handler
|
||||
$articles = $articles->orderBy('created_at', 'DESC')
|
||||
->paginate(20);
|
||||
|
||||
return Controller::VisitorsView($content->template, ['page' => $content, 'articles' => $articles]);
|
||||
return Controller::VisitorsView($content->template, ['page' => $content, 'articles' => $articles, 'extra' => $parameters]);
|
||||
}
|
||||
|
||||
public static function getModuleId()
|
||||
|
||||
@@ -11,21 +11,6 @@ use App\Models\User;
|
||||
|
||||
class ContactForm extends Handler
|
||||
{
|
||||
/**
|
||||
* 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->module_settings = json_decode($content->module_settings);
|
||||
|
||||
return Controller::VisitorsView($content->template, ['page' => $content]);
|
||||
}
|
||||
|
||||
public static function getHistoryHandler()
|
||||
{
|
||||
return ContactFormHistory::class;
|
||||
@@ -174,7 +159,6 @@ class ContactForm extends Handler
|
||||
*/
|
||||
public static function install()
|
||||
{
|
||||
// TODO: Implement install() method.
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,11 +28,6 @@ class Gallery implements AppHandler
|
||||
*/
|
||||
public function render(Content $content, $parameters)
|
||||
{
|
||||
// if settings is still string, convert it into object
|
||||
if (is_string($content->module_settings)) {
|
||||
$content->module_settings = json_decode($content->module_settings);
|
||||
}
|
||||
|
||||
// get directory ID
|
||||
$directoryId = $content->module_settings->directoryId;
|
||||
|
||||
@@ -42,7 +37,11 @@ class Gallery implements AppHandler
|
||||
->get();
|
||||
|
||||
// render content
|
||||
return Controller::VisitorsView($content->template, ['images' => $images, 'page' => $content]);
|
||||
return Controller::VisitorsView($content->template, [
|
||||
'images' => $images,
|
||||
'page' => $content,
|
||||
'extra' => $parameters
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getHistoryHandler()
|
||||
|
||||
@@ -33,19 +33,6 @@ class StaticPage extends Handler
|
||||
return $moduleId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
return Controller::VisitorsView($content->template, ['page' => $content]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does given module manage content? Or is it just module with widgets/something internal/something absolutely else?
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user