ILIAS  release_7 Revision v7.30-3-g800a261c036
show_modal_on_button_click.php
Go to the documentation of this file.
1<?php
3{
4 global $DIC;
5 $factory = $DIC->ui()->factory();
6 $renderer = $DIC->ui()->renderer();
7 $ctrl = $DIC->ctrl();
8 $message = 'Are you sure you want to delete the following items?';
9 $ctrl->setParameterByClass('ilsystemstyledocumentationgui', 'modal_nr', 1);
10 $form_action = $ctrl->getFormActionByClass('ilsystemstyledocumentationgui');
11 $icon = $factory->image()->standard('./templates/default/images/icon_crs.svg', '');
12 $modal = $factory->modal()->interruptive('My Title', $message, $form_action)
13 ->withAffectedItems(array(
14 $factory->modal()->interruptiveItem(10, 'Course 1', $icon, 'Some description text'),
15 $factory->modal()->interruptiveItem(20, 'Course 2', $icon, 'Another description text'),
16 $factory->modal()->interruptiveItem(30, 'Course 3', $icon, 'Last but not least, a description'),
17 ));
18 $button = $factory->button()->standard('Show Modal', '')
19 ->withOnClick($modal->getShowSignal());
20
21 $out = [$button, $modal];
22
23 // Display POST data of affected items in a panel
24 if (isset($_POST['interruptive_items']) && $_GET['modal_nr'] === '1') {
25 $panel = $factory->panel()->standard(
26 'Affected Items',
27 $factory->legacy(print_r($_POST['interruptive_items'], true))
28 );
29 $out[] = $panel;
30 }
31
32 return $renderer->render($out);
33}
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
global $DIC
Definition: goto.php:24
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:138
$factory
Definition: metadata.php:58
show_modal_on_button_click()
$message
Definition: xapiexit.php:14