From 392f468a13d58b213cec92e868b5e9f4416039c3 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Wed, 16 Feb 2022 09:59:18 +0100 Subject: [PATCH 1/2] allow to add more CSS and more params on html fields --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/doleditor.class.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 87f6ba693fc..ac6d67c3f30 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6693,7 +6693,7 @@ abstract class CommonObject if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); - $out = $doleditor->Create(1); + $out = $doleditor->Create(1, '', true, '', '', $moreparam, $morecss); } else { $out = ''; } diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index da98719d828..22300b53e9e 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -121,9 +121,11 @@ class DolEditor * @param boolean $disallowAnyContent Disallow to use any content. true=restrict to a predefined list of allowed elements. Used by CKEditor only. * @param string $titlecontent Show title content before editor area. Used by ACE editor only. * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...) + * @param string $moreparams Add extra tags to the textarea + * @param string $morecss Add extra css to the textarea * @return void|string */ - public function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $titlecontent = '', $option = '') + public function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $titlecontent = '', $option = '', $moreparam = '', $morecss = '') { // phpcs:enable global $conf, $langs; @@ -141,7 +143,7 @@ class DolEditor //$out.= ''; From 835b0f5f19db00d7657f2320e9342d4ba4606b41 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Feb 2022 21:45:04 +0100 Subject: [PATCH 2/2] Update doleditor.class.php --- htdocs/core/class/doleditor.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 22300b53e9e..c7af20aa6a2 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -121,8 +121,8 @@ class DolEditor * @param boolean $disallowAnyContent Disallow to use any content. true=restrict to a predefined list of allowed elements. Used by CKEditor only. * @param string $titlecontent Show title content before editor area. Used by ACE editor only. * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...) - * @param string $moreparams Add extra tags to the textarea - * @param string $morecss Add extra css to the textarea + * @param string $moreparam Add extra tags to the textarea + * @param string $morecss Add extra css to the textarea * @return void|string */ public function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $titlecontent = '', $option = '', $moreparam = '', $morecss = '')