From fc6ea7746d5ea7d5729840bd50981f0ab8620ca2 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 3 Mar 2023 09:02:11 +0100 Subject: [PATCH] handle empty or nulled content --- conlite/external/wysiwyg/tinymce3/editor.php | 94 ++++++++++---------- 1 file changed, 45 insertions(+), 49 deletions(-) diff --git a/conlite/external/wysiwyg/tinymce3/editor.php b/conlite/external/wysiwyg/tinymce3/editor.php index 439d6af..fe9c803 100644 --- a/conlite/external/wysiwyg/tinymce3/editor.php +++ b/conlite/external/wysiwyg/tinymce3/editor.php @@ -1,4 +1,5 @@ setSetting("height", $editor_height, true); +if ($editor_height !== false) { + $cTinyMCEEditor->setSetting("height", $editor_height, true); } /* -TODO: + TODO: --> see editor_template.js --> create own theme template engine --> maybe change the way icons are displayed -*/ + -> see editor_template.js + -> create own theme template engine + -> maybe change the way icons are displayed + */ $currentuser = new User; $currentuser->loadUserByUserID($auth->auth["uid"]); -if ($currentuser->getField("wysi") == 1) -{ - echo $cTinyMCEEditor->getScripts(); - echo $cTinyMCEEditor->getEditor(); +if ($currentuser->getField("wysi") == 1) { + echo $cTinyMCEEditor->getScripts(); + echo $cTinyMCEEditor->getEditor(); } else { - $oTextarea = new cHTMLTextarea($editor_name, $editor_content); - $oTextarea->setId($editor_name); - - $bgColor = getEffectiveSetting("wysiwyg", "tinymce-backgroundcolor", "white"); - $editor_width = getEffectiveSetting("wysiwyg", "tinymce-width", "600"); - $editor_height = getEffectiveSetting("wysiwyg", "tinymce-height", "480"); - - $oTextarea->setStyle("width: ".$editor_width."px; height: ".$editor_height."px; background-color: ".$bgColor.";"); + $oTextarea = new cHTMLTextarea($editor_name, $editor_content); + $oTextarea->setId($editor_name); - echo $oTextarea->render(); + $bgColor = getEffectiveSetting("wysiwyg", "tinymce-backgroundcolor", "white"); + $editor_width = getEffectiveSetting("wysiwyg", "tinymce-width", "600"); + $editor_height = getEffectiveSetting("wysiwyg", "tinymce-height", "480"); + + $oTextarea->setStyle("width: " . $editor_width . "px; height: " . $editor_height . "px; background-color: " . $bgColor . ";"); + + echo $oTextarea->render(); } ?> \ No newline at end of file