62 lines
1.9 KiB
PHP
62 lines
1.9 KiB
PHP
<?php
|
|
namespace App\CMS\Handlers;
|
|
|
|
use App\CMS\Contracts\Modules\AppHandler;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Content\Content;
|
|
|
|
/**
|
|
* Class Handler
|
|
*
|
|
* Handler is a class which handles module-specific behaviour which cannot be done by module itself, resp. cannot be
|
|
* done by some abstract magic.
|
|
*
|
|
* @package App\CMS\Handlers\
|
|
*/
|
|
abstract class Handler extends BaseHandler implements AppHandler
|
|
{
|
|
public static function getHistoryHandler()
|
|
{
|
|
return History::class;
|
|
}
|
|
|
|
/**
|
|
* 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, 'extra' => $parameters]);
|
|
}
|
|
|
|
public static function getExtendedFormSections()
|
|
{
|
|
return [
|
|
'basicInfo' => trans('admin/contents.basicInfo'),
|
|
'meta' => trans('admin/contents.metaOptions'),
|
|
'publication' => trans('admin/contents.publicationOptions'),
|
|
'appearance' => trans('admin/contents.appearance'),
|
|
'files' => trans('admin/contents.files')
|
|
];
|
|
}
|
|
|
|
public static function getExtendedFormInputsCreate()
|
|
{
|
|
return [
|
|
'basicInfo' => 'admin.content.formParts.basicInformation',
|
|
'meta' => 'admin.content.formParts.metaInformation',
|
|
'publication' => 'admin.content.formParts.publicationSetup',
|
|
'appearance' => 'admin.content.formParts.appearance',
|
|
'files' => 'admin.content.formParts.files'
|
|
];
|
|
}
|
|
|
|
public static function getExtendedFormInputsEdit()
|
|
{
|
|
return self::getExtendedFormInputsCreate();
|
|
}
|
|
} |