- removed all internal calls of Smarty::instance()

- fixed code in double quoted strings
This commit is contained in:
Uwe.Tews
2009-08-08 17:28:23 +00:00
parent fc9b7eef10
commit d2d8c8925b
111 changed files with 952 additions and 1313 deletions
+15 -19
View File
@@ -11,29 +11,25 @@
*/
/**
* Smarty class Template_Exists
*
* Checks if a template resource exists
*/
class Smarty_Method_Template_Exists extends Smarty_Internal_Base {
/**
* Check if a template resource exists
*
* @param string $resource_name template name
* @return boolean status
*/
public function execute($resource_name)
{
foreach((array)$this->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;
/**
* Check if a template resource exists
*
* @param string $resource_name template name
* @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;
}
?>