Marius Cramer
2013-11-14 b1a6a5a3991cec5cd08873b01376e45d0b247f18
server/lib/classes/tpl.inc.php
@@ -14,8 +14,8 @@
if (!defined('vlibTemplateClassLoaded')) {
    define('vlibTemplateClassLoaded', 1);
      include_once ($conf['classpath'].'/tpl_error.inc.php');
      include_once ($conf['classpath'].'/tpl_ini.inc.php');
   include_once $conf['classpath'].'/tpl_error.inc.php';
   include_once $conf['classpath'].'/tpl_ini.inc.php';
    /**
     * vlibTemplate is a class used to seperate PHP and HTML.
@@ -28,6 +28,7 @@
     * @access public
     * @see vlibTemplate.html
     */
    class tpl {
@@ -158,11 +159,19 @@
        var $_debug = null;
        var $_cache = null;
        
        /** array which holds the dynamic Includes */
        var $_dyninclude = array();
    /*-----------------------------------------------------------------------------\
    |                           public functions                                   |
    \-----------------------------------------------------------------------------*/
      
      
        /**
@@ -194,6 +203,7 @@
            $this->_tmplfilename = $tfile;
            return true;
        }
        /**
         * FUNCTION: setVar
@@ -228,6 +238,10 @@
            return true;
        }
        
        /**
         * FUNCTION: setInclude
         *
@@ -240,7 +254,6 @@
         * @return boolean true/false
         * @access public
         */
        function setInclude($k, $v = null) {
           if(is_array($k)) {
            foreach($k as $key => $val) {
@@ -252,6 +265,7 @@
         
         return true;
      }
        /**
         * FUNCTION: unsetVar
@@ -276,6 +290,7 @@
            return true;
        }
        /**
         * FUNCTION: getVars
         *
@@ -288,6 +303,7 @@
            if (empty($this->_vars)) return false;
            return $this->_vars;
        }
        /**
         * FUNCTION: getVar
@@ -302,6 +318,7 @@
            if (empty($var) || !isset($this->_vars[$var])) return false;
            return $this->_vars[$var];
        }
        /**
         * FUNCTION: setContextVars
@@ -326,6 +343,7 @@
            return true;
        }
        /**
         * FUNCTION: setLoop
         *
@@ -347,6 +365,7 @@
            }
            return true;
        }
        /**
         * FUNCTION: setDbLoop [** EXPERIMENTAL **]
@@ -490,6 +509,7 @@
         */
        }
        /**
         * FUNCTION: newLoop
         *
@@ -509,6 +529,7 @@
                return false;
            }
        }
        /**
         * FUNCTION: addRow
@@ -535,6 +556,7 @@
                return false;
            }
        }
        /**
         * FUNCTION: addLoop
@@ -570,6 +592,7 @@
            }
            return true;
        }
        /**
         * FUNCTION: unsetLoop
@@ -620,6 +643,7 @@
            return true;
        }
        /**
         * FUNCTION: clearVars
         *
@@ -632,6 +656,7 @@
            $this->_vars = array();
            return true;
        }
        /**
         * FUNCTION: clearLoops
@@ -648,6 +673,7 @@
            return true;
        }
        /**
         * FUNCTION: clearAll
         *
@@ -662,6 +688,7 @@
            return true;
        }
        /**
         * FUNCTION: unknownsExist
         *
@@ -672,8 +699,9 @@
         * @access public
         */
        function unknownsExist () {
            return (!empty($this->_unknowns));
         return !empty($this->_unknowns);
        }
        /**
         * FUNCTION: unknowns
@@ -685,6 +713,7 @@
        function unknowns () {
            return $this->unknownsExist();
        }
        /**
         * FUNCTION: getUnknowns
@@ -698,6 +727,7 @@
        function getUnknowns () {
            return $this->_unknowns;
        }
        /**
         * FUNCTION: setUnknowns
@@ -717,6 +747,7 @@
            }
            return false;
        }
        /**
         * FUNCTION: setPath
@@ -743,6 +774,7 @@
            }
            return true;
        }
        /**
         * FUNCTION: getParseTime
@@ -793,6 +825,7 @@
            return true;
        }
        /**
         * FUNCTION: pprint
         *
@@ -822,6 +855,7 @@
    /*-----------------------------------------------------------------------------\
    |                           private functions                                  |
    \-----------------------------------------------------------------------------*/
        /**
         * FUNCTION: vlibTemplate
@@ -863,6 +897,7 @@
            if ($this->OPTIONS['GLOBAL_CONTEXT_VARS']) $this->setContextVars();
            return true;
        }
        /** FUNCTION: _getData
         *
@@ -952,6 +987,7 @@
        }
        /**
         * FUNCTION: _fileSearch
         *
@@ -1016,6 +1052,7 @@
            return false; // uh oh, file not found
        }
        /**
         * FUNCTION: _arrayBuild
         *
@@ -1059,6 +1096,7 @@
                return true;
            }
        }
        /**
         * FUNCTION: _parseIf
@@ -1139,6 +1177,7 @@
            }
            return $retstr."); \$_".$tempvar."++) {";
        }
        /**
         * FUNCTION: _parseVar
@@ -1227,6 +1266,7 @@
                break;
            }
        }
        /**
         * FUNCTION: _parseTag
@@ -1335,6 +1375,7 @@
        }
        /**
         * FUNCTION: _intParse
         *
@@ -1353,6 +1394,7 @@
            //set_magic_quotes_runtime($mqrt);
            return true;
        }
        /**
         * FUNCTION: _parse
@@ -1393,6 +1435,7 @@
         
            return true;
        }
        /**
         * FUNCTION: _setOption
@@ -1448,6 +1491,7 @@
            return true;
        }
        /**
         * FUNCTION: _setUnknown
         *
@@ -1461,6 +1505,7 @@
            if (!in_array($var, $this->_unknowns)) array_push($this->_unknowns, $var);
        }
        /**
         * FUNCTION: _getMicrotime
         * Returns microtime as a float number
@@ -1470,8 +1515,9 @@
         */
        function _getMicrotime () {
            list($msec, $sec) = explode(" ",microtime());
            return ((float)$msec + (float)$sec);
         return (float)$msec + (float)$sec;
        }
        /**
         * FUNCTION: _escape_hex
@@ -1497,13 +1543,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()');}
    }
    //include_once ($conf['classpath'].'/vlibTemplate/debug.php');
    include_once ($conf['classpath'].'/tpl_cache.inc.php');
   include_once $conf['classpath'].'/tpl_cache.inc.php';
} // << end if(!defined())..
?>