Go to the source code of this file.
◆ show_modal_on_button_click_async_rendered()
show_modal_on_button_click_async_rendered |
( |
| ) |
|
Definition at line 2 of file show_modal_on_button_click_async_rendered.php.
References $_GET, $_SERVER, $DIC, $factory, $i, $message, $out, and exit.
6 $renderer = $DIC->ui()->renderer();
7 $message =
'Are you sure you want to delete the following item?';
8 $form_action = $DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
9 $items = [
'First Item',
'Second Item',
'Third Item'];
12 if (isset(
$_GET[
'item'])) {
13 $item = $items[(int)
$_GET[
'item']];
14 $affected_item =
$factory->modal()->interruptiveItem((
int)
$_GET[
'item'], $item);
15 $modal =
$factory->modal()->interruptive(
'Delete Items',
$message, $form_action)
16 ->withAffectedItems([$affected_item]);
17 echo $renderer->render($modal);
23 foreach ($items as
$i => $item) {
24 $ajax_url =
$_SERVER[
'REQUEST_URI'] .
'&item=' .
$i;
25 $modal =
$factory->modal()->interruptive(
'',
'',
'')
26 ->withAsyncRenderUrl($ajax_url);
27 $button =
$factory->button()->standard(
'Delete ' . $item,
'#')
28 ->withOnClick($modal->getShowSignal());
29 $out .=
' ' . $renderer->render([$button, $modal]);
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
catch(Exception $e) $message