FEATURE: add unlimited depth of subpages
This commit is contained in:
@@ -56,7 +56,7 @@ class CreateNewContent extends Controller
|
|||||||
'templates' => $templates,
|
'templates' => $templates,
|
||||||
'moduleId' => $moduleId,
|
'moduleId' => $moduleId,
|
||||||
'page' => $this->content,
|
'page' => $this->content,
|
||||||
'rootPages' => $this->content->rootPages(),
|
'rootPages' => $this->content->getOverview()->get(),
|
||||||
'moduleName' => trans($module->name),
|
'moduleName' => trans($module->name),
|
||||||
'extraData' => call_user_func([$module->handler, 'loadExtraData'], $this->content),
|
'extraData' => call_user_func([$module->handler, 'loadExtraData'], $this->content),
|
||||||
'formSectionNames' => call_user_func([$module->handler, 'getExtendedFormSections']),
|
'formSectionNames' => call_user_func([$module->handler, 'getExtendedFormSections']),
|
||||||
|
|||||||
@@ -64,7 +64,9 @@ class EditContent extends Controller
|
|||||||
return view('admin.content.edit', [
|
return view('admin.content.edit', [
|
||||||
'contentStatuses' => $statuses,
|
'contentStatuses' => $statuses,
|
||||||
'page' => $page,
|
'page' => $page,
|
||||||
'rootPages' => $page->rootPages(),
|
'rootPages' => $page->getOverview()
|
||||||
|
->where('contents.id', '!=', $page->id)
|
||||||
|
->get(),
|
||||||
'templates' => $templates,
|
'templates' => $templates,
|
||||||
'extraData' => call_user_func([$page->module_handler, 'loadExtraData'], $page),
|
'extraData' => call_user_func([$page->module_handler, 'loadExtraData'], $page),
|
||||||
'formSectionNames' => call_user_func([$page->module_handler, 'getExtendedFormSections']),
|
'formSectionNames' => call_user_func([$page->module_handler, 'getExtendedFormSections']),
|
||||||
|
|||||||
@@ -82,6 +82,12 @@ class Content extends Model
|
|||||||
$this->subpages = $this->getPageQuery()
|
$this->subpages = $this->getPageQuery()
|
||||||
->where('parent_id', $this->id)
|
->where('parent_id', $this->id)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
// convert JSON settings into stdClass
|
||||||
|
foreach ($this->subpages as $subpage) {
|
||||||
|
$subpage->module_settings = json_decode($subpage->module_settings);
|
||||||
|
}
|
||||||
|
|
||||||
$this->subpagesInit = true;
|
$this->subpagesInit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user