Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

81 строка
4.3 KiB

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