ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
async.php File Reference

Go to the source code of this file.

Functions

 async ()
 

Function Documentation

◆ async()

bool Indicates if form is ilAsyncPropertyFormGUI::async ( )

Definition at line 2 of file async.php.

3{
4 global $DIC;
5 $f = $DIC->ui()->factory();
6 $renderer = $DIC->ui()->renderer();
7
8 $async_close = $_SERVER['REQUEST_URI'] . '&close_item=true';
9 $async_replace_url = $_SERVER['REQUEST_URI'] . '&async_load_replace=true';
10 $async_replace_content_load_url = $_SERVER['REQUEST_URI'] . '&async_load_replace_content=true';
11
12 //Creating a Mail Notification Item
13 $icon = $f->symbol()->icon()->standard("chtr", "chtr");
14 $title = $f->link()->standard("Some Title", "#");
15 $item = $f->item()->notification($title, $icon)->withCloseAction($async_close);
16
17 $async_item = $item->withAggregateNotifications([$item->withDescription("Original Item")]);
18
19 if ($_GET['async_load_replace']) {
20 $replacement = $async_item
21 ->withDescription("The Item has been replaced Async.")
22 ->withAggregateNotifications([$item->withDescription("This is a freshly async delivered Item.")
23 ,$item->withDescription("And a second one")]);
24 echo $renderer->renderAsync([$replacement]);
25 exit;
26 }
27
28 if ($_GET['async_load_replace_content']) {
29 $replacement = $async_item
30 ->withDescription("The content of the Item has been replaced Async.")
31 ->withAggregateNotifications([$item->withDescription("You will never see this")]);
32 echo $renderer->renderAsync($replacement);
33 exit;
34 }
35
36 $async_replace = $async_item
37 ->withDescription("The complete Item will be replaced Async")
38 ->withAdditionalOnLoadCode(function ($id) use ($async_replace_url) {
39 return "
40 var item = il.UI.item.notification.getNotificationItemObject($($id));
41 item.replaceByAsyncItem('$async_replace_url',{});
42 ";
43 });
44
45 $async_replace_content = $async_item
46 ->withDescription("The content of the Item will be replaced Async")
47 ->withAdditionalOnLoadCode(function ($id) use ($async_replace_content_load_url) {
48 return "
49 var item = il.UI.item.notification.getNotificationItemObject($($id));
50 item.replaceContentByAsyncItemContent('$async_replace_content_load_url',{});
51 ";
52 });
53
54 return $renderer->render([$async_replace,$async_replace_content]);
55}
$_GET["client_id"]
exit
Definition: login.php:29
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$DIC
Definition: xapitoken.php:46

References $_GET, $_SERVER, $DIC, Vendor\Package\$f, and exit.