| Conditions | 7 |
| Paths | 8 |
| Total Lines | 30 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | function smarty_block_nocache($param, $content, &$smarty, &$repeat) |
||
| 17 | { |
||
| 18 | static $counter = []; |
||
| 19 | |||
| 20 | if ($repeat) { |
||
| 21 | if (!isset($param['name'])) { |
||
| 22 | return $content; |
||
| 23 | } |
||
| 24 | |||
| 25 | $name = $param['name']; |
||
| 26 | unset($param['name']); |
||
| 27 | |||
| 28 | if (!isset($counter[$name])) { |
||
| 29 | $counter[$name] = 0; |
||
| 30 | } |
||
| 31 | $counter[$name]++; |
||
| 32 | |||
| 33 | if ($smarty->_cache_including) { |
||
| 34 | $param = isset($smarty->_cache_info['cached_vars'][$name][$counter[$name]]) ? $smarty->_cache_info['cached_vars'][$name][$counter[$name]] : []; |
||
| 35 | } else { |
||
| 36 | $smarty->_cache_info['cached_vars'][$name][$counter[$name]] = $param; |
||
| 37 | } |
||
| 38 | |||
| 39 | foreach ($param as $k => $v) { |
||
| 40 | $smarty->_tpl_vars[$k] = $v; |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | return $content; |
||
| 45 | } |
||
| 46 |