Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steffanwilliams/583352 to your computer and use it in GitHub Desktop.
Save steffanwilliams/583352 to your computer and use it in GitHub Desktop.
<?php
...
function fetch_form($name)
{
static $forms = array();
if (isset($forms[$name]))
$f = $forms[$name];
else {
$row = @file_get_contents(txpath.'/../templates/forms/'.doSlash($name).'.php');
if (!$row) {
$row = safe_row('Form', 'txp_form',"name='".doSlash($name)."'");
if (!$row) {
trigger_error(gTxt('form_not_found').': '.$name);
return;
}
$f = $row['Form'];
$forms[$name] = $f;
} else {
$f = $row;
$forms[$name] = $row;
}
}
trace_add('['.gTxt('form').': '.$name.']');
return $f;
}
...
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment