during my devs, i had a problem to parse a template file within the fields and to execute php code in that template, so i decided to change the setMask function to not execute the get_file_content function and i add a new function that get an include content, sorry for my english, i think you will understand with code :
<?php
function setMask($mask = null, $repeat = true) {
// when no mask is given, set the default mask
if (is_null($mask)) {
$mask = FH_DEFAULT_ROW_MASK;
}
// a mask is given.. is it a file ?
else
if (file_exists($mask) && is_file($mask)) // double check of PHP bug in file_exists
{
// is the file readable ?
if (is_readable($mask)) {
// get the contents of the file and parse php code in it
if ($mask = $this->get_include_contents($mask)) {
}
} // the file is not readable!
else {
trigger_error('Could not read template ' . $mask, E_USER_WARNING);
}
}
// is there a third arument (the old way for disabling the table tag)
if (func_num_args() == 3) {
// display deprectated message
trigger_error('This way of disabling the table tag is deprecated! ' .
'Use the method "useTable" instead!', E_USER_NOTICE);
// save the var
$this->_setTable = func_get_arg(2);
}
// save the mask
$this->_fields[] = array (
'__MASK__',
array (
$mask,
$repeat
)
);
}
function get_include_contents($filename) {
if (is_file($filename)) {
ob_start();
include $filename;
$contents = ob_get_contents();
ob_end_clean();
return $contents;
}
return false;
}
?>