Move Template Selection to a separate page
[MAILPOET-2987]
This commit is contained in:
@ -188,6 +188,26 @@ class Menu {
|
||||
});
|
||||
});
|
||||
|
||||
// form editor templates
|
||||
$formTemplateSelectionEditorPage = $this->wp->addSubmenuPage(
|
||||
true,
|
||||
$this->setPageTitle(__('Form Editor', 'mailpoet')),
|
||||
$this->wp->__('Form Editor', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_FORMS,
|
||||
'mailpoet-form-editor-template-selection',
|
||||
[
|
||||
$this,
|
||||
'formEditorTemplateSelection',
|
||||
]
|
||||
);
|
||||
|
||||
// add body class for form editor page
|
||||
$this->wp->addAction('load-' . $formTemplateSelectionEditorPage, function() {
|
||||
$this->wp->addAction('admin_body_class', function ($classes) {
|
||||
return ltrim($classes . ' block-editor-page');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Subscribers page
|
||||
$subscribersPage = $this->wp->addSubmenuPage(
|
||||
@ -454,6 +474,10 @@ class Menu {
|
||||
$this->container->get(FormEditor::class)->render();
|
||||
}
|
||||
|
||||
public function formEditorTemplateSelection() {
|
||||
$this->container->get(FormEditor::class)->renderTemplateSelection();
|
||||
}
|
||||
|
||||
public function setPageTitle($title) {
|
||||
return sprintf(
|
||||
'%s - %s',
|
||||
|
Reference in New Issue
Block a user