1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-12 20:56:40 +02:00

[ticket/14994] Refactor template->assign_block_var

Refactor assign_block_var to use the same block selection mechanism
as is used in alter_block_array.  This allows creating new blocks
at any position in the template structure, not only on the last block.
Allows selecting a block as outer[2].middle.
Added tests. Added PHP 7.2 compatibility.

PHPBB3-14994
This commit is contained in:
javiexin
2017-05-31 20:24:55 +02:00
committed by Marc Alexander
parent c2043e47da
commit a30693a594

View File

@ -209,7 +209,7 @@ class context
$name = $blocks[$i]; $name = $blocks[$i];
// Assign S_ROW_COUNT and S_ROW_NUM // Assign S_ROW_COUNT and S_ROW_NUM
$s_row_count = isset($block[$name]) ? sizeof($block[$name]) : 0; $s_row_count = isset($block[$name]) ? count($block[$name]) : 0;
$vararray['S_ROW_COUNT'] = $vararray['S_ROW_NUM'] = $s_row_count; $vararray['S_ROW_COUNT'] = $vararray['S_ROW_NUM'] = $s_row_count;
// Assign S_FIRST_ROW // Assign S_FIRST_ROW