From cd8871a53d18379ec9c21bf2da29f560b4c2687b Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Fri, 1 Jul 2005 13:27:35 +0000 Subject: [PATCH] add fetch_string function so templates can live in a database table as well --- phpgwapi/inc/class.tplsavant2.inc.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/phpgwapi/inc/class.tplsavant2.inc.php b/phpgwapi/inc/class.tplsavant2.inc.php index 63440abe94..0028665428 100755 --- a/phpgwapi/inc/class.tplsavant2.inc.php +++ b/phpgwapi/inc/class.tplsavant2.inc.php @@ -197,5 +197,16 @@ echo "Backtrace: ".function_backtrace(2)."
\n"; } + function fetch_string($string) + { + $tmpfname = tempnam ("/tmp", "sav"); + $fp = fopen($tmpfname, "w"); + fwrite($fp, $string); + fclose($fp); + $this->addPath('template','/tmp'); + $file_arr= explode('/',$tmpfname); + return $this->fetch($file_arr[2]); + unlink($tmpfname); + } }