2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Iris Studios Shared Object Framework [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
14 * File System Template System
20 if (!$this->is_loaded('template'))
22 $this->locate('template');
25 $OBJECT = 'File-Based Template System';
26 $CLASS = 'FS_Template';
30 * File System Template System
32 * This framework merely replaces the template loading functions with
33 * file-system based ones.
35 * @author Iris Studios, Inc.
36 * @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc.
41 class FS_Template
extends DB_Template
44 * The path, from the path of the application, where templates are stored
46 * @see Shared_Object_Framework::$apppath, _load()
48 var $templatedir = '';
51 * The extension all the template files have
55 var $extension = 'tpl';
58 * Takes an array of template names, loads them, and then stores
59 * a parsed version for optimum speed.
61 * @param array List of template names to be cached
63 function cache($namearray)
65 if (sizeof($this->cache
) > 0)
67 trigger_error('You cannot cache templates more than once per initialization', E_USER_WARNING
);
71 foreach ($namearray AS $name)
73 $template = $this->_load($name);
74 $template = $this->_parse($template);
75 $this->cache
["$name"] = $template;
76 $this->usage["$name"] = 0;
82 * Loads a template from the file system from the specified $templatedir
83 * with the file extension $extension
85 * @param str The name of the template call
91 $path = $_isso->apppath
. $this->templatedir
. $name . '.' . $this->extension
;
94 if (($template = @file_get_contents($path)) !== false)
100 trigger_error("Could not load the template '$path'", E_USER_ERROR);
106 trigger_error("Could not load the template
'$path'", E_USER_ERROR);
112 /*=====================================================================*\
113 || ###################################################################
116 || ###################################################################
117 \*=====================================================================*/