| | |
| | | * @see vlibTemplate.html |
| | | */ |
| | | |
| | | |
| | | /* vim: set expandtab tabstop=4 shiftwidth=4: */ |
| | | // +----------------------------------------------------------------------+ |
| | | // | PHP version 4.0 | |
| | |
| | | if (!defined('vlibTemplateClassLoaded')) { |
| | | |
| | | define('vlibTemplateClassLoaded', 1); |
| | | include_once (ISPC_CLASS_PATH.'/tpl_error.inc.php'); |
| | | include_once (ISPC_CLASS_PATH.'/tpl_ini.inc.php'); |
| | | include_once ISPC_CLASS_PATH.'/tpl_error.inc.php'; |
| | | include_once ISPC_CLASS_PATH.'/tpl_ini.inc.php'; |
| | | |
| | | class tpl{ |
| | | |
| | |
| | | 'hexentity' => array('open' => '$this->_escape_hex(' ,'close'=> ', true)') |
| | | ); |
| | | |
| | | |
| | | |
| | | /** open and close tags used for formatting */ |
| | | private $FORMAT_TAGS = array( |
| | | 'strtoupper' => array('open' => 'strtoupper(', 'close'=> ')'), |
| | |
| | | /** operators allowed when using extended TMPL_IF syntax */ |
| | | private $allowed_if_ops = array('==','!=','<>','<','>','<=','>='); |
| | | |
| | | |
| | | |
| | | /** dbs allowed by vlibTemplate::setDbLoop(). */ |
| | | private $allowed_loop_dbs = array('MYSQL','POSTGRESQL','INFORMIX','INTERBASE','INGRES', |
| | | 'MSSQL','MSQL','OCI8','ORACLE','OVRIMOS','SYBASE'); |
| | | |
| | | |
| | | |
| | | /** root directory of vlibTemplate automagically filled in */ |
| | | private $VLIBTEMPLATE_ROOT = null; |
| | | |
| | | |
| | | |
| | | /** contains current directory used when doing recursive include */ |
| | | private $_currentincludedir = array(); |
| | | |
| | | |
| | | |
| | | /** current depth of includes */ |
| | | private $_includedepth = 0; |
| | | |
| | | |
| | | |
| | | /** full path to tmpl file */ |
| | | private $_tmplfilename = null; |
| | | |
| | | |
| | | |
| | | /** file data before it's parsed */ |
| | | private $_tmplfile = null; |
| | | |
| | | |
| | | |
| | | /** parsed version of file, ready for eval()ing */ |
| | | private $_tmplfilep = null; |
| | | |
| | | |
| | | |
| | | /** eval()ed version ready for printing or whatever */ |
| | | private $_tmploutput = null; |
| | | |
| | | |
| | | |
| | | /** array for variables to be kept */ |
| | | private $_vars = array(); |
| | | |
| | | |
| | | |
| | | /** array where loop variables are kept */ |
| | | private $_arrvars = array(); |
| | |
| | | /** array which holds the current namespace during parse */ |
| | | private $_namespace = array(); |
| | | |
| | | |
| | | |
| | | /** variable is set to true once the template is parsed, to save re-parsing everything */ |
| | | private $_parsed = false; |
| | | |
| | | |
| | | |
| | | /** array holds all unknowns vars */ |
| | | private $_unknowns = array(); |
| | | |
| | | |
| | | |
| | | /** microtime when template parsing began */ |
| | | private $_firstparsetime = null; |
| | | |
| | | |
| | | |
| | | /** total time taken to parse template */ |
| | | private $_totalparsetime = null; |
| | | |
| | | |
| | | |
| | | /** name of current loop being passed in */ |
| | | private $_currloopname = null; |
| | | |
| | | |
| | | |
| | | /** rows with the above loop */ |
| | | private $_currloop = array(); |
| | | |
| | | |
| | | |
| | | /** define vars to avoid warnings */ |
| | | private $_debug = null; |
| | | private $_cache = null; |
| | | |
| | | |
| | | |
| | | /** array which holds the dynamic Includes */ |
| | | private $_dyninclude = array(); |
| | |
| | | /*-----------------------------------------------------------------------------\ |
| | | | public functions | |
| | | \-----------------------------------------------------------------------------*/ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Sets dynamic includes to be used by the template |
| | |
| | | */ |
| | | public function unknownsExist() |
| | | { |
| | | return (!empty($this->_unknowns)); |
| | | return !empty($this->_unknowns); |
| | | } |
| | | |
| | | /** |
| | |
| | | private function _getMicrotime() |
| | | { |
| | | list($msec, $sec) = explode(' ',microtime()); |
| | | return ((float)$msec + (float)$sec); |
| | | return (float)$msec + (float)$sec; |
| | | } |
| | | |
| | | /** |
| | |
| | | vlibTemplate if the user is quickly bypassing the vlibTemplateCache class. |
| | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| | | function clearCache() {vlibTemplateError::raiseError('VT_WARNING_NOT_CACHE_OBJ', WARNING, 'clearCache()');} |
| | | |
| | | function recache() {vlibTemplateError::raiseError('VT_WARNING_NOT_CACHE_OBJ', WARNING, 'recache()');} |
| | | |
| | | function setCacheLifeTime() {vlibTemplateError::raiseError('VT_WARNING_NOT_CACHE_OBJ', WARNING, 'setCacheLifeTime()');} |
| | | |
| | | function setCacheExtension() {vlibTemplateError::raiseError('VT_WARNING_NOT_CACHE_OBJ', WARNING, 'setCacheExtension()');} |
| | | |
| | | } // << end class Def |
| | | |
| | | //include_once (ISPC_CLASS_PATH.'/vlibTemplate/debug.php'); |
| | | include_once (ISPC_CLASS_PATH.'/tpl_cache.inc.php'); |
| | | include_once ISPC_CLASS_PATH.'/tpl_cache.inc.php'; |
| | | |
| | | } // << end if(!defined()).. |
| | | ?> |