ftimme
2012-05-30 2cb1563f63386b35a69e460051aa9b4a2851d104
server/lib/classes/tpl.inc.php
@@ -360,6 +360,8 @@
         * @access public
         */
        function setDbLoop ($loopname, $result, $db_type='MYSQL') {
      /*
            $db_type = strtoupper($db_type);
            if (!in_array($db_type, $this->allowed_loop_dbs)) {
                vlibTemplateError::raiseError('VT_WARNING_INVALID_LOOP_DB',WARNING, $db_type);
@@ -485,6 +487,7 @@
            }
            $this->setLoop($loopname, $loop_arr);
            return true;
         */
        }
        /**
@@ -964,7 +967,9 @@
            // check fullpath first..
            $fullpath = $filepath.'/'.$filename;
            if (is_file($fullpath)) return $fullpath;
            if (is_file($fullpath)) {
            return $fullpath;
         }
            // ..then check for relative path for current directory..
            if (!empty($this->_currentincludedir)) {
@@ -989,17 +994,23 @@
            // ..then check path from TEMPLATE_DIR..
            if (!empty($this->OPTIONS['TEMPLATE_DIR'])) {
                $fullpath = realpath($this->OPTIONS['TEMPLATE_DIR'].'/'.$filepath.'/'.$filename);
                if (is_file($fullpath)) return $fullpath;
                if (is_file($fullpath)) {
               return $fullpath;
            }
            }
            // ..then check relative path from executing php script..
            $fullpath = realpath($filepath.'/'.$filename);
            if (is_file($fullpath)) return $fullpath;
            if (is_file($fullpath)) {
            return $fullpath;
         }
            // ..then check path from template file.
            if (!empty($this->VLIBTEMPLATE_ROOT)) {
                $fullpath = realpath($this->VLIBTEMPLATE_ROOT.'/'.$filepath.'/'.$filename);
                if (is_file($fullpath)) return $fullpath;
                if (is_file($fullpath)) {
               return $fullpath;
            }
            }
            return false; // uh oh, file not found
@@ -1193,7 +1204,7 @@
            switch (strtolower($this->OPTIONS['UNKNOWNS'])) {
                case 'comment':
                    $comment = addcslashes('<!-- unknown variable '.ereg_replace('<!--|-->', '', $wholetag).'//-->', '"');
                    $comment = addcslashes('<!-- unknown variable '.preg_replace('/<!--|-->/', '', $wholetag).'//-->', '"');
                    $retstr .= ' else { print("'.$comment.'"); $this->_setUnknown("'.$varname.'"); }';
                    return $retstr;
                break;
@@ -1336,10 +1347,10 @@
         * @return boolean true/false
         */
        function _intParse () {
            $mqrt = get_magic_quotes_runtime();
            set_magic_quotes_runtime(0);
            //$mqrt = get_magic_quotes_runtime();
            //set_magic_quotes_runtime(0);
            $this->_tmplfilep = '?>'.$this->_getData($this->_tmplfilename).'<?php return true;';
            set_magic_quotes_runtime($mqrt);
            //set_magic_quotes_runtime($mqrt);
            return true;
        }