Little change to allow mixed (ascii & html) widget, all controll by htmlarea

parameters
This commit is contained in:
José Luis Gordo Romero 2007-11-27 05:49:25 +00:00
parent 71fc139a31
commit 43d3ee1cf3
2 changed files with 18 additions and 4 deletions

View File

@ -127,6 +127,12 @@ class bo_tracking
* @var html * @var html
*/ */
var $html; var $html;
/**
* Should the class allow html content (for notifications)
*
* @var boolean
*/
var $html_content_allow = false;
/** /**
* Constructor * Constructor
@ -668,7 +674,7 @@ class bo_tracking
if ($html_mail) if ($html_mail)
{ {
$line = $this->html->htmlspecialchars($line); // XSS if (!$this->html_content_allow) $line = $this->html->htmlspecialchars($line); // XSS
$color = $modified ? 'red' : false; $color = $modified ? 'red' : false;
$size = $html_mail == 'medium' ? 'medium' : 'small'; $size = $html_mail == 'medium' ? 'medium' : 'small';
@ -688,7 +694,12 @@ class bo_tracking
$bold = true; $bold = true;
break; break;
case 'multiline': case 'multiline':
$line = nl2br($line); // Only Convert nl2br on non-html content
$pos = strpos($line, '<br');
if ($pos===false)
{
$line = nl2br($line);
}
break; break;
case 'reply': case 'reply':
$background = '#F1F1F1'; $background = '#F1F1F1';

View File

@ -1140,7 +1140,10 @@ foreach($sess as $key => $val)
} }
break; break;
case 'htmlarea': // Multiline formatted Text Input, size: {simple|extended|advanced},height,width,toolbar-expanded,upload-path case 'htmlarea': // Multiline formatted Text Input, size: {simple|extended|advanced},height,width,toolbar-expanded,upload-path
list($mode,$height,$width,$toolbar,$baseref) = explode(',',$cell_options); list($mode,$height,$width,$toolbar,$baseref,$convertnl) = explode(',',$cell_options);
if ($convertnl == 1) $value = nl2br($value);
if (!$readonly) if (!$readonly)
{ {
$mode = $mode ? $mode : 'simple'; $mode = $mode ? $mode : 'simple';
@ -1158,7 +1161,7 @@ foreach($sess as $key => $val)
} }
else else
{ {
$html .= $this->html->div($this->html->activate_links($value),'style="overflow: auto; border: thin inset black; width='. $width. '; height='. $height. '"'); $html .= $this->html->div($this->html->activate_links($value),'style="overflow: auto; width='. $width. '; height='. $height. '"');
} }
break; break;
case 'checkbox': case 'checkbox':