Add format_func
parent
15a43042cd
commit
067443e935
7
olap.php
7
olap.php
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue