FEATURE: add customizable settings for create/edit/overview of content pages
This commit is contained in:
@@ -35,6 +35,14 @@ class EditContent extends Controller
|
||||
*/
|
||||
private $file;
|
||||
|
||||
/**
|
||||
* EditContent constructor.
|
||||
*
|
||||
* Load ContentHistory and File into this controller
|
||||
*
|
||||
* @param ContentHistory $history
|
||||
* @param File $file
|
||||
*/
|
||||
public function __construct(ContentHistory $history, File $file)
|
||||
{
|
||||
$this->history = $history;
|
||||
@@ -61,6 +69,11 @@ class EditContent extends Controller
|
||||
$module = Module::where('handler', $page->module_handler)
|
||||
->firstOrFail();
|
||||
|
||||
$pageHeading = trans('admin/contents.edit', ['name' => e($page->title)]);
|
||||
if (is_callable([$module->handler, 'getCreateNewTitle'])) {
|
||||
$pageHeading = call_user_func([$module->handler, 'getEditTitle'], $page);
|
||||
}
|
||||
|
||||
// get all Blade templates for rendering page
|
||||
$templates = Template::where('module_id', $module->id)
|
||||
->select(['template_name', 'name', 'description'])
|
||||
@@ -83,6 +96,7 @@ class EditContent extends Controller
|
||||
|
||||
// render view
|
||||
return view('admin.content.edit', [
|
||||
'pageHeading' => $pageHeading,
|
||||
'contentStatuses' => $statuses,
|
||||
'page' => $page,
|
||||
'module' => $module,
|
||||
|
||||
Reference in New Issue
Block a user