is_loaded('template')) { $this->locate('template'); } $OBJECT = 'File-Based Template System'; $CLASS = 'FS_Template'; $OBJ = 'template'; /** * File System Template System * * This framework merely replaces the template loading functions with * file-system based ones. * * @author Iris Studios, Inc. * @copyright Copyright ©2003 - [#]year[#], Iris Studios, Inc. * @version $Revision$ * */ class FS_Template extends DB_Template { /** * Global environment variables * * @var templatedir Directory name that houses the templates * @var extension The extension used on template files */ var $templatedir = ''; var $extension = 'tpl'; /** * Takes an array of template names, loads them, and then stores * a parsed version for optimum speed. * * @var array List of template names to be cached */ function cache($namearray) { if (sizeof($this->cache) > 0) { trigger_error('You cannot cache templates more than once per initialization', ERR_ALERT); } else { foreach ($namearray AS $name) { $template = $this->_load($name); $template = $this->_parse($template); $this->cache["$name"] = $template; $this->usage["$name"] = 0; } } } /** * Loads a template from the file system from the specified $templatedir * with the file extension $extension * * @var name The name of the template call */ function _load($name) { global $_isso; $path = $_isso->apppath . $this->templatedir . $name . '.' . $this->extension; if (is_file($path)) { if (($template = @file_get_contents($path)) !== false) { return $template; } else { trigger_error("Could not load the template '$path'", ERR_FATAL); exit; } } else { trigger_error("Could not load the template '$path'", ERR_FATAL); exit; } } } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>