From 9de8145f82672902ef3c0cf7c7059a717f37453f Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 2 Feb 2023 15:41:33 +0100 Subject: [PATCH] TineMCE refactoring Unified all tinyMCE instances used across AAC, now they are initiated in one single file + added option to upload images within editor (CTRL-C CTRL-V) + there is new folder: user/, which will be used for all user generated data, like image uploads, guild images, etc. --- .gitignore | 3 ++ admin/tools/upload_image.php | 53 +++++++++++++++++++++ common.php | 3 +- system/templates/admin.mailer.html.twig | 22 ++++----- system/templates/admin.news.form.html.twig | 48 +++---------------- system/templates/admin.pages.form.html.twig | 41 +++++----------- system/templates/tinymce.html.twig | 48 +++++++++++++++++++ 7 files changed, 133 insertions(+), 85 deletions(-) create mode 100644 admin/tools/upload_image.php create mode 100644 system/templates/tinymce.html.twig diff --git a/.gitignore b/.gitignore index 3ce9fb84..a6e1a248 100644 --- a/.gitignore +++ b/.gitignore @@ -54,5 +54,8 @@ landing # system system/functions_custom.php +user/* +!user/index.html + # others/rest system/pages/downloads.php diff --git a/admin/tools/upload_image.php b/admin/tools/upload_image.php new file mode 100644 index 00000000..8bea12e0 --- /dev/null +++ b/admin/tools/upload_image.php @@ -0,0 +1,53 @@ + $returnPathToImage]); +} else { + // Notify editor that the upload failed + header('HTTP/1.1 500 Server Error'); +} + + diff --git a/common.php b/common.php index 458225ef..076341a7 100644 --- a/common.php +++ b/common.php @@ -67,6 +67,7 @@ const PLUGINS = BASE . 'plugins/'; const TEMPLATES = BASE . 'templates/'; const TOOLS = BASE . 'tools/'; const VENDOR = BASE . 'vendor/'; +const USER = BASE . 'user/'; // menu categories const MENU_CATEGORY_NEWS = 1; @@ -99,7 +100,7 @@ $size = count($tmp) - 1; for($i = 1; $i < $size; $i++) $basedir .= '/' . $tmp[$i]; -$basedir = str_replace(array('/admin', '/install'), '', $basedir); +$basedir = str_replace(['/admin', '/install', '/tools'], '', $basedir); define('BASE_DIR', $basedir); if(!IS_CLI) { diff --git a/system/templates/admin.mailer.html.twig b/system/templates/admin.mailer.html.twig index 761467d2..eaf32213 100644 --- a/system/templates/admin.mailer.html.twig +++ b/system/templates/admin.mailer.html.twig @@ -1,34 +1,28 @@ - +{{ include('tinymce.html.twig') }} +

Sending mails may take some time if there are many users in db.

Mailer
-
+
+
+ +
- - +