FEATURE: add customizable settings for create/edit/overview of content pages

This commit is contained in:
Michal Kváček
2016-09-24 02:55:51 +02:00
parent b7434d0a0b
commit 6d107d0881
10 changed files with 131 additions and 14 deletions
@@ -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,