Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
extended.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php
20 $numColumns = sizeof($block->getColumns());
21 
25 ?>
26 <?php if ($block->getCollection()): ?>
27  <?php if ($block->canDisplayContainer()): ?>
28 
29  <div id="<?= $block->escapeHtml($block->getId()) ?>" data-grid-id="<?= $block->escapeHtml($block->getId()) ?>">
30  <?php else: ?>
31  <?= $block->getLayout()->getMessagesBlock()->getGroupedHtml() ?>
32  <?php endif; ?>
33  <?php $massActionAvailable = $block->getMassactionBlock() && $block->getMassactionBlock()->isAvailable() ?>
34  <?php if ($block->getPagerVisibility() || $block->getExportTypes() || $block->getFilterVisibility() || $massActionAvailable): ?>
35  <div class="admin__data-grid-header admin__data-grid-toolbar">
36  <div class="admin__data-grid-header-row">
37  <?php if ($massActionAvailable): ?>
38  <?= $block->getMainButtonsHtml() ? '<div class="admin__filter-actions">' . $block->getMainButtonsHtml() . '</div>' : '' ?>
39  <?php endif; ?>
40  <?php if ($block->getExportTypes()): ?>
41  <div class="admin__data-grid-export">
42  <label
43  class="admin__control-support-text"
44  for="<?= $block->escapeHtml($block->getId()) ?>_export"><?= /* @escapeNotVerified */ __('Export to:') ?></label>
45  <select name="<?= $block->escapeHtml($block->getId()) ?>_export" id="<?= $block->escapeHtml($block->getId()) ?>_export"
46  class="admin__control-select">
47  <?php foreach ($block->getExportTypes() as $_type): ?>
48  <option value="<?= /* @escapeNotVerified */ $_type->getUrl() ?>"><?= /* @escapeNotVerified */ $_type->getLabel() ?></option>
49  <?php endforeach; ?>
50  </select>
51  <?= $block->getExportButtonHtml() ?>
52  </div>
53  <?php endif; ?>
54  </div>
55 
56  <div class="admin__data-grid-header-row <?= $massActionAvailable ? '_massaction' : '' ?>">
57  <?php if ($massActionAvailable): ?>
58  <?= $block->getMassactionBlockHtml() ?>
59  <?php else: ?>
60  <?= $block->getMainButtonsHtml() ? '<div class="admin__filter-actions">' . $block->getMainButtonsHtml() . '</div>' : '' ?>
61  <?php endif; ?>
62  <?php $countRecords = $block->getCollection()->getSize(); ?>
63  <div class="admin__control-support-text">
64  <span id="<?= $block->escapeHtml($block->getHtmlId()) ?>-total-count" <?= /* @escapeNotVerified */ $block->getUiId('total-count') ?>>
65  <?= /* @escapeNotVerified */ $countRecords ?>
66  </span>
67  <?= /* @escapeNotVerified */ __('records found') ?>
68  <span id="<?= $block->escapeHtml($block->getHtmlId()) ?>_massaction-count"
69  class="mass-select-info _empty"><strong data-role="counter">0</strong> <span><?= /* @escapeNotVerified */ __('selected') ?></span></span>
70  </div>
71 
72  <?php if ($block->getPagerVisibility()): ?>
73  <div class="admin__data-grid-pager-wrap">
74  <select name="<?= /* @escapeNotVerified */ $block->getVarNameLimit() ?>"
75  id="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-limit"
76  onchange="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.loadByElement(this)"
77  class="admin__control-select">
78  <option value="20"<?php if ($block->getCollection()->getPageSize() == 20): ?>
79  selected="selected"<?php endif; ?>>20
80  </option>
81  <option value="30"<?php if ($block->getCollection()->getPageSize() == 30): ?>
82  selected="selected"<?php endif; ?>>30
83  </option>
84  <option value="50"<?php if ($block->getCollection()->getPageSize() == 50): ?>
85  selected="selected"<?php endif; ?>>50
86  </option>
87  <option value="100"<?php if ($block->getCollection()->getPageSize() == 100): ?>
88  selected="selected"<?php endif; ?>>100
89  </option>
90  <option value="200"<?php if ($block->getCollection()->getPageSize() == 200): ?>
91  selected="selected"<?php endif; ?>>200
92  </option>
93  </select>
94  <label for="<?= $block->escapeHtml($block->getHtmlId()) ?><?= $block->escapeHtml($block->getHtmlId()) ?>_page-limit"
95  class="admin__control-support-text"><?= /* @escapeNotVerified */ __('per page') ?></label>
96 
97  <div class="admin__data-grid-pager">
98  <?php $_curPage = $block->getCollection()->getCurPage() ?>
99  <?php $_lastPage = $block->getCollection()->getLastPageNumber() ?>
100  <?php if ($_curPage > 1): ?>
101  <button class="action-previous"
102  type="button"
103  onclick="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.setPage('<?= /* @escapeNotVerified */ ($_curPage - 1) ?>');return false;">
104  <span><?= /* @escapeNotVerified */ __('Previous page') ?></span>
105  </button>
106  <?php else: ?>
107  <button type="button" class="action-previous disabled"><span><?= /* @escapeNotVerified */ __('Previous page') ?></span></button>
108  <?php endif; ?>
109  <input type="text"
110  id="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-current"
111  name="<?= /* @escapeNotVerified */ $block->getVarNamePage() ?>"
112  value="<?= /* @escapeNotVerified */ $_curPage ?>"
113  class="admin__control-text"
114  onkeypress="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.inputPage(event, '<?= /* @escapeNotVerified */ $_lastPage ?>')" <?= /* @escapeNotVerified */ $block->getUiId('current-page') ?> />
115  <label class="admin__control-support-text" for="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-current">
116  <?= /* @escapeNotVerified */ __('of %1', '<span>' . $block->getCollection()->getLastPageNumber() . '</span>') ?>
117  </label>
118  <?php if ($_curPage < $_lastPage): ?>
119  <button type="button"
120  title="<?= /* @escapeNotVerified */ __('Next page') ?>"
121  class="action-next"
122  onclick="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.setPage('<?= /* @escapeNotVerified */ ($_curPage + 1) ?>');return false;">
123  <span><?= /* @escapeNotVerified */ __('Next page') ?></span>
124  </button>
125  <?php else: ?>
126  <button type="button" class="action-next disabled"><span><?= /* @escapeNotVerified */ __('Next page') ?></span></button>
127  <?php endif; ?>
128  </div>
129  </div>
130  <?php endif ?>
131  </div>
132  </div>
133  <?php endif; ?>
134 
135  <div class="admin__data-grid-wrap admin__data-grid-wrap-static">
136  <table class="data-grid" id="<?= $block->escapeHtml($block->getId()) ?>_table">
137  <?php
138  /* This part is commented to remove all <col> tags from the code. */
139  /* foreach ($block->getColumns() as $_column): ?>
140  <col <?= $_column->getHtmlProperty() ?> />
141  <?php endforeach; */
142  ?>
143  <?php if ($block->getHeadersVisibility() || $block->getFilterVisibility()): ?>
144  <thead>
145  <?php if ($block->getHeadersVisibility()): ?>
146  <tr>
147  <?php foreach ($block->getColumns() as $_column): ?>
148  <?php if ($_column->getHeaderHtml() == '&nbsp;'):?>
149  <th class="data-grid-th" data-column="<?= /* @escapeNotVerified */ $_column->getId() ?>"
150  <?= $_column->getHeaderHtmlProperty() ?>>&nbsp;</th>
151  <?php else: ?>
152  <?= $_column->getHeaderHtml() ?>
153  <?php endif; ?>
154  <?php endforeach; ?>
155  </tr>
156  <?php endif; ?>
157  <?php if ($block->getFilterVisibility()): ?>
158  <tr class="data-grid-filters" data-role="filter-form">
159  <?php $i = 0;
160  foreach ($block->getColumns() as $_column): ?>
161  <td data-column="<?= /* @escapeNotVerified */ $_column->getId() ?>" <?= $_column->getHeaderHtmlProperty() ?>>
162  <?= $_column->getFilterHtml() ?>
163  </td>
164  <?php endforeach; ?>
165  </tr>
166  <?php endif ?>
167  </thead>
168  <?php endif; ?>
169  <?php if ($block->getCountTotals()): ?>
170  <tfoot>
171  <tr class="totals">
172  <?php foreach ($block->getColumns() as $_column): ?>
173  <th class="<?= /* @escapeNotVerified */ $_column->getCssProperty() ?>">
174  <?= /* @escapeNotVerified */ ($_column->hasTotalsLabel()) ? $_column->getTotalsLabel() : $_column->getRowField($_column->getGrid()->getTotals()) ?>
175  </th>
176  <?php endforeach; ?>
177  </tr>
178  </tfoot>
179  <?php endif; ?>
180 
181  <tbody>
182  <?php if (($block->getCollection()->getSize() > 0) && (!$block->getIsCollapsed())): ?>
183  <?php foreach ($block->getCollection() as $_index => $_item): ?>
184  <tr title="<?= /* @escapeNotVerified */ $block->getRowUrl($_item) ?>"<?php if ($_class = $block->getRowClass($_item)): ?>
185  class="<?= /* @escapeNotVerified */ $_class ?>"<?php endif; ?> ><?php
186  $i = 0;
187  foreach ($block->getColumns() as $_column):
188  if ($block->shouldRenderCell($_item, $_column)):
189  $_rowspan = $block->getRowspan($_item, $_column);
190  ?>
191  <td <?= ($_rowspan ? 'rowspan="' . $_rowspan . '" ' : '') ?>
192  class="<?= /* @escapeNotVerified */ $_column->getCssProperty() ?>
193  <?= /* @escapeNotVerified */ $_column->getId() == 'massaction' ? 'data-grid-checkbox-cell': '' ?>">
194  <?= (($_html = $_column->getRowField($_item)) != '' ? $_html : '&nbsp;') ?>
195  </td><?php
196  if ($block->shouldRenderEmptyCell($_item, $_column)):
197  ?>
198  <td colspan="<?= /* @escapeNotVerified */ $block->getEmptyCellColspan($_item) ?>"
199  class="last"><?= /* @escapeNotVerified */ $block->getEmptyCellLabel() ?></td><?php
200  endif;
201  endif;
202  endforeach; ?>
203  </tr>
204  <?php if ($_multipleRows = $block->getMultipleRows($_item)): ?>
205  <?php foreach ($_multipleRows as $_i): ?>
206  <tr>
207  <?php $i = 0;
208  foreach ($block->getMultipleRowColumns($_i) as $_column): ?>
209  <td class="<?= /* @escapeNotVerified */ $_column->getCssProperty() ?>
210  <?= /* @escapeNotVerified */ $_column->getId() == 'massaction' ? 'data-grid-checkbox-cell': '' ?>">
211  <?= (($_html = $_column->getRowField($_i)) != '' ? $_html : '&nbsp;') ?>
212  </td>
213  <?php endforeach; ?>
214  </tr>
215  <?php endforeach; ?>
216  <?php endif; ?>
217 
218  <?php if ($block->shouldRenderSubTotal($_item)): ?>
219  <tr class="subtotals">
220  <?php $i = 0;
221  foreach ($block->getSubTotalColumns() as $_column): ?>
222  <td class="<?= /* @escapeNotVerified */ $_column->getCssProperty() ?>
223  <?= /* @escapeNotVerified */ $_column->getId() == 'massaction' ? 'data-grid-checkbox-cell': '' ?>">
224  <?php /* @escapeNotVerified */ echo($_column->hasSubtotalsLabel() ? $_column->getSubtotalsLabel() :
225  $_column->getRowField($block->getSubTotalItem($_item))
226  );
227  ?>
228  </td>
229  <?php endforeach; ?>
230  </tr>
231  <?php endif; ?>
232  <?php endforeach; ?>
233  <?php elseif ($block->getEmptyText()): ?>
234  <tr class="data-grid-tr-no-data">
235  <td class="<?= /* @escapeNotVerified */ $block->getEmptyTextClass() ?>"
236  colspan="<?= /* @escapeNotVerified */ $numColumns ?>"><?= /* @escapeNotVerified */ $block->getEmptyText() ?></td>
237  </tr>
238  <?php endif; ?>
239  </tbody>
240  </table>
241 
242  </div>
243  <?php if ($block->canDisplayContainer()): ?>
244 </div>
245 <script>
246  var deps = [];
247 
248  <?php if ($block->getDependencyJsObject()): ?>
249  deps.push('uiRegistry');
250  <?php endif; ?>
251 
252  <?php if (strpos($block->getRowClickCallback(), 'order.') !== false): ?>
253  deps.push('Magento_Sales/order/create/form')
254  <?php endif; ?>
255 
256  deps.push('mage/adminhtml/grid');
257 
258  <?php if (is_array($block->getRequireJsDependencies())): ?>
259  <?php foreach ($block->getRequireJsDependencies() as $dependency): ?>
260  deps.push('<?= /* @escapeNotVerified */ $dependency ?>');
261  <?php endforeach; ?>
262  <?php endif; ?>
263 
264  require(deps, function(<?= ($block->getDependencyJsObject() ? 'registry' : '') ?>){
265  <?php //TODO: getJsObjectName and getRowClickCallback has unexpected behavior. Should be removed ?>
266 
267  //<![CDATA[
268  <?php if ($block->getDependencyJsObject()): ?>
269  registry.get('<?= /* @escapeNotVerified */ $block->getDependencyJsObject() ?>', function (<?= /* @escapeNotVerified */ $block->getDependencyJsObject() ?>) {
270  <?php endif; ?>
271 
272  <?= /* @escapeNotVerified */ $block->getJsObjectName() ?> = new varienGrid(<?= /* @noEscape */ $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($block->getId()) ?>, '<?= /* @escapeNotVerified */ $block->getGridUrl() ?>', '<?= /* @escapeNotVerified */ $block->getVarNamePage() ?>', '<?= /* @escapeNotVerified */ $block->getVarNameSort() ?>', '<?= /* @escapeNotVerified */ $block->getVarNameDir() ?>', '<?= /* @escapeNotVerified */ $block->getVarNameFilter() ?>');
273  <?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.useAjax = '<?= /* @escapeNotVerified */ $block->getUseAjax() ?>';
274  <?php if ($block->getRowClickCallback()): ?>
275  <?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.rowClickCallback = <?= /* @escapeNotVerified */ $block->getRowClickCallback() ?>;
276  <?php endif; ?>
277  <?php if ($block->getCheckboxCheckCallback()): ?>
278  <?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.checkboxCheckCallback = <?= /* @escapeNotVerified */ $block->getCheckboxCheckCallback() ?>;
279  <?php endif; ?>
280  <?php if ($block->getRowInitCallback()): ?>
281  <?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.initRowCallback = <?= /* @escapeNotVerified */ $block->getRowInitCallback() ?>;
282  <?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.initGridRows();
283  <?php endif; ?>
284  <?php if ($block->getMassactionBlock() && $block->getMassactionBlock()->isAvailable()): ?>
285  <?= /* @escapeNotVerified */ $block->getMassactionBlock()->getJavaScript() ?>
286  <?php endif ?>
287  <?= /* @escapeNotVerified */ $block->getAdditionalJavaScript() ?>
288 
289  <?php if ($block->getDependencyJsObject()): ?>
290  });
291  <?php endif; ?>
292  //]]>
293 
294 });
295 </script>
296 <?php endif; ?>
297 <?php endif ?>
if( $block->getExportTypes())( $block->getId()) ?>_export"><?foreach ($block->getExportTypes() as $_type) () ?>"><? endforeach
Definition: extended.phtml:47
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9
$i
Definition: extended.phtml:186
$_class
Definition: vat.phtml:13
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$countRecords
Definition: extended.phtml:62
__()
Definition: __.php:13
$block
Definition: block.php:8
if( $block->getCollection())( $block->canDisplayContainer())( $block->getId()) ?>" data-grid-id endif
Definition: extended.phtml:31
$_count $_index $_prevOptionId if($block->getOrderOptions()|| $_item->getDescription()) foreach( $items as $_item)( $_item) ?><?php $attributes if( $_item->getOrderItem() ->getParentItem())($_prevOptionId !=$attributes['option_id'])</td >< td > & nbsp
Definition: renderer.phtml:33
$_item
Definition: default.phtml:11
$numColumns
Definition: extended.phtml:20
else function()
if(empty( $_rates))( 'You must first configure currency options before being able to see currency rates.') ?></p ></div ><?php else() ?>"> <? $_i
Definition: matrix.phtml:30
if($block->getCollection() ->getPageSize()==30) if($block->getCollection() ->getPageSize()==50) if($block->getCollection() ->getPageSize()==100) if($block->getCollection() ->getPageSize()==200) $_curPage $_lastPageif( $_curPage > 1)() ?>.setPage('<? else
Definition: extended.phtml:104