From d80a8bbdba6135d32116e2df9549b6d02c198cd2 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 2 Mar 2015 10:13:06 +0100 Subject: [PATCH] revert bug1840 to eldy solution --- htdocs/core/class/doleditor.class.php | 6 +----- htdocs/core/class/html.formmail.class.php | 16 +++------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 5bc034831ca..0839639217f 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -43,7 +43,6 @@ class DolEditor var $height; var $width; var $readonly; - var $allowed_content; /** @@ -63,9 +62,8 @@ 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,$allowed_content=0) + function __construct($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0,$readonly=0) { global $conf,$langs; @@ -134,7 +132,6 @@ 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; } } @@ -184,7 +181,6 @@ class DolEditor { /* property:xxx is same than CKEDITOR.config.property = xxx */ customConfig : ckeditorConfig, - allowedContent :'.($this->allowed_content?'true':'false').', readOnly : '.($this->readonly?'true':'false').', htmlEncodeOutput :'.$htmlencode_force.', allowedContent :'.(empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT)?'false':'true').', diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 668031aafe6..fa6a10024b9 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -584,13 +584,8 @@ class FormMail if (! empty($this->withbody)) { $defaultmessage=""; - $from_template=false; - if (count($arraydefaultmessage) > 0 && $arraydefaultmessage['content']) { - $defaultmessage=$arraydefaultmessage['content']; - $from_template=true; - } elseif (! is_numeric($this->withbody)) { - $defaultmessage=$this->withbody; - } + if (count($arraydefaultmessage) > 0 && $arraydefaultmessage['content']) $defaultmessage=$arraydefaultmessage['content']; + elseif (! is_numeric($this->withbody)) $defaultmessage=$this->withbody; // Complete substitution array if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) @@ -620,11 +615,6 @@ class FormMail $defaultmessage = dol_nl2br($defaultmessage); } - if (dol_textishtml($defaultmessage) && $from_template) { - $allow_content=1; - } else { - $allow_content=0; - } if (isset($_POST["message"])) $defaultmessage=$_POST["message"]; else @@ -655,7 +645,7 @@ class FormMail else $this->withfckeditor=0; } - $doleditor=new DolEditor('message',$defaultmessage,'',280,$this->ckeditortoolbar,'In',true,true,$this->withfckeditor,8,72,0,$allow_content); + $doleditor=new DolEditor('message',$defaultmessage,'',280,$this->ckeditortoolbar,'In',true,true,$this->withfckeditor,8,72); $out.= $doleditor->Create(1); } $out.= "\n";