19 declare(strict_types=1);
37 $factory = $DIC->ui()->factory();
41 $post_wrapper = $DIC->http()->wrapper()->post();
44 $message =
'Are you sure you want to delete the following items?';
45 $ctrl->setParameterByClass(
'ilsystemstyledocumentationgui',
'modal_nr', 1);
46 $form_action = $ctrl->getFormActionByClass(
'ilsystemstyledocumentationgui');
47 $icon = $factory->image()->standard(
'./assets/images/standard/icon_crs.svg',
'');
50 $factory->modal()->interruptiveItem()->standard(
'10',
'Course 1', $icon,
'Some description text'),
51 $factory->modal()->interruptiveItem()->keyValue(
'20',
'Item Key',
'item value'),
52 $factory->modal()->interruptiveItem()->standard(
'30',
'Course 3', $icon,
'Last but not least, a description'),
53 $factory->modal()->interruptiveItem()->keyValue(
'50',
'Second Item Key',
'another item value'),
55 $modal = $factory->modal()->interruptive(
'My Title',
$message, $form_action)->withAffectedItems($items);
56 $button = $factory->button()->standard(
'Show Modal',
'')
57 ->withOnClick($modal->getShowSignal());
59 $out = [$button, $modal];
63 $post_wrapper->has(
'interruptive_items') &&
66 $out[] = $post_wrapper->retrieve(
'interruptive_items',
$refinery->custom()->transformation(
67 function ($item_keys) use ($factory, $post_wrapper) {
68 return $factory->panel()->standard(
'Items deleted', $factory->legacy(
"Number of items deleted: ".count($item_keys)));
show_modal_on_button_click()
description: > Example for rendering a interruptive modal on a click onto a button.