3 declare(strict_types=1);
10 $factory = $DIC->ui()->factory();
11 $renderer = $DIC->ui()->renderer();
14 $post_wrapper = $DIC->http()->wrapper()->post();
17 $message =
'Are you sure you want to delete the following items?';
18 $ctrl->setParameterByClass(
'ilsystemstyledocumentationgui',
'modal_nr', 1);
19 $form_action = $ctrl->getFormActionByClass(
'ilsystemstyledocumentationgui');
20 $icon = $factory->image()->standard(
'./templates/default/images/standard/icon_crs.svg',
'');
21 $modal = $factory->modal()->interruptive(
'My Title',
$message, $form_action)
22 ->withAffectedItems(array(
23 $factory->modal()->interruptiveItem()->standard(
'10',
'Course 1', $icon,
'Some description text'),
24 $factory->modal()->interruptiveItem()->keyValue(
'20',
'Item Key',
'item value'),
25 $factory->modal()->interruptiveItem()->standard(
'30',
'Course 3', $icon,
'Last but not least, a description'),
26 $factory->modal()->interruptiveItem()->keyValue(
'50',
'Second Item Key',
'another item value'),
28 $button = $factory->button()->standard(
'Show Modal',
'')
29 ->withOnClick($modal->getShowSignal());
31 $out = [$button, $modal];
38 $panel = $factory->panel()->standard(
40 $factory->legacy(print_r($post_wrapper->retrieve(
'interruptive_items',
$refinery->kindlyTo()->string()),
true))
45 return $renderer->render(
$out);
show_modal_on_button_click()
Refinery Factory $refinery