|
9 | 9 | $_width = $block->getImagesWidth();
|
10 | 10 |
|
11 | 11 | ?>
|
12 |
| -<?php if ($block->getFilesCount() > 0) : ?> |
13 |
| - <?php foreach ($block->getFiles() as $file) : ?> |
14 |
| -<?php |
15 |
| -$src = $block->escapeHtmlAttr($block->getFileThumbUrl($file)); |
16 |
| -$width = $block->escapeHtml($block->getFileWidth($file)); |
17 |
| -$height = $block->escapeHtml($block->getFileHeight($file)); |
18 |
| -?> |
| 12 | +<?php if ($block->getFilesCount() > 0): ?> |
| 13 | + <?php foreach ($block->getFiles() as $file): ?> |
| 14 | + <?php |
| 15 | + $src = $block->getFileThumbUrl($file); |
| 16 | + $width = $block->getFileWidth($file); |
| 17 | + $height = $block->getFileHeight($file); |
| 18 | + $filename = $block->getFileName($file); |
| 19 | + ?> |
19 | 20 | <div
|
20 | 21 | data-row="file"
|
21 | 22 | class="filecnt"
|
22 | 23 | id="<?= $block->escapeHtmlAttr($block->getFileId($file)) ?>"
|
23 | 24 | data-size="<?= $block->escapeHtmlAttr($file->getSize()) ?>"
|
24 | 25 | data-mime-type="<?= $block->escapeHtmlAttr($file->getMimeType()) ?>"
|
25 | 26 | >
|
26 |
| - <p class="nm" style="min-height: 72px;"> |
27 |
| - <?php if ($block->getFileThumbUrl($file)) : ?> |
28 |
| - <img src="<?= $src ?>" alt="<?= $block->escapeHtmlAttr($block->getFileName($file)) ?>"/> |
| 27 | + <p class="nm"> |
| 28 | + <?php if ($block->getFileThumbUrl($file)): ?> |
| 29 | + <img src="<?= $block->escapeHtmlAttr($src) ?>" alt="<?= $block->escapeHtmlAttr($filename) ?>"/> |
29 | 30 | <?php endif; ?>
|
30 | 31 | </p>
|
31 |
| - <?php if ($block->getFileWidth($file)) : ?> |
32 |
| - <small><?= $width ?>x<?= $height ?> <?= $block->escapeHtml(__('px.')) ?></small><br/> |
| 32 | + <?php if ($block->getFileWidth($file)): ?> |
| 33 | + <small><?= $block->escapeHtmlAttr($width) ?>x<?= $block->escapeHtmlAttr($height) ?> |
| 34 | + <?= $block->escapeHtml(__('px.')) ?></small><br/> |
33 | 35 | <?php endif; ?>
|
34 | 36 | <small><?= $block->escapeHtml($block->getFileShortName($file)) ?></small>
|
35 | 37 | </div>
|
36 | 38 | <?php endforeach; ?>
|
37 |
| -<?php else : ?> |
| 39 | +<?php else: ?> |
38 | 40 | <div class="empty"><?= $block->escapeHtml(__('No files found')) ?></div>
|
39 | 41 | <?php endif; ?>
|
0 commit comments