diff --git a/Controller.php b/Controller.php index 5afd02b..cd958c5 100644 --- a/Controller.php +++ b/Controller.php @@ -112,6 +112,9 @@ class Controller extends ModuleAbstract implements WebInterface $view->setTemplate('/Modules/Editor/Theme/Backend/editor-create'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response)); + $editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app, $request, $response); + $view->addData('editor', $editor); + return $view; } diff --git a/Theme/Backend/Components/Editor/BaseView.php b/Theme/Backend/Components/Editor/BaseView.php new file mode 100644 index 0000000..3a92406 --- /dev/null +++ b/Theme/Backend/Components/Editor/BaseView.php @@ -0,0 +1,46 @@ +setTemplate('/Modules/Editor/Theme/Backend/Components/Editor/inline-editor-tools'); + + $view = new TextView($app, $request, $response); + $this->addData('text', $view); + } + + public function getId() : string + { + return $this->id; + } + + public function render(...$data) : string + { + $this->id = $data[0]; + return parent::render(); + } +} \ No newline at end of file diff --git a/Theme/Backend/Components/Editor/TextView.php b/Theme/Backend/Components/Editor/TextView.php new file mode 100644 index 0000000..3f9b844 --- /dev/null +++ b/Theme/Backend/Components/Editor/TextView.php @@ -0,0 +1,43 @@ +setTemplate('/Modules/Editor/Theme/Backend/Components/Editor/inline-editor'); + } + + public function getId() : string + { + return $this->id; + } + + public function render(...$data) : string + { + $this->id = $data[0]; + return parent::render(); + } +} \ No newline at end of file diff --git a/Theme/Backend/inline-editor-tools.tpl.php b/Theme/Backend/Components/Editor/inline-editor-tools.tpl.php similarity index 100% rename from Theme/Backend/inline-editor-tools.tpl.php rename to Theme/Backend/Components/Editor/inline-editor-tools.tpl.php diff --git a/Theme/Backend/inline-editor.tpl.php b/Theme/Backend/Components/Editor/inline-editor.tpl.php similarity index 100% rename from Theme/Backend/inline-editor.tpl.php rename to Theme/Backend/Components/Editor/inline-editor.tpl.php diff --git a/Theme/Backend/editor-create.tpl.php b/Theme/Backend/editor-create.tpl.php index 02da40f..1563472 100644 --- a/Theme/Backend/editor-create.tpl.php +++ b/Theme/Backend/editor-create.tpl.php @@ -32,86 +32,17 @@ echo $this->getData('nav')->render(); ?>
-
-
- -
- -
-
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
-
- -
-
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
-
- -
-
-
+
+
+ getData('editor')->render('editor-tools'); ?>
-
+
-
-
- -
- -
- -
- -
-
-
-
-
+ getData('editor')->getData('text')->render('editor-text'); ?>
diff --git a/Theme/Backend/editor.tpl.php b/Theme/Backend/editor.tpl.php deleted file mode 100644 index 5a4b63f..0000000 --- a/Theme/Backend/editor.tpl.php +++ /dev/null @@ -1,36 +0,0 @@ -getData('doc') ?? null; -?> -
-
-
- -
-
- -
-
- -
-
- -
- -
-
\ No newline at end of file