diff options
author | Chad Little <clittle@users.sourceforge.net> | 2004-08-18 00:10:08 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2004-08-18 00:10:08 +0000 |
commit | 135161f65b8633cb6ebf2554b97a07b386dfecb3 (patch) | |
tree | 5fcaf9dbdc56b0b4ad00b147a508f66e97ddc808 | |
parent | 20b4da0690a7e8744e8d6c65173436c222c01a2d (diff) | |
download | phpicalendar-135161f65b8633cb6ebf2554b97a07b386dfecb3.tar.gz phpicalendar-135161f65b8633cb6ebf2554b97a07b386dfecb3.tar.bz2 phpicalendar-135161f65b8633cb6ebf2554b97a07b386dfecb3.zip |
Revert.
-rw-r--r-- | functions/template.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/functions/template.php b/functions/template.php index 008cdec..2948218 100644 --- a/functions/template.php +++ b/functions/template.php @@ -911,14 +911,29 @@ class Page { // This replaces any tags $this->page = str_replace('{' . strtoupper($tag) . '}', $data, $this->page); } + + else + die('No tags designated for replacement.'); } function replace_files($tags = array()) { if (sizeof($tags) > 0) foreach ($tags as $tag => $data) { + // This opens up another template and parses it as well. $data = (file_exists($data)) ? $this->parse($data) : $data; + + // This removes any unfilled tags + if (!$data) { + $this->page = preg_replace('!<\!-- switch ' . $tag . ' on -->(.*)<\!-- switch ' . $tag . ' off -->!is', '', $this->page); + } + + // This replaces any tags + $this->page = str_replace('{' . strtoupper($tag) . '}', $data, $this->page); } + + else + die('No tags designated for replacement.'); } function output() { |