Changeset 3894 for trunk/gui


Ignore:
Timestamp:
09/17/11 12:24:33 (8 months ago)
Author:
ShadowJumper
Message:

*[GUI] Updated Smarty to version 3.0.9

Location:
trunk/gui/include/Smarty
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/include/Smarty/Smarty.class.php

    r3850 r3894  
    44 * Project:     Smarty: the PHP compiling template engine 
    55 * File:        Smarty.class.php 
    6  * SVN:         $Id: Smarty.class.php 4074 2011-04-22 02:19:14Z uwe.tews@googlemail.com $ 
     6 * SVN:         $Id: Smarty.class.php 4225 2011-07-26 18:09:31Z uwe.tews@googlemail.com $ 
    77 * 
    88 * This library is free software; you can redistribute it and/or 
     
    2929 * @author Uwe Tews 
    3030 * @package Smarty 
    31  * @version 3.0.8 
     31 * @version 3.0.9 
    3232 */ 
    3333 
     
    8888        */ 
    8989    // smarty version 
    90     const SMARTY_VERSION = 'Smarty-3.0.8'; 
     90    const SMARTY_VERSION = 'Smarty-3.0.9'; 
    9191        //define variable scopes 
    9292        const SCOPE_LOCAL = 0; 
     
    237237    // generate deprecated function call notices? 
    238238    public $deprecation_notices = true; 
     239    // internal flag for getTags() 
     240    public $get_used_tags = false; 
    239241    // Smarty 2 BC 
    240242    public $_version = self::SMARTY_VERSION; 
     
    716718 
    717719    /** 
     720    * Return array of tag/attributes of all tags used by an template 
     721    * 
     722    * @param object $templae template object 
     723    * @return array of tag/attributes 
     724    */ 
     725    public function getTags(Smarty_Internal_Template $template) 
     726    { 
     727        return Smarty_Internal_Utility::getTags($template); 
     728    } 
     729 
     730    /** 
    718731    * clean up properties on cloned object 
    719732     */ 
     
    725738        $this->tpl_vars = array(); 
    726739        // clear objects for external methods 
    727         unset($this->register); 
    728         unset($this->filter); 
     740        unset($this->Register); 
     741        unset($this->Filter); 
    729742        } 
    730743 
  • trunk/gui/include/Smarty/plugins/function.fetch.php

    r3753 r3894  
    2929 
    3030    $content = ''; 
    31     if (isset($template->security_policy) && !preg_match('!^(http|ftp)://!i', $params['file'])) { 
    32         if(!$template->security_policy->isTrustedResourceDir($params['file'])) { 
     31    if (isset($template->smarty->security_policy) && !preg_match('!^(http|ftp)://!i', $params['file'])) { 
     32        if(!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { 
    3333            return; 
    3434        } 
  • trunk/gui/include/Smarty/plugins/function.html_image.php

    r3753 r3894  
    107107            }  
    108108        }  
    109         if (isset($template->security_policy)) { 
    110             if (!$template->security_policy->isTrustedResourceDir($_image_path)) { 
     109        if (isset($template->smarty->security_policy)) { 
     110            if (!$template->smarty->security_policy->isTrustedResourceDir($_image_path)) { 
    111111                return; 
    112112            }  
  • trunk/gui/include/Smarty/sysplugins/smarty_internal_compile_include.php

    r3850 r3894  
    33/** 
    44 * Smarty Internal Plugin Compile Include 
    5  *  
     5 * 
    66 * Compiles the {include} tag 
    7  *  
     7 * 
    88 * @package Smarty 
    99 * @subpackage Compiler 
    10  * @author Uwe Tews  
     10 * @author Uwe Tews 
    1111 */ 
    1212 
     
    2121        public $shorttag_order = array('file'); 
    2222    public $option_flags = array('nocache','inline','caching'); 
    23     public $optional_attributes = array('_any');  
     23    public $optional_attributes = array('_any'); 
    2424 
    2525    /** 
    2626     * Compiles code for the {include} tag 
    27      *  
     27     * 
    2828     * @param array $args array with attributes from parser 
    2929     * @param object $compiler compiler object 
     
    3434        $this->compiler = $compiler; 
    3535        // check and get attributes 
    36         $_attr = $this->_get_attributes($args);  
     36        $_attr = $this->_get_attributes($args); 
    3737        // save posible attributes 
    3838        $include_file = $_attr['file']; 
    3939        $has_compiled_template = false; 
    40         if ($compiler->smarty->merge_compiled_includes || $_attr['inline'] === true) { 
     40 
     41        if (isset($_attr['assign'])) { 
     42            // output will be stored in a smarty variable instead of beind displayed 
     43            $_assign = $_attr['assign']; 
     44        } 
     45 
     46        $_parent_scope = Smarty::SCOPE_LOCAL; 
     47        if (isset($_attr['scope'])) { 
     48            $_attr['scope'] = trim($_attr['scope'], "'\""); 
     49            if ($_attr['scope'] == 'parent') { 
     50                $_parent_scope = Smarty::SCOPE_PARENT; 
     51            } elseif ($_attr['scope'] == 'root') { 
     52                $_parent_scope = Smarty::SCOPE_ROOT; 
     53            } elseif ($_attr['scope'] == 'global') { 
     54                $_parent_scope = Smarty::SCOPE_GLOBAL; 
     55            } 
     56        } 
     57        $_caching = 'null'; 
     58        if ($this->compiler->nocache || $this->compiler->tag_nocache) { 
     59            $_caching = Smarty::CACHING_OFF; 
     60        } 
     61        // default for included templates 
     62        if ($compiler->template->caching && !$this->compiler->nocache && !$this->compiler->tag_nocache) { 
     63            $_caching = self::CACHING_NOCACHE_CODE; 
     64        } 
     65        /* 
     66        * if the {include} tag provides individual parameter for caching 
     67        * it will not be included into the common cache file and treated like 
     68        * a nocache section 
     69        */ 
     70        if (isset($_attr['cache_lifetime'])) { 
     71            $_cache_lifetime = $_attr['cache_lifetime']; 
     72            $this->compiler->tag_nocache = true; 
     73            $_caching = Smarty::CACHING_LIFETIME_CURRENT; 
     74        } else { 
     75            $_cache_lifetime = 'null'; 
     76        } 
     77        if (isset($_attr['cache_id'])) { 
     78            $_cache_id = $_attr['cache_id']; 
     79            $this->compiler->tag_nocache = true; 
     80            $_caching = Smarty::CACHING_LIFETIME_CURRENT; 
     81        } else { 
     82            $_cache_id = '$_smarty_tpl->cache_id'; 
     83        } 
     84        if (isset($_attr['compile_id'])) { 
     85            $_compile_id = $_attr['compile_id']; 
     86        } else { 
     87            $_compile_id = '$_smarty_tpl->compile_id'; 
     88        } 
     89        if ($_attr['caching'] === true) { 
     90            $_caching = Smarty::CACHING_LIFETIME_CURRENT; 
     91        } 
     92        if ($_attr['nocache'] === true) { 
     93            $this->compiler->tag_nocache = true; 
     94            $_caching = Smarty::CACHING_OFF; 
     95        } 
     96 
     97 
     98        if (($compiler->smarty->merge_compiled_includes || $_attr['inline'] === true)  && !($compiler->template->caching && ($this->compiler->tag_nocache || $this->compiler->nocache)) && $_caching != Smarty::CACHING_LIFETIME_CURRENT) { 
    4199            // check if compiled code can be merged (contains no variable part) 
    42100            if (!$compiler->has_variable_string && (substr_count($include_file, '"') == 2 or substr_count($include_file, "'") == 2) and substr_count($include_file, '(') == 0) { 
     
    50108                        // needs code for cached page but no cache file 
    51109                        $tpl->caching = self::CACHING_NOCACHE_CODE; 
    52                     }  
     110                    } 
    53111//                    if ($this->compiler->template->mustCompile) { 
    54112                        // make sure whole chain gest compiled 
    55113                        $tpl->mustCompile = true; 
    56 //                    }  
     114//                    } 
    57115                    if ($tpl->resource_object->usesCompiler && $tpl->isExisting()) { 
    58116                        // get compiled code 
    59                         $compiled_tpl = $tpl->getCompiledTemplate();  
     117                        $compiled_tpl = $tpl->getCompiledTemplate(); 
    60118                        // merge compiled code for {function} tags 
    61                         $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $tpl->properties['function']);  
     119                        $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $tpl->properties['function']); 
    62120                        // merge filedependency by evaluating header code 
    63121                        preg_match_all("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", $compiled_tpl, $result); 
     
    67125                        eval($result[2][0]); 
    68126                        $compiler->template->properties['nocache_hash'] = $saved_nocache_hash; 
    69                         $compiler->template->has_nocache_code = $saved_has_nocache_code;  
     127                        $compiler->template->has_nocache_code = $saved_has_nocache_code; 
    70128                        // remove header code 
    71129                        $compiled_tpl = preg_replace("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", '', $compiled_tpl); 
     
    74132                            $compiled_tpl = preg_replace("/{$tpl->properties['nocache_hash']}/", $compiler->template->properties['nocache_hash'], $compiled_tpl); 
    75133                            $compiler->template->has_nocache_code = true; 
    76                         }  
     134                        } 
    77135                        $has_compiled_template = true; 
    78                     }  
    79                 }  
    80             }  
    81         }  
     136                    } 
     137                } 
     138            } 
     139        } 
    82140 
    83         if (isset($_attr['assign'])) { 
    84             // output will be stored in a smarty variable instead of beind displayed 
    85             $_assign = $_attr['assign']; 
    86         }  
    87  
    88         $_parent_scope = Smarty::SCOPE_LOCAL; 
    89         if (isset($_attr['scope'])) { 
    90             $_attr['scope'] = trim($_attr['scope'], "'\""); 
    91             if ($_attr['scope'] == 'parent') { 
    92                 $_parent_scope = Smarty::SCOPE_PARENT; 
    93             } elseif ($_attr['scope'] == 'root') { 
    94                 $_parent_scope = Smarty::SCOPE_ROOT; 
    95             } elseif ($_attr['scope'] == 'global') { 
    96                 $_parent_scope = Smarty::SCOPE_GLOBAL; 
    97             }  
    98         }  
    99         $_caching = 'null'; 
    100         if ($this->compiler->nocache || $this->compiler->tag_nocache) { 
    101             $_caching = Smarty::CACHING_OFF; 
    102         }  
    103         // default for included templates 
    104         if ($compiler->template->caching && !$this->compiler->nocache && !$this->compiler->tag_nocache) { 
    105             $_caching = self::CACHING_NOCACHE_CODE; 
    106         }  
    107         /* 
    108         * if the {include} tag provides individual parameter for caching 
    109         * it will not be included into the common cache file and treated like 
    110         * a nocache section 
    111         */ 
    112         if (isset($_attr['cache_lifetime'])) { 
    113             $_cache_lifetime = $_attr['cache_lifetime']; 
    114             $this->compiler->tag_nocache = true; 
    115             $_caching = Smarty::CACHING_LIFETIME_CURRENT; 
    116         } else { 
    117             $_cache_lifetime = 'null'; 
    118         }  
    119         if (isset($_attr['cache_id'])) { 
    120             $_cache_id = $_attr['cache_id']; 
    121             $this->compiler->tag_nocache = true; 
    122             $_caching = Smarty::CACHING_LIFETIME_CURRENT; 
    123         } else { 
    124             $_cache_id = '$_smarty_tpl->cache_id'; 
    125         }  
    126         if (isset($_attr['compile_id'])) { 
    127             $_compile_id = $_attr['compile_id']; 
    128         } else { 
    129             $_compile_id = '$_smarty_tpl->compile_id'; 
    130         }  
    131         if ($_attr['caching'] === true) { 
    132             $_caching = Smarty::CACHING_LIFETIME_CURRENT; 
    133         }  
    134         if ($_attr['nocache'] === true) { 
    135             $this->compiler->tag_nocache = true; 
    136             $_caching = Smarty::CACHING_OFF; 
    137         }  
    138141        // create template object 
    139142        $_output = "<?php "; 
     
    141144                $_output .= "\$sha = sha1($include_file . $_cache_id . $_compile_id);\n"; 
    142145                $_output .= "if (isset(\$_smarty_tpl->smarty->template_objects[\$sha])) {\n"; 
    143                 $_output .= "\$_template = \$_smarty_tpl->smarty->template_objects[\$sha]; \$_template->caching = $_caching; \$_template->cache_lifetime =  $_cache_lifetime;\n";  
     146                $_output .= "\$_template = \$_smarty_tpl->smarty->template_objects[\$sha]; \$_template->parent = \$_smarty_tpl; \$_template->caching = $_caching; \$_template->cache_lifetime =  $_cache_lifetime;\n"; 
    144147                $_output .= "} else {\n"; 
    145148        } 
     
    147150        if ($_caching != 'null' && $_caching != Smarty::CACHING_OFF) { 
    148151                $_output .= "}\n"; 
    149         }  
     152        } 
    150153        // delete {include} standard attributes 
    151         unset($_attr['file'], $_attr['assign'], $_attr['cache_id'], $_attr['compile_id'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline']);  
     154        unset($_attr['file'], $_attr['assign'], $_attr['cache_id'], $_attr['compile_id'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline']); 
    152155        // remaining attributes must be assigned as smarty variable 
    153156        if (!empty($_attr)) { 
     
    156159                foreach ($_attr as $_key => $_value) { 
    157160                    $_output .= "\$_template->assign('$_key',$_value);"; 
    158                 }  
     161                } 
    159162            } else { 
    160163                $this->compiler->trigger_template_error('variable passing not allowed in parent/global scope', $this->compiler->lex->taglineno); 
    161             }  
    162         }  
     164            } 
     165        } 
    163166        // was there an assign attribute 
    164167        if (isset($_assign)) { 
    165168            $_output .= "\$_smarty_tpl->assign($_assign,\$_template->getRenderedTemplate());?>"; 
    166169        } else { 
    167             if ($has_compiled_template && !($compiler->template->caching && ($this->compiler->tag_nocache || $this->compiler->nocache))) { 
     170            if ($has_compiled_template) { 
    168171                $_output .= "\$_template->properties['nocache_hash']  = '{$compiler->template->properties['nocache_hash']}';\n"; 
    169172                $_output .= "\$_tpl_stack[] = \$_smarty_tpl; \$_smarty_tpl = \$_template;?>\n"; 
     
    177180                        $_output .= "<?php \$_template->updateParentVariables($_parent_scope);?>"; 
    178181                } 
    179             }  
    180         }  
     182            } 
     183        } 
    181184        $_output .= "<?php unset(\$_template);?>"; 
    182185        return $_output; 
    183     }  
    184 }  
     186    } 
     187} 
    185188 
    186189?> 
  • trunk/gui/include/Smarty/sysplugins/smarty_internal_template.php

    r3850 r3894  
    7171    public $block_data = array(); 
    7272    public $wrapper = null; 
     73    // optional log of tag/attributes 
     74    public $used_tags = array(); 
    7375    /** 
    7476     * Create template data object 
     
    651653        foreach ($this->tpl_vars as $_key => $_variable) { 
    652654            $_variable_scope = $this->tpl_vars[$_key]->scope; 
    653             if ($scope == Smarty::SCOPE_LOCAL && $_variable_scope == Smarty::SCOPE_LOCAL) { 
     655            if (($scope == Smarty::SCOPE_LOCAL && $_variable_scope == Smarty::SCOPE_LOCAL) || $_key == 'smarty') { 
    654656                continue; 
    655657            } 
  • trunk/gui/include/Smarty/sysplugins/smarty_internal_templatecompilerbase.php

    r3850 r3894  
    2424    // current template 
    2525    public $template = null; 
    26     // optional log of tag/attributes 
    27     public $used_tags = array(); 
    2826 
    2927    /** 
     
    115113        // log tag/attributes 
    116114        if (isset($this->smarty->get_used_tags) && $this->smarty->get_used_tags) { 
    117                 $this->used_tags[] = array($tag,$args); 
     115                $this->template->used_tags[] = array($tag,$args); 
    118116        } 
    119117                // check nocache option flag 
     
    381379                $_output = str_replace("'", "\'", $content); 
    382380                $_output = str_replace("^#^", "'", $_output); 
    383                 $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>"; 
     381                $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n"; 
    384382                // make sure we include modifer plugins for nocache code 
    385383                if (isset($this->template->saved_modifier)) { 
  • trunk/gui/include/Smarty/sysplugins/smarty_internal_utility.php

    r3850 r3894  
    55 * File:        smarty_internal_utility.php 
    66 * SVN:         $Id: $ 
    7  *  
     7 * 
    88 * This library is free software; you can redistribute it and/or 
    99 * modify it under the terms of the GNU Lesser General Public 
    1010 * License as published by the Free Software Foundation; either 
    1111 * version 2.1 of the License, or (at your option) any later version. 
    12  *  
     12 * 
    1313 * This library is distributed in the hope that it will be useful, 
    1414 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1515 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
    1616 * Lesser General Public License for more details. 
    17  *  
     17 * 
    1818 * You should have received a copy of the GNU Lesser General Public 
    1919 * License along with this library; if not, write to the Free Software 
    2020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    21  *  
     21 * 
    2222 * For questions, help, comments, discussion, etc., please join the 
    2323 * Smarty mailing list. Send a blank e-mail to 
    2424 * smarty-discussion-subscribe@googlegroups.com 
    25  *  
     25 * 
    2626 * @link http://www.smarty.net/ 
    2727 * @copyright 2008 New Digital Group, Inc. 
    28  * @author Monte Ohrt <monte at ohrt dot com>  
    29  * @author Uwe Tews  
     28 * @author Monte Ohrt <monte at ohrt dot com> 
     29 * @author Uwe Tews 
    3030 * @package Smarty 
    3131 * @subpackage PluginsInternal 
     
    3939    { 
    4040        $this->smarty = $smarty; 
    41     }  
     41    } 
    4242 
    4343    /** 
    4444     * Compile all template files 
    45      *  
     45     * 
    4646     * @param string $extension file extension 
    4747     * @param bool $force_compile force all to recompile 
    48      * @param int $time_limit  
    49      * @param int $max_errors  
     48     * @param int $time_limit 
     49     * @param int $max_errors 
    5050     * @return integer number of template files recompiled 
    5151     */ 
    5252    function compileAllTemplates($extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) 
    53     {  
     53    { 
    5454        // switch off time limit 
    5555        if (function_exists('set_time_limit')) { 
    5656            @set_time_limit($time_limit); 
    57         }  
     57        } 
    5858        $this->smarty->force_compile = $force_compile; 
    5959        $_count = 0; 
    60         $_error_count = 0;  
     60        $_error_count = 0; 
    6161        // loop over array of template directories 
    6262        foreach((array)$this->smarty->template_dir as $_dir) { 
    6363            if (strpos('/\\', substr($_dir, -1)) === false) { 
    6464                $_dir .= DS; 
    65             }  
     65            } 
    6666            $_compileDirs = new RecursiveDirectoryIterator($_dir); 
    6767            $_compile = new RecursiveIteratorIterator($_compileDirs); 
     
    9292                    echo 'Error: ', $e->getMessage(), "<br><br>"; 
    9393                    $_error_count++; 
    94                 }  
     94                } 
    9595                                // free memory 
    9696                $this->smarty->template_objects = array(); 
     
    100100                    echo '<br><br>too many errors'; 
    101101                    exit(); 
    102                 }  
    103             }  
    104         }  
     102                } 
     103            } 
     104        } 
    105105        return $_count; 
    106     }  
     106    } 
    107107 
    108108    /** 
    109109     * Compile all config files 
    110      *  
     110     * 
    111111     * @param string $extension file extension 
    112112     * @param bool $force_compile force all to recompile 
    113      * @param int $time_limit  
    114      * @param int $max_errors  
     113     * @param int $time_limit 
     114     * @param int $max_errors 
    115115     * @return integer number of template files recompiled 
    116116     */ 
    117117    function compileAllConfig($extention = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null) 
    118     {  
     118    { 
    119119        // switch off time limit 
    120120        if (function_exists('set_time_limit')) { 
    121121            @set_time_limit($time_limit); 
    122         }  
     122        } 
    123123        $this->smarty->force_compile = $force_compile; 
    124124        $_count = 0; 
    125         $_error_count = 0;  
     125        $_error_count = 0; 
    126126        // loop over array of template directories 
    127127        foreach((array)$this->smarty->config_dir as $_dir) { 
    128128            if (strpos('/\\', substr($_dir, -1)) === false) { 
    129129                $_dir .= DS; 
    130             }  
     130            } 
    131131            $_compileDirs = new RecursiveDirectoryIterator($_dir); 
    132132            $_compile = new RecursiveIteratorIterator($_compileDirs); 
     
    139139                } else { 
    140140                    $_config_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file; 
    141                 }  
     141                } 
    142142                echo '<br>', $_dir, '---', $_config_file; 
    143143                flush(); 
     
    152152                        echo ' is up to date'; 
    153153                        flush(); 
    154                     }  
    155                 }  
     154                    } 
     155                } 
    156156                catch (Exception $e) { 
    157157                    echo 'Error: ', $e->getMessage(), "<br><br>"; 
    158158                    $_error_count++; 
    159                 }  
     159                } 
    160160                if ($max_errors !== null && $_error_count == $max_errors) { 
    161161                    echo '<br><br>too many errors'; 
    162162                    exit(); 
    163                 }  
    164             }  
    165         }  
     163                } 
     164            } 
     165        } 
    166166        return $_count; 
    167     }  
     167    } 
    168168 
    169169    /** 
    170170     * Delete compiled template file 
    171      *  
     171     * 
    172172     * @param string $resource_name template name 
    173173     * @param string $compile_id compile id 
     
    184184        } else { 
    185185            $_resource_part = ''; 
    186         }  
     186        } 
    187187        $_dir = $this->smarty->compile_dir; 
    188188        if ($this->smarty->use_sub_dirs && isset($_compile_id)) { 
    189189            $_dir .= $_compile_id . $_dir_sep; 
    190         }  
     190        } 
    191191        if (isset($_compile_id)) { 
    192192            $_compile_id_part = $this->smarty->compile_dir . $_compile_id . $_dir_sep; 
    193         }  
     193        } 
    194194        $_count = 0; 
    195195        $_compileDirs = new RecursiveDirectoryIterator($_dir); 
     
    201201                    // delete folder if empty 
    202202                    @rmdir($_file->getPathname()); 
    203                 }  
     203                } 
    204204            } else { 
    205205                if ((!isset($_compile_id) || (strlen((string)$_file) > strlen($_compile_id_part) && substr_compare((string)$_file, $_compile_id_part, 0, strlen($_compile_id_part)) == 0)) && 
     
    209209                        if (time() - @filemtime($_file) >= $exp_time) { 
    210210                            $_count += @unlink((string) $_file) ? 1 : 0; 
    211                         }  
     211                        } 
    212212                    } else { 
    213213                        $_count += @unlink((string) $_file) ? 1 : 0; 
    214                     }  
    215                 }  
    216             }  
    217         }  
     214                    } 
     215                } 
     216            } 
     217        } 
    218218        return $_count; 
    219     }  
     219    } 
    220220 
    221221    /** 
    222222     * Return array of tag/attributes of all tags used by an template 
    223      *  
     223     * 
    224224     * @param object $templae template object 
    225225     * @return array of tag/attributes 
    226226     */ 
    227         function getTags(Smarty_Internal_Template $template)  
     227        public static function getTags(Smarty_Internal_Template $template) 
    228228        { 
    229229                $template->smarty->get_used_tags = true; 
    230230                $template->compileTemplateSource(); 
    231                 return $template->compiler_object->used_tags; 
    232         }        
    233          
     231                return $template->used_tags; 
     232        } 
     233 
    234234    function testInstall() 
    235235    { 
     
    247247            else 
    248248                echo "$template_dir is OK.\n"; 
    249         }  
     249        } 
    250250 
    251251        echo "Testing compile directory...\n"; 
     
    269269            else 
    270270                echo "$plugin_dir is OK.\n"; 
    271         }  
     271        } 
    272272 
    273273        echo "Testing cache directory...\n"; 
     
    296296 
    297297        return true; 
    298     }  
     298    } 
    299299} 
    300300?> 
  • trunk/gui/include/Smarty/sysplugins/smarty_internal_wrapper.php

    r3753 r3894  
    55 * File:        smarty_internal_wrapper.php 
    66 * SVN:         $Id: $ 
    7  *  
     7 * 
    88 * This library is free software; you can redistribute it and/or 
    99 * modify it under the terms of the GNU Lesser General Public 
    1010 * License as published by the Free Software Foundation; either 
    1111 * version 2.1 of the License, or (at your option) any later version. 
    12  *  
     12 * 
    1313 * This library is distributed in the hope that it will be useful, 
    1414 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1515 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
    1616 * Lesser General Public License for more details. 
    17  *  
     17 * 
    1818 * You should have received a copy of the GNU Lesser General Public 
    1919 * License along with this library; if not, write to the Free Software 
    2020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    21  *  
     21 * 
    2222 * For questions, help, comments, discussion, etc., please join the 
    2323 * Smarty mailing list. Send a blank e-mail to 
    2424 * smarty-discussion-subscribe@googlegroups.com 
    25  *  
     25 * 
    2626 * @link http://www.smarty.net/ 
    2727 * @copyright 2008 New Digital Group, Inc. 
    28  * @author Monte Ohrt <monte at ohrt dot com>  
    29  * @author Uwe Tews  
     28 * @author Monte Ohrt <monte at ohrt dot com> 
     29 * @author Uwe Tews 
    3030 * @package Smarty 
    3131 * @subpackage PluginsInternal 
     
    3838 
    3939class Smarty_Internal_Wrapper { 
    40    
     40 
    4141    protected $smarty; 
    4242 
     
    4444      $this->smarty = $smarty; 
    4545    } 
    46      
     46 
    4747    /** 
    4848     * Converts smarty2-style function call to smarty 3-style function call 
    4949     * This is expensive, be sure to port your code to Smarty 3! 
    50      *  
     50     * 
    5151     * @param string $name Smarty 2 function name 
    5252     * @param array $args Smarty 2 function args 
     
    9696              case 'cache': 
    9797                 return call_user_func_array(array($this->smarty,'clearCache'),$args); 
     98              case 'config': 
     99                 return call_user_func_array(array($this->smarty,'clearConfig'),$args); 
    98100              case 'compiled_template': 
    99101                 return call_user_func_array(array($this->smarty,'clearCompiledTemplate'),$args); 
Note: See TracChangeset for help on using the changeset viewer.