3 declare(strict_types=1);
21 $factory = $DIC->ui()->factory();
25 $post_wrapper = $DIC->http()->wrapper()->post();
28 $message =
'Are you sure you want to delete the following items?';
29 $ctrl->setParameterByClass(
'ilsystemstyledocumentationgui',
'modal_nr', 1);
30 $form_action = $ctrl->getFormActionByClass(
'ilsystemstyledocumentationgui');
31 $icon = $factory->image()->standard(
'./assets/images/standard/icon_crs.svg',
'');
34 $factory->modal()->interruptiveItem()->standard(
'10',
'Course 1', $icon,
'Some description text'),
35 $factory->modal()->interruptiveItem()->keyValue(
'20',
'Item Key',
'item value'),
36 $factory->modal()->interruptiveItem()->standard(
'30',
'Course 3', $icon,
'Last but not least, a description'),
37 $factory->modal()->interruptiveItem()->keyValue(
'50',
'Second Item Key',
'another item value'),
39 $modal = $factory->modal()->interruptive(
'My Title', $message, $form_action)->withAffectedItems($items);
40 $button = $factory->button()->standard(
'Show Modal',
'')
41 ->withOnClick($modal->getShowSignal());
43 $out = [$button, $modal];
47 $post_wrapper->has(
'interruptive_items') &&
50 $out[] = $post_wrapper->retrieve(
'interruptive_items',
$refinery->custom()->transformation(
51 function ($item_keys) use ($factory, $post_wrapper) {
52 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.