ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
13 function base()
14 {
15  global $DIC;
16  $ui_factory = $DIC->ui()->factory();
17  $data_factory = new \ILIAS\Data\Factory();
18  $renderer = $DIC->ui()->renderer();
19  $spacer = $ui_factory->divider()->horizontal();
20 
21  $url = $data_factory->uri($DIC->http()->request()->getUri()->__toString());
22 
23  $target = $data_factory->link('Start Test', $url);
24  $launcher = $ui_factory->launcher()
25  ->inline($target)
26  ->withDescription('<p>You will have <strong>90 minutes to answer all questions.</strong></p><p>Please make sure that you have the time to complete the test and that you will be undisturbed. There is no way for you to pause or re-take this test.</p>');
27 
28  $icon = $ui_factory->symbol()->icon()->standard('ps', '', 'large');
29 
30  $status_message = $ui_factory->messageBox()->failure("You have to complete all preconditions first.")
31  ->withLinks([
32  $ui_factory->link()->standard("Do this first", "#"),
33  $ui_factory->link()->standard("And this is mandatory, too", "#")
34  ]);
35 
36  $launcher2 = $launcher
37  ->withDescription('<p>This course goes into advanced knowledge for students preparing for the final exam. You should have a firm understanding of the basics before enrolling.</p>')
38  ->withButtonLabel('Course is locked', false)
39  ->withStatusIcon($icon)
40  ->withStatusMessageBox($status_message);
41 
42  $target = $data_factory->link('Continue Survey', $url);
43  $progressmeter = $ui_factory->chart()->progressMeter()->mini(100, 50, 100);
44  $status_message = $ui_factory->messageBox()->info("There are still 8 questions left in the survey.");
45  $launcher3 = $ui_factory->launcher()
46  ->inline($target)
47  ->withStatusIcon($progressmeter)
48  ->withStatusMessageBox($status_message)
49  ->withDescription('');
50 
51  $target = $data_factory->link('Repeat Test', $url);
52  $status_message = $ui_factory->messageBox()->success("You have completed this test already. If you want you can try it again.");
53  $icon = $ui_factory->symbol()->icon()->standard('task', '', 'large');
54  $launcher4 = $ui_factory->launcher()
55  ->inline($target)
56  ->withStatusIcon($icon)
57  ->withStatusMessageBox($status_message);
58 
59  return $renderer->render([
60  $launcher,
61  $spacer,
62  $launcher2,
63  $spacer,
64  $launcher3,
65  $spacer,
66  $launcher4
67  ]);
68 }
$renderer
base()
expected output: > ILIAS shows the rendered Component.
Definition: base.php:13
$url
Definition: shib_logout.php:63
global $DIC
Definition: shib_login.php:25