From 7f5e4aa135da4b33b1571eaa91b7cff98617d5a5 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 11 Feb 2015 11:44:49 +0100 Subject: [PATCH 1/5] FIX : bug #1840 Email template modules in HTML are not render correctly --- htdocs/core/class/doleditor.class.php | 10 ++++++---- htdocs/core/class/html.formmail.class.php | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 6dc726b084e..0433d7799c4 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -43,6 +43,7 @@ class DolEditor var $height; var $width; var $readonly; + var $allowed_content; /** @@ -62,8 +63,9 @@ class DolEditor * @param int $rows Size of rows for textarea tool * @param int $cols Size of cols for textarea tool (textarea number of cols or %) * @param int $readonly 0=Read/Edit, 1=Read only + * @param int $allowed_content 0=filter input text, 1=render as it is */ - function __construct($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0,$readonly=0) + function __construct($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0,$readonly=0,$allowed_content=0) { global $conf,$langs; @@ -132,6 +134,7 @@ class DolEditor $this->cols = (preg_match('/%/',$cols)?$cols:max(40,$cols)); // If $cols is a percent, we keep it, otherwise, we take max $this->height = $height; $this->width = $width; + $this->allowed_content = $allowed_content; } } @@ -163,16 +166,14 @@ class DolEditor $out.= ''; - if ($this->tool == 'ckeditor') { if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR','1'); //$skin='kama'; $skin='moono'; // default with cdeditor 4 - + $htmlencode_force=preg_match('/_encoded$/',$this->toolbarname)?'true':'false'; - $out.= '