BUG 7104 Fix Bug in grids for long text content.

This commit is contained in:
Hector Cortez
2011-10-17 09:29:55 -04:00
parent b8966fa558
commit 6ae73c827b

View File

@@ -397,12 +397,22 @@ class propelTable
$value = '';
}
// checking if the value variable is a html field, a html tag content can't contain   as white spaces
$testValue = preg_match( "/<\/?\w+((\s+(\w|\w[\w-]*\w)(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/i", $value, $matches );
if (empty($matches)){
$this->tpl->assign( "value" , (preg_match('^[[:space:]]^', $value) && (substr($fieldName,0,3)!="PRO"))? str_ireplace(" ","&nbsp;",$htmlField):$htmlField );
$testValue = preg_match( "/<a ?.*>(.*)<\/a>/i", $htmlField, $value);
$this->tpl->assign( "value" , $htmlField );
if ($testValue>0 && (isset($value[1]) && strlen(trim($value[1])) == 0 )) {
$this->tpl->assign( "value" , "&nbsp;" );
// $this->tpl->assign( "value" , (preg_match('^[[:space:]]^', $value) && (substr($fieldName,0,3)!="PRO"))? str_ireplace(" ","&nbsp;",$htmlField):$htmlField );
} else {
$this->tpl->assign( "value" , $htmlField );
}
/* $testValue = preg_match( "/<\/?\w+((\s+(\w|\w[\w-]*\w)(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/i", $value, $matches ); */
// if (empty($matches)){
// $this->tpl->assign( "value" , (preg_match('^[[:space:]]^', $value) && (substr($fieldName,0,3)!="PRO"))? str_ireplace(" ","&nbsp;",$htmlField):$htmlField );
// } else {
// $this->tpl->assign( "value" , $htmlField );
// }
}
return $this->fields[$r]['Type'];
}