Dbut ajout de la fonction clean_html qui permettra de nettoyer le code html lors de l'exportation au format XLS ou CVS pour les accents ou lorsqu'on utilise Fckeditor

This commit is contained in:
Regis Houssin 2007-03-19 16:28:17 +00:00
parent 56d8c76de8
commit 67fa1f3d00
3 changed files with 15 additions and 2 deletions

View File

@ -131,7 +131,7 @@ class ExportCsv extends ModeleExports
{
$alias=$array_alias[$code];
//print "dd".$alias;
$newvalue=ereg_replace(';',',',$objp->$alias);
$newvalue=ereg_replace(';',',',clean_html($objp->$alias));
$newvalue=ereg_replace("\r",'',$newvalue);
$newvalue=ereg_replace("\n",'\n',$newvalue);
fwrite($this->handle,$newvalue.";");

View File

@ -148,7 +148,7 @@ class ExportExcel extends ModeleExports
{
$alias=$array_alias[$code];
//print "dd".$alias;
$this->worksheet->write($this->row, $this->col, $objp->$alias);
$this->worksheet->write($this->row, $this->col, clean_html($objp->$alias));
$this->col++;
}
$this->row++;

View File

@ -2295,4 +2295,17 @@ function weight_units_string($unit)
return $weight_string[$unit];
}
/**
\brief Nettoie le code HTML
\param string StringHtml
\return string CleanString
\todo nettoyer les balises html
*/
function clean_html($StringHtml)
{
$CleanString = html_entity_decode($StringHtml);
return $CleanString;
}
?>