templateDir = $templateDir; } /** * Resource function to get a template. * @param $template string * @param $templateSource string reference * @param $smarty Smarty * @return boolean */ function fetch($template, &$templateSource, $smarty) { $templateSource = file_get_contents($this->_getFilename($template)); return ($templateSource !== false); } /** * Get the timestamp for the specified template. * @param $template string Filename * @param $templateTimestamp int reference * @return boolean */ function fetchTimestamp($template, &$templateTimestamp, $smarty) { $filename = $this->_getFilename($template); if (!file_exists($filename)) return false; $templateTimestamp = filemtime($filename); return true; } /** * Get the complete template filename including path. * @param $template Template filename. * @return string */ protected function _getFilename($template) { $filePath = $this->templateDir . DIRECTORY_SEPARATOR . $template; HookRegistry::call('TemplateResource::getFilename', array(&$filePath, $template)); return $filePath; } /** * Get secure status * @return boolean */ function getSecure() { return true; } /** * Get trusted status */ function getTrusted() { // From : // "This function is used for only for PHP script components // requested by {include_php} tag or {insert} tag with the src // attribute. However, it should still be defined even for // template resources." // a.k.a. OK not to implement. } } ?>