chg: [notifications] Support of modal when clicking on notification element
parent
38caafb76e
commit
249892c3e0
|
@ -102,14 +102,16 @@ class InboxTable extends AppTable
|
|||
$details = $notification->title;
|
||||
$router = [
|
||||
'controller' => 'inbox',
|
||||
'action' => 'index',
|
||||
'action' => 'process',
|
||||
'plugin' => null,
|
||||
$notification->id
|
||||
];
|
||||
$allNotifications[] = (new Notification($title, $router, [
|
||||
'icon' => 'envelope',
|
||||
'details' => $details,
|
||||
'datetime' => $notification->created,
|
||||
'variant' => 'warning',
|
||||
'_useModal' => true,
|
||||
]))->get();
|
||||
}
|
||||
return $allNotifications;
|
||||
|
|
|
@ -7,8 +7,12 @@ $datetimeMW = 90;
|
|||
$variant = empty($notification['variant']) ? 'primary' : $notification['variant'];
|
||||
?>
|
||||
<a
|
||||
class="dropdown-item px-2"
|
||||
href="<?= Router::url($notification['router']) ?>"
|
||||
class="dropdown-item px-2 btn"
|
||||
<?php if (empty($notification['_useModal'])): ?>
|
||||
href="<?= Router::url($notification['router']) ?>"
|
||||
<?php else: ?>
|
||||
onclick="UI.submissionModal('<?= Router::url($notification['router']) ?>', {closeOnSuccess: false})"
|
||||
<?php endif; ?>
|
||||
style="max-height: 76px;"
|
||||
title="<?= sprintf('%s:
 %s', $this->ValueGetter->get($notification['text']), $this->ValueGetter->get($notification['details'])) ?>"
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue