FEATURE: change directory structure
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
namespace App\CMS\Handlers;
|
||||
|
||||
use App\CMS\Handlers\Contracts\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
|
||||
{
|
||||
/**
|
||||
* todo: Temporary method, will be implemented for each Handler
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function supportCategories()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
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 delete(Content $content)
|
||||
{
|
||||
// temporarily nothing to do
|
||||
}
|
||||
|
||||
public static function loadExtraData(Content $content) {
|
||||
// temporarily nothing to do
|
||||
}
|
||||
|
||||
public static function getExtendedFormInputsEdit()
|
||||
{
|
||||
return self::getExtendedFormInputsCreate();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user