From 3e52f102f4fed0a8179db1f7eff58f3ca4c84c37 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 10 Nov 2003 18:36:10 +0000 Subject: [PATCH] added functions to read/write PDF text --- lam/lib/config.inc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lam/lib/config.inc b/lam/lib/config.inc index a22a702b..d73307cc 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -664,6 +664,34 @@ class Config { return true; } + // returns text for user PDF files + function get_pdftext() { + if ($this->pdftext) return $this->pdftext; + else return ""; + } + + // set the text for user PDF files + // $value: string containing the text + // returns true if $value has correct format and could be saved + function set_pdftext($value) { + if (is_string($value)) { + $pdffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/pdf/" . $this->file . ".txt"; + if (is_file($pdffile)) { + $file = @fopen($pdffile, "w"); + if ($file) { + @fputs($file, $value); + fclose($file); + $this->pdftext = $value; + } + else return false; + } + else return false; + $this->pdftext = $value; + } + else return false; + return true; + } + } /*