Update of /cvsroot/phpicalendar/phpicalendar/functions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12972/functions
Modified Files:
template.php
Log Message:
modify template to use default if tpl file not found in alternate template folder
Index: template.php
===================================================================
RCS file: /cvsroot/phpicalendar/phpicalendar/functions/template.php,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -d -r1.84 -r1.85
*** template.php 21 Mar 2006 09:52:29 -0000 1.84
--- template.php 10 Apr 2006 01:10:40 -0000 1.85
***************
*** 1028,1048 ****
}
! function Page($template = 'std.tpl') {
! if (file_exists($template))
! $this->page = join('', file($template));
! else
! die("Template file $template not found.");
! }
function parse($file) {
! global $template;
! ob_start();
! if (strpos($file, "$template") > 0 || $file =='./functions/event.js'){
include($file);
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
- }else{
- die('breakin attempt');
}
}
--- 1028,1056 ----
}
! function Page($file = 'std.tpl') {
! global $template;
! if (!file_exists($file)){
! #look for it in default if not found
! $file = str_replace("templates/$template","templates/default",$file);
! if (!file_exists($file)) die("Template file $file not found.");
! }
! $this->page = join('', file($file));
! }
function parse($file) {
! global $template; $lang;
! if (basename(dirname($file)) == "$template" || $file =='./functions/event.js'){
! if (!is_file($file)){
! #look for it in default if not found
! $file = str_replace("templates/$template","templates/default",$file);
! }
! if (!is_file($file)){
! exit(error($lang['l_error_path'], $file));
! }
! ob_start();
include($file);
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
}
***************
*** 1070,1074 ****
// This opens up another template and parses it as well.
! $data = (file_exists($data)) ? $this->parse($data) : $data;
// This removes any unfilled tags
--- 1078,1082 ----
// This opens up another template and parses it as well.
! $data = $this->parse($data);
// This removes any unfilled tags
|