From: <cl...@us...> - 2004-08-18 00:10:25
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11335/functions Modified Files: template.php Log Message: Revert. Index: template.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/template.php,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** template.php 18 Aug 2004 00:08:33 -0000 1.52 --- template.php 18 Aug 2004 00:10:08 -0000 1.53 *************** *** 912,915 **** --- 912,918 ---- $this->page = str_replace('{' . strtoupper($tag) . '}', $data, $this->page); } + + else + die('No tags designated for replacement.'); } *************** *** 917,923 **** --- 920,938 ---- 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.'); } |