| | |
| | | */ |
| | | public function newTemplate($tmplfile) |
| | | { |
| | | if (!$tfile = $this->_fileSearch($tmplfile)) vlibTemplateError::raiseError('VT_ERROR_NOFILE',KILL,$tmplfile); |
| | | if (!$tfile = $this->_fileSearch($tmplfile)){ |
| | | vlibTemplateError::raiseError('VT_ERROR_NOFILE', KILL, $tmplfile); |
| | | } |
| | | |
| | | //* make sure that any parsing vars are cleared for the new template |
| | | $this->_tmplfile = null; |
| | |
| | | $this->_totalparsetime = null; |
| | | |
| | | //* reset debug module |
| | | if ($this->_debug) $this->_debugReset(); |
| | | |
| | | if ($this->_debug){ |
| | | $this->_debugReset(); |
| | | } |
| | | $this->_tmplfilename = $tfile; |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public function getVars() |
| | | { |
| | | if (empty($this->_vars)) return false; |
| | | return $this->_vars; |
| | | return empty($this->_vars) ? false : $this->_vars; |
| | | } |
| | | |
| | | /** |
| | |
| | | public function getVar($var) |
| | | { |
| | | if ($this->OPTIONS['CASELESS']) $var = strtolower($var); |
| | | if (empty($var) || !isset($this->_vars[$var])) return false; |
| | | return $this->_vars[$var]; |
| | | return (empty($var) || !isset($this->_vars[$var])) ? false : $this->_vars[$var]; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | $loop_arr = array(); |
| | | // TODO: Are all these necessary as were onyl using mysql and possible postgres ? - pedro |
| | | switch ($db_type) { |
| | | |
| | | case 'MYSQL': |
| | |
| | | if ($this->_includedepth > $this->OPTIONS['MAX_INCLUDES'] || $tmplfile == false) { |
| | | return; |
| | | } else { |
| | | if ($this->_debug) array_push ($this->_debugIncludedfiles, $tmplfile); |
| | | if ($this->_debug){ |
| | | array_push ($this->_debugIncludedfiles, $tmplfile); |
| | | } |
| | | if ($do_eval) { |
| | | array_push($this->_currentincludedir, dirname($tmplfile)); |
| | | $this->_includedepth++; |