33    $f = 
$DIC->ui()->factory();
 
   34    $renderer = 
$DIC->ui()->renderer();
 
   37    $icon = 
$f->symbol()->icon()->standard(
"chtr", 
"chtr");
 
   38    $title = 
$f->link()->standard(
"Some Title", 
"#");
 
   39    $item = 
$f->item()->notification($title, $icon);
 
   43    $async_close = 
$_SERVER[
'REQUEST_URI'] . 
'&close_item=true&async_load_replace=false&async_load_replace_content=false&async_add_aggregate=false';
 
   45    $closable_item = $item->withCloseAction($async_close);
 
   47    $async_replace_url = 
$_SERVER[
'REQUEST_URI'] . 
'&close_item=false&async_load_replace=true&async_load_replace_content=false&async_add_aggregate=false';
 
   49    $async_replace_content_load_url = 
$_SERVER[
'REQUEST_URI'] . 
'&close_item=false&async_load_replace=false&async_load_replace_content=true&async_add_aggregate=false';
 
   51    $async_add_aggregate = 
$_SERVER[
'REQUEST_URI'] . 
'&close_item=false&async_load_replace=false&async_load_replace_content=false&async_add_aggregate=true';
 
   53    if (
$_GET[
'close_item'] === 
"true") {
 
   55        $js = 
$f->legacy(
"")->withOnLoadCode(
function ($id) use ($async_replace_content_load_url) {
 
   57                il.DemoScopeRemaining--; 
   58                il.DemoScopeItem.replaceContentByAsyncItemContent('$async_replace_content_load_url',{remaining: il.DemoScopeRemaining,added: il.DemoScopeAdded}); 
   61        echo $renderer->renderAsync($js);
 
   65    if (
$_GET[
'async_load_replace'] === 
"true") {
 
   66        $remaining = 
$_GET[
"remaining"];
 
   67        $added = 
$_GET[
"added"];
 
   72        for (
$i = 1; 
$i < $added + 1; 
$i++) {
 
   73            $items[] = $closable_item->withDescription(
"This item is number: " . 
$i . 
" of a fix set of 10 entries.");
 
   75        $replacement = $item->withDescription(
"Number of Async non-closed Aggregates: " . $remaining . 
", totally created: " . $added)
 
   76            ->withAggregateNotifications($items);
 
   78        echo $renderer->renderAsync([$replacement]);
 
   82    if (
$_GET[
'async_load_replace_content'] === 
"true") {
 
   83        $remaining = 
$_GET[
"remaining"];
 
   84        $added = 
$_GET[
"added"];
 
   85        $replacement = $item->withDescription(
"Number of Async non-closed Aggregates: " . $remaining . 
", totally created: " . $added);
 
   86        echo $renderer->renderAsync([$replacement]);
 
   90    if (
$_GET[
'async_add_aggregate'] === 
"true") {
 
   91        $remaining = 
$_GET[
"remaining"];
 
   92        $added = 
$_GET[
"added"];
 
   94        $new_aggregate = $closable_item->withDescription(
"The item has been added, Nr: " . $added);
 
   96        echo $renderer->renderAsync([$new_aggregate]);
 
  103    $add_button = 
$f->button()->standard(
"Add Chat Notification", 
"#")
 
  104                    ->withAdditionalOnLoadCode(
function ($id) use ($async_replace_url, $async_add_aggregate) {
 
  106                            $('#$id').click(function() { 
  107                                il.DemoScopeItem.getCounterObjectIfAny().incrementNoveltyCount(1); 
  109                                il.DemoScopeRemaining++; 
  110                                il.DemoScopeItem.addAsyncAggregate('$async_add_aggregate',{remaining: il.DemoScopeAdded,added: il.DemoScopeAdded}); 
  111                                il.DemoScopeItem.replaceContentByAsyncItemContent('$async_replace_url',{remaining: il.DemoScopeRemaining,added: il.DemoScopeAdded}); 
  116    $reset_button = 
$f->button()->standard(
"Reset Chat", 
"#")
 
  117                      ->withAdditionalOnLoadCode(
function ($id) use ($async_replace_url) {
 
  119                            $('#$id').click(function() { 
  120                                il.DemoScopeItem.getCounterObjectIfAny().decrementNoveltyCount(il.DemoScopeRemaining); 
  121                                il.DemoScopeAdded = 0; 
  122                                il.DemoScopeRemaining = 0; 
  123                                il.DemoScopeItem.replaceByAsyncItem('$async_replace_url',{remaining: il.DemoScopeAdded,added: il.DemoScopeAdded}); 
  128    $set_button = 
$f->button()->standard(
"Set to 10 chat entries", 
"#")
 
  129                    ->withAdditionalOnLoadCode(
function ($id) use ($async_replace_url) {
 
  131                            $('#$id').click(function() { 
  132                                il.DemoScopeItem.getCounterObjectIfAny().decrementNoveltyCount(il.DemoScopeRemaining); 
  133                                il.DemoScopeItem.getCounterObjectIfAny().incrementNoveltyCount(10); 
  134                                il.DemoScopeAdded = 10; 
  135                                il.DemoScopeRemaining = 10; 
  136                                il.DemoScopeItem.replaceByAsyncItem('$async_replace_url',{remaining: il.DemoScopeAdded,added: il.DemoScopeAdded}); 
  146        ->withDescription(
"This is the original Version after the Page has loaded. Will be replaced completely.")
 
  147        ->withAdditionalOnLoadCode(
function ($id) {
 
  149                il.DemoScopeAdded = 0; 
  150                il.DemoScopeRemaining = 0; 
  151                il.DemoScopeItem = il.UI.item.notification.getNotificationItemObject($($id)); 
  166    $async_slate = 
$f->mainControls()->slate()->notification(
"Chat", [$async_item]);
 
  170    $mail_icon = 
$f->symbol()->icon()->standard(
"mail", 
"mail");
 
  171    $mail_title = 
$f->link()->standard(
"Inbox", 
"link_to_inbox");
 
  172    $mail_notification_item = 
$f->item()->notification($mail_title, $mail_icon)
 
  173                                ->withDescription(
"You have 23 unread mails in your inbox")
 
  174                                ->withProperties([
"Time" => 
"3 days ago"]);
 
  175    $mail_slate = 
$f->mainControls()->slate()->notification(
"Mail", [$mail_notification_item]);
 
  179    $notification_glyph = 
$f->symbol()->glyph()->notification(
"notification", 
"notification")
 
  180                            ->withCounter(
$f->counter()->novelty(1));
 
  182    $notification_center = 
$f->mainControls()->slate()
 
  183                             ->combined(
"Notification Center", $notification_glyph)
 
  184                             ->withAdditionalEntry($async_slate)
 
  185                             ->withAdditionalEntry($mail_slate);
 
  187    $css_fix = 
"<style>.panel-primary .il-maincontrols-metabar{flex-direction: column;} .panel-primary .il-metabar-slates{position: relative;top: 0px;}</style>";
 
  193    $help = 
$f->button()->bulky(
$f->symbol()->glyph()->help(), 
'Help', 
'#');
 
  194    $search = 
$f->button()->bulky(
$f->symbol()->glyph()->search(), 
'Search', 
'#');
 
  195    $user = 
$f->button()->bulky(
$f->symbol()->glyph()->user(), 
'User', 
'#');
 
  198    $metabar = 
$f->mainControls()->metabar()
 
  199                 ->withAdditionalEntry(
'search', $search)
 
  200                 ->withAdditionalEntry(
'help', $help)
 
  201                 ->withAdditionalEntry(
'notification', $notification_center)
 
  202                 ->withAdditionalEntry(
'user', $user);
 
An exception for terminatinating execution or to throw for unit testing.
usuallyDoneByGlobalScreenProbablyIgnore($async_item, $f, $renderer, $add_button, $set_button, $reset_button)
extended_notifications()
This is a rather extended example on the usage of the Notification Item async functionality provided ...
buildMetabarWithNotifications($f, $notification_center)