ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
async.php
Go to the documentation of this file.
1<?php
2//Async example show-casing how this control can be used, without reloading the page
3function async()
4{
5 //Loading factories
6 global $DIC;
7 $f = $DIC->ui()->factory();
8 $renderer = $DIC->ui()->renderer();
9
10 //Initializing the options, note that the label is taken care of by JS
11 $options = [
12 'default_option' => 'Default Ordering',
13 'latest' => 'Most Recent Ordering',
14 'oldest' => 'Oldest Ordering'
15 ];
16
17 //Note that the selected option needs to be displayed in the label
18 $select_option = 'default_option';
19 if ($_GET['sortation']) {
20 $select_option = $_GET['sortation'];
21 }
22
23 //Generation of the UI Component
24 $modal = $f->modal()->lightbox($f->modal()->lightboxTextPage('Note: This is just used to show case, how
25 this control can be used,to change an other components content.', "Sortation has changed: " . $options[$_GET['sortation']]));
26 $s = $f->viewControl()->sortation($options)
27 ->withTargetURL($DIC->http()->request()->getRequestTarget(), 'sortation')
28 ->withLabel($options[$select_option])
29 ->withOnSort($modal->getShowSignal());
30
31 //Rendering
32 return $renderer->render([$s,$modal]);
33}
async()
Definition: async.php:2
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
$DIC
Definition: xapitoken.php:46