- fixed handling of template_exits methode for all resource types

This commit is contained in:
Uwe.Tews
2009-09-30 18:28:50 +00:00
parent ed6df80a8f
commit 25d4535be6
8 changed files with 123 additions and 40 deletions

View File

@@ -21,15 +21,11 @@
* @return boolean status
*/
function template_exists($smarty, $resource_name)
{
foreach((array)$smarty->template_dir as $_template_dir) {
$_filepath = $_template_dir . $resource_name;
if (file_exists($_filepath))
return true;
}
if (file_exists($resource_name)) return true;
// no tpl file found
return false;
{
// create template object
$tpl = new $smarty->template_class($resource_name, $smarty);
// check if it does exists
return $tpl->isExisting();
}
?>