Add format_func

master
vitalif 2010-11-03 16:53:14 +00:00
parent 15a43042cd
commit 067443e935
1 changed files with 7 additions and 0 deletions

View File

@ -330,6 +330,8 @@ class OLAP
$tdhead = self::recurse_head($bytype['td'], $tdkeys);
$trhead = self::recurse_head($bytype['tr'], $data);
$cells = self::recurse_cells($fields, $data, $tdkeys);
if (!is_array($cells))
$cells = array(array($cells));
$rows = array();
foreach ($tdhead as $i => &$v)
{
@ -598,6 +600,11 @@ class OLAP
$value = preg_replace('/\.0+$|(\.\d*?)0+$/', '\1', $value);
return $value;
}
elseif (($proc = self::$current_src['fielddescs'][$field]['format_func']) &&
is_callable($proc))
{
return $proc($value, self::$is_html_format);
}
$fn = self::$is_html_format ? 'htmlspecialchars' : 'addslashes';
return $fn($value);
}