Ticket #989: Smarty.class.diff

File Smarty.class.diff, 4.9 KB (added by INETvisio, 9 years ago)
  • includes/external/smarty/smarty_2/Smarty.class.php

     includes/external/smarty/smarty_2/Smarty.class.php | 48 +++++++++++++++-------
     1 file changed, 33 insertions(+), 15 deletions(-)
    
    diff --git a/includes/external/smarty/smarty_2/Smarty.class.php b/includes/external/smarty/smarty_2/Smarty.class.php
    index 3f6a518..c2de169 100644
    a b  
    2727 * @author Monte Ohrt <monte at ohrt dot com>
    2828 * @author Andrei Zmievski <andrei@php.net>
    2929 * @package Smarty
    30  * @version 2.6.28
     30 * @version 2.6.29
     31 * Modified for xt:Commerce v3.0.4 SP2.1 (c)2009 by Hetfield - www.MerZ-IT-SerVice.de
    3132 */
    3233
    3334/* $Id: Smarty.class.php 4660 2012-09-24 20:05:15Z uwe.tews@googlemail.com $ */
     
    3536/**
    3637 * define smarty plugindir in template
    3738 */
     39define('MY_TEMPLATE', DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE);
    3840define('MY_TEMPLATE_PLUGINS', DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/smarty');
     41define('MY_TEMPLATE_LANG', DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/lang');
    3942define('MY_SHOP_PLUGINS', DIR_FS_EXTERNAL.'smarty/plugins');
     43define('MY_MASTER_TEMPLATE', DIR_FS_CATALOG.'templates/xtc5');
     44define('MY_MASTER_TEMPLATE_PLUGINS', DIR_FS_CATALOG.'templates/xtc5/smarty');
     45define('MY_MASTER_TEMPLATE_LANG', DIR_FS_CATALOG.'templates/xtc5/lang');
    4046
    4147/**
    4248 * DIR_SEP isn't used anymore, but third party apps might
    class Smarty  
    7884     *
    7985     * @var string
    8086     */
    81     var $template_dir    =  'templates';
     87    var $template_dir    =  array('templates', MY_TEMPLATE, MY_MASTER_TEMPLATE);
    8288
    8389    /**
    8490     * The directory where compiled templates are located.
    class Smarty  
    9298     *
    9399     * @var string
    94100     */
    95     var $config_dir      =  'lang';
     101    var $config_dir      =  array('lang', MY_TEMPLATE_LANG, MY_MASTER_TEMPLATE_LANG);
    96102
    97103    /**
    98104     * An array of directories searched for plugins.
    99105     *
    100106     * @var array
    101107     */
    102     var $plugins_dir     =  array('plugins', MY_TEMPLATE_PLUGINS, MY_SHOP_PLUGINS);
     108    //var $plugins_dir     =  array('plugins');
     109    var $plugins_dir     =  array('plugins', MY_MASTER_TEMPLATE_PLUGINS, MY_TEMPLATE_PLUGINS, MY_SHOP_PLUGINS);
    103110
    104111    /**
    105112     * If debugging is enabled, a debug console window will display
    class Smarty  
    471478     *
    472479     * @var string
    473480     */
    474     var $_version              = '2.6.28';
     481    var $_version              = '2.6.29';
    475482
    476483    /**
    477484     * current template inclusion depth
    class Smarty  
    572579    /**
    573580     * The class constructor.
    574581     */
    575     function Smarty()
     582    function __construct()
    576583    {
     584        $this->compile_dir   = DIR_FS_CATALOG . $this->compile_dir;
     585        $this->config_dir[0] = DIR_FS_CATALOG . $this->config_dir[0];
     586        if (defined('DIR_FS_LANGUAGES')) {
     587            $this->config_dir[0] = dirname(DIR_FS_LANGUAGES . '.htaccess');
     588        } elseif (defined('DIR_WS_LANGUAGES')) {
     589            $this->config_dir[0] = dirname(DIR_WS_LANGUAGES . '.htaccess');
     590        }
     591        $this->template_dir[0] = DIR_FS_CATALOG . $this->template_dir[0];
     592        $this->cache_dir       = DIR_FS_CATALOG . $this->cache_dir;
     593        $this->plugins_dir[0]  = dirname(__FILE__) . '/' . $this->plugins_dir[0];
     594
    577595      $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME']
    578596                    : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
    579597    }
    class Smarty  
    13121330            return;
    13131331        } else {
    13141332            error_reporting($_smarty_old_error_level);
    1315             if (isset($_smarty_results)) { return $_smarty_results; }
     1333            // BOF - Tomcraft - 2009-05-26 - Modified for xt:Commerce v3.0.4 SP2.1
     1334            //if (isset($_smarty_results)) { return $_smarty_results; }
     1335            if (file_exists('includes/local/configure.php')) {
     1336                if (isset($_smarty_results)) { return '<!-- Begin: '.$resource_name.' -->'.$_smarty_results.'<!-- End: '.$resource_name.' -->'; }
     1337            } else {
     1338                if (isset($_smarty_results)) { return $_smarty_results; }
     1339            }
     1340            // EOF - Tomcraft - 2009-05-26 - Modified for xt:Commerce v3.0.4 SP2.1
    13161341        }
    13171342    }
    13181343
    class Smarty  
    14621487        }
    14631488
    14641489
     1490        /** @var Smarty_Compiler $smarty_compiler */
    14651491        $smarty_compiler = new $this->compiler_class;
    14661492
    14671493        $smarty_compiler->template_dir      = $this->template_dir;
    class Smarty  
    15471573        else
    15481574            $_params['resource_base_path'] = $this->template_dir;
    15491575
    1550 #mod
    1551         $_params['resource_base_path'] = array(
    1552             $this->template_dir,
    1553             $this->template_dir . DIRECTORY_SEPARATOR . CURRENT_TEMPLATE
    1554         );
    1555 #mod
    1556 
    15571576        if ($this->_parse_resource_name($_params)) {
    15581577            $_resource_type = $_params['resource_type'];
    15591578            $_resource_name = $_params['resource_name'];
    class Smarty  
    19751994
    19761995/* vim: set expandtab: */
    19771996
    1978 ?>