|
4 | 4 | * See COPYING.txt for license details. |
5 | 5 | */ |
6 | 6 |
|
7 | | -// @codingStandardsIgnoreFile |
| 7 | +/** @var $this \Magento\AdminNotification\Block\ToolbarEntry */ |
8 | 8 |
|
9 | | -?> |
10 | | -<?php /** @var $this \Magento\AdminNotification\Block\ToolbarEntry */ ?> |
11 | | -<?php |
12 | 9 | $notificationCount = $block->getUnreadNotificationCount(); |
13 | 10 | $notificationCounterMax = $block->getNotificationCounterMax(); |
14 | 11 | ?> |
15 | 12 | <div |
16 | 13 | data-mage-init='{"toolbarEntry": {}}' |
17 | 14 | class="notifications-wrapper admin__action-dropdown-wrap" |
18 | | - data-notification-count="<?= /* @escapeNotVerified */ $notificationCount ?>"> |
| 15 | + data-notification-count="<?= (int)$notificationCount ?>"> |
19 | 16 | <?php if ($notificationCount > 0) : ?> |
20 | 17 | <a |
21 | | - href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>" |
| 18 | + href="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/index')) ?>" |
22 | 19 | class="notifications-action admin__action-dropdown" |
23 | 20 | data-mage-init='{"dropdown":{}}' |
24 | | - title="<?= /* @escapeNotVerified */ __('Notifications') ?>" |
| 21 | + title="<?= $block->escapeHtmlAttr(__('Notifications')) ?>" |
25 | 22 | data-toggle="dropdown"> |
26 | 23 | <span class="notifications-counter"> |
27 | | - <?= /* @escapeNotVerified */ ($notificationCount > $notificationCounterMax) ? $notificationCounterMax . '+' : $notificationCount ?> |
| 24 | + <?= /* @noEscape */ ($notificationCount > $notificationCounterMax) ? (int)$notificationCounterMax . '+' : (int)$notificationCount ?> |
28 | 25 | </span> |
29 | 26 | </a> |
30 | 27 | <ul |
31 | 28 | class="admin__action-dropdown-menu" |
32 | | - data-mark-as-read-url="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/ajaxMarkAsRead') ?>"> |
| 29 | + data-mark-as-read-url="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/ajaxMarkAsRead')) ?>"> |
33 | 30 | <?php foreach ($block->getLatestUnreadNotifications() as $notification) : ?> |
34 | | - <?php /** @var $notification \Magento\AdminNotification\Model\Inbox*/ ?> |
35 | | - <li class="notifications-entry<?php if ($notification->getSeverity() == 1): ?> notifications-critical<?php endif; ?>" |
36 | | - data-notification-id="<?= /* @escapeNotVerified */ $notification->getId() ?>" |
37 | | - data-notification-severity="<?php if ($notification->getSeverity() == 1): ?>1<?php endif; ?>"> |
38 | | - <?php |
39 | | - $notificationDescription = $block->escapeHtml($notification->getDescription()); |
40 | | - $notificationDescriptionLength = $block->getNotificationDescriptionLength(); |
41 | | - ?> |
42 | | - <strong class="notifications-entry-title"> |
43 | | - <?= $block->escapeHtml($notification->getTitle()) ?> |
44 | | - </strong> |
45 | | - <?php if (strlen($notificationDescription) > $notificationDescriptionLength) : ?> |
46 | | - <p class="notifications-entry-description _cutted"> |
47 | | - <span class="notifications-entry-description-start"> |
48 | | - <?= /* @escapeNotVerified */ substr($notificationDescription, 0, $notificationDescriptionLength) ?> |
49 | | - </span> |
50 | | - <span class="notifications-entry-description-end"> |
51 | | - <?= /* @escapeNotVerified */ substr($notificationDescription, $notificationDescriptionLength) ?> |
52 | | - </span> |
53 | | - </p> |
54 | | - <?php else : ?> |
55 | | - <p class="notifications-entry-description"> |
56 | | - <?= /* @escapeNotVerified */ $notificationDescription ?> |
57 | | - </p> |
58 | | - <?php endif; ?> |
59 | | - <time class="notifications-entry-time"> |
60 | | - <?= /* @escapeNotVerified */ $block->formatNotificationDate($notification->getDateAdded()) ?> |
61 | | - </time> |
62 | | - <button |
63 | | - type="button" |
64 | | - class="notifications-close" |
65 | | - title="<?= /* @escapeNotVerified */ __('Close') ?>" |
66 | | - ></button> |
67 | | - </li> |
| 31 | + <?php /** @var $notification \Magento\AdminNotification\Model\Inbox */ ?> |
| 32 | + <li class="notifications-entry<?php if ($notification->getSeverity() == 1) : ?> notifications-critical<?php endif; ?>" |
| 33 | + data-notification-id="<?= $block->escapeHtmlAttr($notification->getId()) ?>" |
| 34 | + data-notification-severity="<?php if ($notification->getSeverity() == 1) : ?>1<?php endif; ?>"> |
| 35 | + <?php |
| 36 | + $notificationDescription = $notification->getDescription(); |
| 37 | + $notificationDescriptionLength = $block->getNotificationDescriptionLength(); |
| 38 | + ?> |
| 39 | + <strong class="notifications-entry-title"> |
| 40 | + <?= $block->escapeHtml($notification->getTitle()) ?> |
| 41 | + </strong> |
| 42 | + <?php if (strlen($notificationDescription) > $notificationDescriptionLength) : ?> |
| 43 | + <p class="notifications-entry-description _cutted"> |
| 44 | + <span class="notifications-entry-description-start"> |
| 45 | + <?= $block->escapeHtml(substr($notificationDescription, 0, $notificationDescriptionLength)) ?> |
| 46 | + </span> |
| 47 | + <span class="notifications-entry-description-end"> |
| 48 | + <?= $block->escapeHtml(substr($notificationDescription, $notificationDescriptionLength)) ?> |
| 49 | + </span> |
| 50 | + </p> |
| 51 | + <?php else : ?> |
| 52 | + <p class="notifications-entry-description"> |
| 53 | + <?= $block->escapeHtml($notificationDescription) ?> |
| 54 | + </p> |
| 55 | + <?php endif; ?> |
| 56 | + <time class="notifications-entry-time"> |
| 57 | + <?= $block->escapeHtml($block->formatNotificationDate($notification->getDateAdded())) ?> |
| 58 | + </time> |
| 59 | + <button |
| 60 | + type="button" |
| 61 | + class="notifications-close" |
| 62 | + title="<?= $block->escapeHtmlAttr(__('Close')) ?>" |
| 63 | + ></button> |
| 64 | + </li> |
68 | 65 | <?php endforeach; ?> |
69 | 66 | <li class="notifications-entry notifications-entry-last"> |
70 | 67 | <a |
71 | | - href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>" |
| 68 | + href="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/index')) ?>" |
72 | 69 | class="action-tertiary action-more"> |
73 | | - <?= /* @escapeNotVerified */ __('See All (') ?><span class="notifications-counter"><?= /* @escapeNotVerified */ $notificationCount ?></span><?= /* @escapeNotVerified */ __(' unread)') ?> |
| 70 | + <?= $block->escapeHtml(__('See All (')) ?><span class="notifications-counter"><?= (int)$notificationCount ?></span><?= $block->escapeHtml(__(' unread)')) ?> |
74 | 71 | </a> |
75 | 72 | </li> |
76 | 73 | </ul> |
77 | 74 | <?php else : ?> |
78 | 75 | <a |
79 | 76 | class="notifications-action admin__action-dropdown" |
80 | | - href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>" |
81 | | - title="<?= /* @escapeNotVerified */ __('Notifications') ?>"> |
| 77 | + href="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/index')) ?>" |
| 78 | + title="<?= $block->escapeHtmlAttr(__('Notifications')) ?>"> |
82 | 79 | </a> |
83 | 80 | <?php endif; ?> |
84 | 81 | </div> |
0 commit comments