Marius Cramer
2013-11-14 7fe908c50c8dbc5cc05f571dbe11d66141caacd4
interface/lib/classes/tpl.inc.php
@@ -11,6 +11,7 @@
* @see vlibTemplate.html
*/
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0                                                      |
@@ -26,8 +27,8 @@
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{
    
@@ -68,6 +69,8 @@
                'hexentity' => array('open' => '$this->_escape_hex('  ,'close'=> ', true)')
                );
    
        /** open and close tags used for formatting */
        private $FORMAT_TAGS = array(
                'strtoupper' => array('open' => 'strtoupper(',          'close'=> ')'),
@@ -83,33 +86,53 @@
        /** 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();
@@ -117,27 +140,43 @@
        /** 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();
@@ -145,6 +184,9 @@
        /*-----------------------------------------------------------------------------\
        |                           public functions                                   |
        \-----------------------------------------------------------------------------*/
          
      
        /**
@@ -206,6 +248,8 @@
            }
            return true;
        }
        
        /**
         * Sets dynamic includes to be used by the template
@@ -612,7 +656,7 @@
         */
        public function unknownsExist()
        {
            return (!empty($this->_unknowns));
         return !empty($this->_unknowns);
        }
        /**
@@ -1346,7 +1390,7 @@
        private function _getMicrotime() 
        {
            list($msec, $sec) = explode(' ',microtime());
            return ((float)$msec + (float)$sec);
         return (float)$msec + (float)$sec;
        }
        /**
@@ -1371,13 +1415,17 @@
    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())..
?>