suggested patch for register_function()
Submitted by wb407 on Thu, 2006-07-27 20:09.
EZ Results
---------------------------------------------------------- changes to: ez_results.inc
// $func_args .= "&\$C".($k+1).",";
$arrC[] =& ${'C'.($k+1)};
// eval("$tweak_function(".substr($func_args,0,-1).");");
eval("$tweak_function(&\$arrC);");
---------------------------------------------------------- example of usage:
$fields = array( 1 =>
array('Passes Criteria', 1, 'meets_criteria', 'bool'),
array('Date', 1, 'app_date', 'date')
);
// snip..
$ezr->register_function('format_bool');
function format_bool($args) {
global $fields;
$count = count($args);
if ($count != count($fields)) {return;}
for ($i=0; $i<$count; $i++) {
if ($fields[$i+1][3] == 'bool') {
$args[$i] = ($args[$i])? 'Yes' : 'No';
}
}
}
