Skip to content

Commit 2cdb98a

Browse files
committed
Revert removal block argument from renderer methods
1 parent 4d0d25a commit 2cdb98a

9 files changed

Lines changed: 39 additions & 20 deletions

File tree

view/adminhtml/templates/form.phtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ if (!isset($viewModel)) {
2222
?>
2323
<div class="loki-form form">
2424
<?= /* @noEscape */ $blockRenderer->html(
25+
$block,
2526
'loki-admin.form.actions',
2627
['view_model' => $viewModel]
2728
) ?>
2829

2930
<div class="page-columns">
3031
<div class="main-col">
31-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.form.spinner') ?>
32-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.form.inner') ?>
32+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.form.spinner') ?>
33+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.form.inner') ?>
3334

3435
<div class="entry-edit form-inline">
3536
<div class="fieldset-wrapper">
@@ -39,6 +40,7 @@ if (!isset($viewModel)) {
3940
<?php foreach ($viewModel->getFields() as $field) : ?>
4041
<?php if (false === $field->isVisible()) continue; ?>
4142
<?= /* @noEscape */ $templateRenderer->html(
43+
$block,
4244
'Loki_AdminComponents::form/field.phtml',
4345
['field' => $field]
4446
); ?>

view/adminhtml/templates/form/field.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if (false === $field instanceof Field) {
3131

3232
<div class="admin__field-control">
3333
<?= /* @noEscape */ $templateRenderer->html(
34+
$block,
3435
$field->getFieldType()->getTemplate(),
3536
['field' => $field]
3637
) ?>

view/adminhtml/templates/form/field_type/product_id.phtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ $fieldAttributes = $field->getFieldAttributes();
3939
>
4040
<?php if (!empty($emptyOption)): ?>
4141
<?= /* @noEscape */ $templateRenderer->html(
42+
$block,
4243
'Loki_AdminComponents::form/field_type/select/option.phtml',
4344
[
4445
'option' => [
@@ -52,6 +53,7 @@ $fieldAttributes = $field->getFieldAttributes();
5253
<?php foreach ($options->toOptionArray() as $option) : ?>
5354
<?php $option['level'] = 0; ?>
5455
<?= /* @noEscape */ $templateRenderer->html(
56+
$block,
5557
'Loki_AdminComponents::form/field_type/select/option.phtml',
5658
['option' => $option]
5759
) ?>

view/adminhtml/templates/form/field_type/select.phtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ $fieldAttributes = $field->getFieldAttributes();
3838
>
3939
<?php if (!empty($emptyOption)): ?>
4040
<?= /* @noEscape */ $templateRenderer->html(
41+
$block,
4142
'Loki_AdminComponents::form/field_type/select/option.phtml',
4243
[
4344
'option' => [
@@ -51,6 +52,7 @@ $fieldAttributes = $field->getFieldAttributes();
5152
<?php foreach ($options->toOptionArray() as $option) : ?>
5253
<?php $option['level'] = 0; ?>
5354
<?= /* @noEscape */ $templateRenderer->html(
55+
$block,
5456
'Loki_AdminComponents::form/field_type/select/option.phtml',
5557
['option' => $option]
5658
) ?>

view/adminhtml/templates/form/field_type/select/option.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ $option = $block->getOption();
1919
<?php foreach ($option['value'] as $suboption): ?>
2020
<?php $suboption['level'] = $option['level'] + 1; ?>
2121
<?= /* @noEscape */ $templateRenderer->html(
22+
$block,
2223
'Loki_AdminComponents::form/field_type/select/option.phtml',
2324
['option' => $suboption]
2425
) ?>

view/adminhtml/templates/grid.phtml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,37 @@ if (!isset($viewModel)) {
1717
?>
1818
<div class="loki-grid grid">
1919
<?php if ($viewModel->allowActions()): ?>
20-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.grid.actions') ?>
20+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.grid.actions') ?>
2121
<?php endif; ?>
2222

2323
<div class="page-columns">
2424
<div class="main-col">
2525
<div class="admin__data-grid-outer-wrap">
26-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.grid.spinner') ?>
26+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.grid.spinner') ?>
2727

2828
<div class="admin__data-grid-header">
2929
<div class="admin__data-grid-header-row">
30-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.grid.filters') ?>
30+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.grid.filters') ?>
3131
</div>
3232
<div class="admin__data-grid-header-row">
33-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.grid.search') ?>
33+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.grid.search') ?>
3434
</div>
3535
<div class="admin__data-grid-header-row row row-gutter">
36-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.grid.massactions') ?>
37-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.grid.pager') ?>
38-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.grid.records') ?>
36+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.grid.massactions') ?>
37+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.grid.pager') ?>
38+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.grid.records') ?>
3939
</div>
4040
</div>
4141

4242
<div class="admin__data-grid-header-row row row-gutter">
4343
<div class="col-xs-2">
4444
<div class="action-select-wrap">
45-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.grid.row-actions') ?>
45+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.grid.row-actions') ?>
4646
</div>
4747
</div>
4848
</div>
4949

50-
<?= /* @noEscape */ $childRenderer->html( 'loki-admin.grid.table') ?>
50+
<?= /* @noEscape */ $childRenderer->html( $block, 'loki-admin.grid.table') ?>
5151
</div>
5252
</div>
5353
</div>

view/adminhtml/templates/grid/actions.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ $buttons = $viewModel->getButtons();
2020
<div class="page-actions-buttons">
2121
<?php foreach ($buttons as $button): ?>
2222
<?= /* @noEscape */ $templateRenderer->html(
23+
$block,
2324
'Loki_AdminComponents::ui/button.phtml',
2425
['button' => $button]
2526
) ?>

view/adminhtml/templates/grid/pager.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ use Loki\Components\Util\Block\ChildRenderer;
1313
$viewModel = $block->getViewModel();
1414
?>
1515
<div class="admin__data-grid-pager-wrap">
16-
<?= /* @noEscape */ $childRenderer->html('limit') ?>
17-
<?= /* @noEscape */ $childRenderer->html('pagination') ?>
16+
<?= /* @noEscape */ $childRenderer->html($block, 'limit') ?>
17+
<?= /* @noEscape */ $childRenderer->html($block, 'pagination') ?>
1818
</div>

view/adminhtml/templates/grid/table.phtml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ $state = $viewModel->getState();
7272
class="data-grid-th _sortable <?= $escaper->escapeHtml($additionalCss) ?>"
7373
data-column="<?= $escaper->escapeHtml($column->getCode()) ?>"
7474
@click.prevent="sortColumn"
75-
x-sort:item="'<?= $escaper->escapeHtml($viewModel->getJsComponentId()) ?>.<?= $escaper->escapeHtml($column->getCode()) ?>'">
75+
x-sort:item="'<?= $escaper->escapeHtml($viewModel->getJsComponentId()) ?>.<?= $escaper->escapeHtml(
76+
$column->getCode()
77+
) ?>'">
7678
<span class="data-grid-cell-content"><?= $escaper->escapeHtml(__($column->getLabel())) ?></span>
7779
</th>
7880
<?php
@@ -110,11 +112,16 @@ $state = $viewModel->getState();
110112
<div class="data-grid-cell-content">
111113
<?php $cellTemplate = $viewModel->getCellTemplate($item, $column) ?>
112114
<?php $value = $viewModel->getValueFromItem($item, $column->getCode()); ?>
113-
<?= /* @noEscape */ $templateRenderer->html($cellTemplate, [
114-
'item' => $item,
115-
'value' => $value,
116-
'column_name' => $column->getCode(),
117-
]) ?>
115+
<?= /* @noEscape */
116+
$templateRenderer->html(
117+
$block,
118+
$cellTemplate,
119+
[
120+
'item' => $item,
121+
'value' => $value,
122+
'column_name' => $column->getCode(),
123+
]
124+
) ?>
118125
</div>
119126
</td>
120127
<?php endforeach; ?>
@@ -125,7 +132,10 @@ $state = $viewModel->getState();
125132
<ul>
126133
<?php foreach ($cellActions as $cellAction): ?>
127134
<li>
128-
<a href="<?= /* @noEscape */ $cellAction->getUrl() ?>"><?= $escaper->escapeHtml($cellAction->getLabel()) ?></a>
135+
<a href="<?= /* @noEscape */
136+
$cellAction->getUrl() ?>"><?= $escaper->escapeHtml(
137+
$cellAction->getLabel()
138+
) ?></a>
129139
</li>
130140
<?php endforeach; ?>
131141
</ul>

0 commit comments

Comments
 (0)