| 
									
										
										
										
											2009-11-06 14:35:00 +00:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-06 14:35:00 +00:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |  * Smarty Internal Plugin Compile Block | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Compiles the {block}{/block} tags | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @package Smarty | 
					
						
							|  |  |  |  * @subpackage Compiler | 
					
						
							|  |  |  |  * @author Uwe Tews | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2010-08-17 15:39:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-06 14:35:00 +00:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |  * Smarty Internal Plugin Compile Block Class | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @package Smarty | 
					
						
							|  |  |  |  * @subpackage Compiler | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2009-11-06 14:35:00 +00:00
										 |  |  | class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |      * Attribute definition: Overwrites base class. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      * @see Smarty_Internal_CompileBase | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |     public $required_attributes = array('name'); | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |      * Attribute definition: Overwrites base class. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      * @see Smarty_Internal_CompileBase | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |     public $shorttag_order = array('name', 'hide'); | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |      * Attribute definition: Overwrites base class. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      * @see Smarty_Internal_CompileBase | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |     public $optional_attributes = array('hide'); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |      * Compiles code for the {block} tag | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param array  $args     array with attributes from parser | 
					
						
							|  |  |  |      * @param object $compiler compiler object | 
					
						
							|  |  |  |      * @return boolean true | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function compile($args, $compiler) { | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |         // check and get attributes
 | 
					
						
							|  |  |  |         $_attr = $this->getAttributes($compiler, $args); | 
					
						
							|  |  |  |         $save = array($_attr, $compiler->parser->current_buffer, $compiler->nocache, $compiler->smarty->merge_compiled_includes, $compiler->merged_templates, $compiler->smarty->merged_templates_func, $compiler->template->properties, $compiler->template->has_nocache_code); | 
					
						
							|  |  |  |         $this->openTag($compiler, 'block', $save); | 
					
						
							|  |  |  |         if ($_attr['nocache'] == true) { | 
					
						
							|  |  |  |             $compiler->nocache = true; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         // set flag for {block} tag
 | 
					
						
							|  |  |  |         $compiler->inheritance = true; | 
					
						
							|  |  |  |         // must merge includes
 | 
					
						
							|  |  |  |         $compiler->smarty->merge_compiled_includes = true; | 
					
						
							| 
									
										
										
										
											2010-01-11 20:44:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |         $compiler->parser->current_buffer = new _smarty_template_buffer($compiler->parser); | 
					
						
							|  |  |  |         $compiler->has_code = false; | 
					
						
							|  |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |      * Save or replace child block source by block name during parsing | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param string $block_content     block source content | 
					
						
							|  |  |  |      * @param string $block_tag         opening block tag | 
					
						
							|  |  |  |      * @param object $template          template object | 
					
						
							|  |  |  |      * @param string $filepath          filepath of template source | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public static function saveBlockData($block_content, $block_tag, $template, $filepath) { | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |         $_rdl = preg_quote($template->smarty->right_delimiter); | 
					
						
							|  |  |  |         $_ldl = preg_quote($template->smarty->left_delimiter); | 
					
						
							| 
									
										
										
										
											2012-08-21 21:54:30 +00:00
										 |  |  |         if (!$template->smarty->auto_literal) { | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |             $al = '\s*'; | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $al = ''; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (0 == preg_match("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")(\s*?)?((append|prepend|nocache)?(\s*)?(hide)?)?(\s*{$_rdl})!", $block_tag, $_match)) { | 
					
						
							|  |  |  |             $error_text = 'Syntax Error in template "' . $template->source->filepath . '"   "' . htmlspecialchars($block_tag) . '" illegal options'; | 
					
						
							|  |  |  |             throw new SmartyCompilerException($error_text); | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $_name = trim($_match[3], '\'"'); | 
					
						
							|  |  |  |             if ($_match[8] != 'hide' || isset($template->block_data[$_name])) {        // replace {$smarty.block.child}
 | 
					
						
							| 
									
										
										
										
											2013-01-09 23:05:09 +00:00
										 |  |  |                 // get nested block tags
 | 
					
						
							|  |  |  |                 if (0 != preg_match_all("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")([\s\S]*?)(hide)?(\s*{$_rdl})([\s\S]*?)(.*)?({$_ldl}{$al}/block\s*{$_rdl})!", $block_content, $_match2)) { | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |                     foreach ($_match2[3] as $key => $name) { | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |                         // get it's replacement
 | 
					
						
							|  |  |  |                         $_name2 = trim($name, '\'"'); | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |                         if ($_match2[5][$key] != 'hide' || isset($template->block_data[$_name2])) { | 
					
						
							|  |  |  |                             if (isset($template->block_data[$_name2])) { | 
					
						
							|  |  |  |                                 $replacement = $template->block_data[$_name2]['source']; | 
					
						
							|  |  |  |                             } else { | 
					
						
							|  |  |  |                                 $replacement = ''; | 
					
						
							|  |  |  |                             } | 
					
						
							|  |  |  |                             // replace {$smarty.block.child} tag
 | 
					
						
							| 
									
										
										
										
											2013-01-09 23:05:09 +00:00
										 |  |  |                             if (preg_match("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!",$_match2[7][$key])) { | 
					
						
							|  |  |  |                                  $replacement =  preg_replace("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $replacement, $_match2[7][$key]); | 
					
						
							|  |  |  |                                  $block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl}))!", $replacement, $block_content); | 
					
						
							|  |  |  |                            } | 
					
						
							|  |  |  |                              if (preg_match("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!",$_match2[8][$key])) { | 
					
						
							|  |  |  |                                  $replacement =  preg_replace("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!", $replacement, $_match2[8][$key]); | 
					
						
							|  |  |  |                                  $block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl})(.*)?({$_ldl}{$al}/block\s*{$_rdl}))!", $replacement, $block_content); | 
					
						
							|  |  |  |                              } | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |                         } else { | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |                             // remove hidden blocks
 | 
					
						
							| 
									
										
										
										
											2013-01-09 23:05:09 +00:00
										 |  |  |                             $block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl}))!", '', $block_content); | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |                         } | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 // do we have not nested {$smart.block.child}
 | 
					
						
							| 
									
										
										
										
											2012-09-14 14:42:15 +00:00
										 |  |  |                 if (0 != preg_match("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $block_content, $_match2)) { | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |                     // get child replacement for this block
 | 
					
						
							|  |  |  |                     if (isset($template->block_data[$_name])) { | 
					
						
							|  |  |  |                         $replacement = $template->block_data[$_name]['source']; | 
					
						
							|  |  |  |                         unset($template->block_data[$_name]); | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $replacement = ''; | 
					
						
							|  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2012-09-14 14:42:15 +00:00
										 |  |  |                     $block_content = preg_replace("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $replacement, $block_content); | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |                 } | 
					
						
							|  |  |  |                 if (isset($template->block_data[$_name])) { | 
					
						
							|  |  |  |                     if (strpos($template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) { | 
					
						
							|  |  |  |                         $template->block_data[$_name]['source'] = | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |                                 str_replace('%%%%SMARTY_PARENT%%%%', $block_content, $template->block_data[$_name]['source']); | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |                     } elseif ($template->block_data[$_name]['mode'] == 'prepend') { | 
					
						
							|  |  |  |                         $template->block_data[$_name]['source'] .= $block_content; | 
					
						
							|  |  |  |                     } elseif ($template->block_data[$_name]['mode'] == 'append') { | 
					
						
							|  |  |  |                         $template->block_data[$_name]['source'] = $block_content . $template->block_data[$_name]['source']; | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $template->block_data[$_name]['source'] = $block_content; | 
					
						
							|  |  |  |                     $template->block_data[$_name]['file'] = $filepath; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 if ($_match[6] == 'append') { | 
					
						
							|  |  |  |                     $template->block_data[$_name]['mode'] = 'append'; | 
					
						
							|  |  |  |                 } elseif ($_match[6] == 'prepend') { | 
					
						
							|  |  |  |                     $template->block_data[$_name]['mode'] = 'prepend'; | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $template->block_data[$_name]['mode'] = 'replace'; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |      * Compile saved child block source | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param object $compiler  compiler object | 
					
						
							|  |  |  |      * @param string $_name     optional name of child block | 
					
						
							|  |  |  |      * @return string   compiled code of schild block | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public static function compileChildBlock($compiler, $_name = null) { | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |         $_output = ''; | 
					
						
							|  |  |  |         // if called by {$smarty.block.child} we must search the name of enclosing {block}
 | 
					
						
							|  |  |  |         if ($_name == null) { | 
					
						
							|  |  |  |             $stack_count = count($compiler->_tag_stack); | 
					
						
							|  |  |  |             while (--$stack_count >= 0) { | 
					
						
							|  |  |  |                 if ($compiler->_tag_stack[$stack_count][0] == 'block') { | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |                     $_name = trim($compiler->_tag_stack[$stack_count][1][0]['name'], "'\""); | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |                     break; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             // flag that child is already compile by {$smarty.block.child} inclusion
 | 
					
						
							|  |  |  |             $compiler->template->block_data[$_name]['compiled'] = true; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if ($_name == null) { | 
					
						
							|  |  |  |             $compiler->trigger_template_error('{$smarty.block.child} used out of context', $compiler->lex->taglineno); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         // undefined child?
 | 
					
						
							|  |  |  |         if (!isset($compiler->template->block_data[$_name]['source'])) { | 
					
						
							|  |  |  |             return ''; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |         $_tpl = new Smarty_Internal_template('string:' . $compiler->template->block_data[$_name]['source'], $compiler->smarty, $compiler->template, $compiler->template->cache_id, | 
					
						
							| 
									
										
										
										
											2013-02-28 19:23:04 +00:00
										 |  |  |                         $compiler->template->compile_id, $compiler->template->caching, $compiler->template->cache_lifetime); | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |         $_tpl->variable_filters = $compiler->template->variable_filters; | 
					
						
							|  |  |  |         $_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash']; | 
					
						
							|  |  |  |         $_tpl->source->filepath = $compiler->template->block_data[$_name]['file']; | 
					
						
							|  |  |  |         $_tpl->allow_relative_path = true; | 
					
						
							|  |  |  |         if ($compiler->nocache) { | 
					
						
							|  |  |  |             $_tpl->compiler->forceNocache = 2; | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $_tpl->compiler->forceNocache = 1; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         $_tpl->compiler->suppressHeader = true; | 
					
						
							|  |  |  |         $_tpl->compiler->suppressTemplatePropertyHeader = true; | 
					
						
							|  |  |  |         $_tpl->compiler->suppressMergedTemplates = true; | 
					
						
							|  |  |  |         if (strpos($compiler->template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) { | 
					
						
							|  |  |  |             $_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->parser->current_buffer->to_smarty_php(), $_tpl->compiler->compileTemplate($_tpl)); | 
					
						
							|  |  |  |         } elseif ($compiler->template->block_data[$_name]['mode'] == 'prepend') { | 
					
						
							|  |  |  |             $_output = $_tpl->compiler->compileTemplate($_tpl) . $compiler->parser->current_buffer->to_smarty_php(); | 
					
						
							|  |  |  |         } elseif ($compiler->template->block_data[$_name]['mode'] == 'append') { | 
					
						
							|  |  |  |             $_output = $compiler->parser->current_buffer->to_smarty_php() . $_tpl->compiler->compileTemplate($_tpl); | 
					
						
							|  |  |  |         } elseif (!empty($compiler->template->block_data[$_name])) { | 
					
						
							|  |  |  |             $_output = $_tpl->compiler->compileTemplate($_tpl); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']); | 
					
						
							|  |  |  |         $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']); | 
					
						
							|  |  |  |         $compiler->merged_templates = array_merge($compiler->merged_templates, $_tpl->compiler->merged_templates); | 
					
						
							|  |  |  |         $compiler->template->variable_filters = $_tpl->variable_filters; | 
					
						
							|  |  |  |         if ($_tpl->has_nocache_code) { | 
					
						
							|  |  |  |             $compiler->template->has_nocache_code = true; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |         foreach ($_tpl->required_plugins as $key => $tmp1) { | 
					
						
							|  |  |  |             if ($compiler->nocache && $compiler->template->caching) { | 
					
						
							| 
									
										
										
										
											2012-01-02 20:49:26 +00:00
										 |  |  |                 $code = 'nocache'; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $code = $key; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |             foreach ($tmp1 as $name => $tmp) { | 
					
						
							|  |  |  |                 foreach ($tmp as $type => $data) { | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |                     $compiler->template->required_plugins[$code][$name][$type] = $data; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         unset($_tpl); | 
					
						
							|  |  |  |         return $_output; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2009-11-06 14:35:00 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |  * Smarty Internal Plugin Compile BlockClose Class | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @package Smarty | 
					
						
							|  |  |  |  * @subpackage Compiler | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2009-11-06 14:35:00 +00:00
										 |  |  | class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |      * Compiles code for the {/block} tag | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param array  $args     array with attributes from parser | 
					
						
							|  |  |  |      * @param object $compiler compiler object | 
					
						
							|  |  |  |      * @return string compiled code | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function compile($args, $compiler) { | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |         $compiler->has_code = true; | 
					
						
							|  |  |  |         // check and get attributes
 | 
					
						
							|  |  |  |         $_attr = $this->getAttributes($compiler, $args); | 
					
						
							|  |  |  |         $saved_data = $this->closeTag($compiler, array('block')); | 
					
						
							|  |  |  |         $_name = trim($saved_data[0]['name'], "\"'"); | 
					
						
							|  |  |  |         if (isset($compiler->template->block_data[$_name]) && !isset($compiler->template->block_data[$_name]['compiled'])) { | 
					
						
							|  |  |  |             // restore to status before {block} tag as new subtemplate code of parent {block} is not needed
 | 
					
						
							| 
									
										
										
										
											2012-02-19 15:48:05 +00:00
										 |  |  |             // TODO: Below code was disabled in 3.1.8 because of problems with {include} in nested {block} tags in child templates
 | 
					
						
							|  |  |  |             //       combined with append/prepend or $smarty.block.parent
 | 
					
						
							|  |  |  |             //       For later versions it should be checked under which conditions it could run for optimisation
 | 
					
						
							|  |  |  |             //
 | 
					
						
							|  |  |  |             //$compiler->merged_templates = $saved_data[4];
 | 
					
						
							|  |  |  |             //$compiler->smarty->merged_templates_func = $saved_data[5];
 | 
					
						
							|  |  |  |             //$compiler->template->properties = $saved_data[6];
 | 
					
						
							|  |  |  |             //$compiler->template->has_nocache_code = $saved_data[7];
 | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |             $_output = Smarty_Internal_Compile_Block::compileChildBlock($compiler, $_name); | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             if (isset($saved_data[0]['hide']) && !isset($compiler->template->block_data[$_name]['source'])) { | 
					
						
							|  |  |  |                 $_output = ''; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $_output = $compiler->parser->current_buffer->to_smarty_php(); | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2012-06-30 15:53:22 +00:00
										 |  |  |             unset($compiler->template->block_data[$_name]['compiled']); | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |         } | 
					
						
							|  |  |  |         // reset flags
 | 
					
						
							|  |  |  |         $compiler->parser->current_buffer = $saved_data[1]; | 
					
						
							|  |  |  |         $compiler->nocache = $saved_data[2]; | 
					
						
							| 
									
										
										
										
											2012-03-12 19:29:10 +00:00
										 |  |  |         $compiler->smarty->merge_compiled_includes = $saved_data[3]; | 
					
						
							| 
									
										
										
										
											2011-12-20 17:50:15 +00:00
										 |  |  |         // reset flag for {block} tag
 | 
					
						
							|  |  |  |         $compiler->inheritance = false; | 
					
						
							|  |  |  |         // $_output content has already nocache code processed
 | 
					
						
							|  |  |  |         $compiler->suppressNocacheProcessing = true; | 
					
						
							|  |  |  |         return $_output; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-28 22:18:39 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-01 16:46:30 +00:00
										 |  |  | ?>
 |