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, $_POST, $_SERVER, $DIC, $factory, $i, $message, $out, and exit.
6 $renderer = $DIC->ui()->renderer();
8 $message =
'Are you sure you want to delete the following item?';
9 $ctrl->setParameterByClass(
'ilsystemstyledocumentationgui',
'modal_nr', 2);
10 $form_action = $ctrl->getFormActionByClass(
'ilsystemstyledocumentationgui');
11 $items = [
'First Item',
'Second Item',
'Third Item'];
14 if (isset(
$_GET[
'item'])) {
15 $item = $items[(int)
$_GET[
'item']];
16 $affected_item =
$factory->modal()->interruptiveItem((
int)
$_GET[
'item'], $item);
17 $modal =
$factory->modal()->interruptive(
'Delete Items',
$message, $form_action)
18 ->withAffectedItems([$affected_item]);
19 echo $renderer->render($modal);
25 foreach ($items as
$i => $item) {
26 $ajax_url =
$_SERVER[
'REQUEST_URI'] .
'&item=' .
$i;
27 $modal =
$factory->modal()->interruptive(
'',
'',
'')
28 ->withAsyncRenderUrl($ajax_url);
29 $button =
$factory->button()->standard(
'Delete ' . $item,
'#')
30 ->withOnClick($modal->getShowSignal());
36 if (isset(
$_POST[
'interruptive_items']) && @$_GET[
'modal_nr'] ===
'2') {
37 $panel =
$factory->panel()->standard(
44 return $renderer->render(
$out);