public function processNocacheCode($content, $is_code)
    {
        // If the template is not evaluated and we have a nocache section and or a nocache tag
        if ($is_code && !empty($content)) {
            // generate replacement code
            if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing &&
                ($this->nocache || $this->tag_nocache)
            ) {
                $this->template->has_nocache_code = true;
                $_output = addcslashes($content, '\'\\');
                $_output = str_replace("^#^", "'", $_output);
                $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n";
                // make sure we include modifier plugins for nocache code
                foreach ($this->modifier_plugins as $plugin_name => $dummy) {
                    if (isset($this->template->required_plugins['compiled'][$plugin_name]['modifier'])) {
                        $this->template->required_plugins['nocache'][$plugin_name]['modifier'] = $this->template->required_plugins['compiled'][$plugin_name]['modifier'];
                    }
                }
            } else {
                $_output = $content;
            }
        } else {
            $_output = $content;
        }
        $this->modifier_plugins = array();
        $this->suppressNocacheProcessing = false;
        $this->tag_nocache = false;

        return $_output;
    }
public function processNocacheCode($content, $is_code)
    {
        // If the template is not evaluated and we have a nocache section and or a nocache tag
        if ($is_code && !empty($content)) {
            // generate replacement code
            if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing &&
                ($this->nocache || $this->tag_nocache)
            ) {
                $this->template->has_nocache_code = true;
                $_output = addcslashes($content, '\'\\');
                $_output = str_replace("^#^", "'", $_output);
                $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n";
                // make sure we include modifier plugins for nocache code
                foreach ($this->modifier_plugins as $plugin_name => $dummy) {
                    if (isset($this->template->required_plugins['compiled'][$plugin_name]['modifier'])) {
                        $this->template->required_plugins['nocache'][$plugin_name]['modifier'] = $this->template->required_plugins['compiled'][$plugin_name]['modifier'];
                    }
                }
            } else {
                $_output = $content;
            }
        } else {
            $_output = $content;
        }
        $this->modifier_plugins = array();
        $this->suppressNocacheProcessing = false;
        $this->tag_nocache = false;

        return $_output;
    }
public function processNocacheCode ( $ content , $ is_code ) { // If the template is not evaluated and we have a nocache section and or a nocache tag if ( $ is_code && ! empty ( $ content ) ) { // generate replacement code if ( ( ! ( $ this -> template -> source -> recompiled ) || $ this -> forceNocache ) && $ this -> template -> caching && ! $ this -> suppressNocacheProcessing && ( $ this -> nocache || $ this -> tag_nocache ) ) { $ this -> template -> has_nocache_code = true ; $ _output = addcslashes ( $ content , '\'\\' ) ; $ _output = str_replace ( "^#^" , "'" , $ _output ) ; $ _output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $ _output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n" ; // make sure we include modifier plugins for nocache code foreach ( $ this -> modifier_plugins as $ plugin_name => $ dummy ) { if ( isset ( $ this -> template -> required_plugins [ 'compiled' ] [ $ plugin_name ] [ 'modifier' ] ) ) { $ this -> template -> required_plugins [ 'nocache' ] [ $ plugin_name ] [ 'modifier' ] = $ this -> template -> required_plugins [ 'compiled' ] [ $ plugin_name ] [ 'modifier' ] ; } } } else { $ _output = $ content ; } } else { $ _output = $ content ; } $ this -> modifier_plugins = array ( ) ; $ this -> suppressNocacheProcessing = false ; $ this -> tag_nocache = false ; return $ _output ; }
Inject inline code for nocache template sections

This method gets the content of each template element from the parser.
If the content is compiled code and it should be not cached the code is injected
into the rendered output.

@param  string $content content of template element
@param  boolean $is_code true if content is compiled code
@return string  content
Inject inline code for nocache template sections