Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
toolbar_entry.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php ?>
11 <?php
12  $notificationCount = $block->getUnreadNotificationCount();
13  $notificationCounterMax = $block->getNotificationCounterMax();
14 ?>
15 <div
16  data-mage-init='{"toolbarEntry": {}}'
17  class="notifications-wrapper admin__action-dropdown-wrap"
18  data-notification-count="<?= /* @escapeNotVerified */ $notificationCount ?>">
19  <?php if ($notificationCount > 0) : ?>
20  <a
21  href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>"
22  class="notifications-action admin__action-dropdown"
23  data-mage-init='{"dropdown":{}}'
24  title="<?= /* @escapeNotVerified */ __('Notifications') ?>"
25  data-toggle="dropdown">
26  <span class="notifications-counter">
27  <?= /* @escapeNotVerified */ ($notificationCount > $notificationCounterMax) ? $notificationCounterMax . '+' : $notificationCount ?>
28  </span>
29  </a>
30  <ul
31  class="admin__action-dropdown-menu"
32  data-mark-as-read-url="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/ajaxMarkAsRead') ?>">
33  <?php foreach ($block->getLatestUnreadNotifications() as $notification) : ?>
34  <?php ?>
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>
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>
68  <?php endforeach; ?>
69  <li class="notifications-entry notifications-entry-last">
70  <a
71  href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>"
72  class="action-tertiary action-more">
73  <?= /* @escapeNotVerified */ __('See All (') ?><span class="notifications-counter"><?= /* @escapeNotVerified */ $notificationCount ?></span><?= /* @escapeNotVerified */ __(' unread)') ?>
74  </a>
75  </li>
76  </ul>
77  <?php else : ?>
78  <a
79  class="notifications-action admin__action-dropdown"
80  href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>"
81  title="<?= /* @escapeNotVerified */ __('Notifications') ?>">
82  </a>
83  <?php endif; ?>
84 </div>
if( $form)() ?>< script > require(['jquery' mage mage
Definition: save.phtml:15
__()
Definition: __.php:13
$block
Definition: block.php:8
if( $notificationCount > 0)( 'adminhtml/notification/index') ?>" classforeach ($block->getLatestUnreadNotifications() as $notification) ( $notification->getSeverity()==1) if ( $notification->getSeverity()==1) $notificationDescription
$notificationDescriptionLength
if(strlen( $notificationDescription) > $notificationDescriptionLength)( $notificationDescription, 0, $notificationDescriptionLength) ?></span >< span class else
endforeach
endif
Definition: 404.phtml:116
$notificationCount
$notificationCounterMax