ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
base.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29function base()
30{
31 global $DIC;
32 $ui_factory = $DIC->ui()->factory();
33 $data_factory = new \ILIAS\Data\Factory();
34 $renderer = $DIC->ui()->renderer();
35 $spacer = $ui_factory->divider()->horizontal();
36
37 $url = $data_factory->uri($DIC->http()->request()->getUri()->__toString());
38
39 $target = $data_factory->link('Start Test', $url);
40 $launcher = $ui_factory->launcher()
41 ->inline($target)
42 ->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>');
43
44 $icon = $ui_factory->symbol()->icon()->standard('ps', '', 'large');
45
46 $status_message = $ui_factory->messageBox()->failure("You have to complete all preconditions first.")
47 ->withLinks([
48 $ui_factory->link()->standard("Do this first", "#"),
49 $ui_factory->link()->standard("And this is mandatory, too", "#")
50 ]);
51
52 $launcher2 = $launcher
53 ->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>')
54 ->withButtonLabel('Course is locked', false)
55 ->withStatusIcon($icon)
56 ->withStatusMessageBox($status_message);
57
58 $target = $data_factory->link('Continue Survey', $url);
59 $progressmeter = $ui_factory->chart()->progressMeter()->mini(100, 50, 100);
60 $status_message = $ui_factory->messageBox()->info("There are still 8 questions left in the survey.");
61 $launcher3 = $ui_factory->launcher()
62 ->inline($target)
63 ->withStatusIcon($progressmeter)
64 ->withStatusMessageBox($status_message)
65 ->withDescription('');
66
67 $target = $data_factory->link('Repeat Test', $url);
68 $status_message = $ui_factory->messageBox()->success("You have completed this test already. If you want you can try it again.");
69 $icon = $ui_factory->symbol()->icon()->standard('task', '', 'large');
70 $launcher4 = $ui_factory->launcher()
71 ->inline($target)
72 ->withStatusIcon($icon)
73 ->withStatusMessageBox($status_message);
74
75 return $renderer->render([
76 $launcher,
77 $spacer,
78 $launcher2,
79 $spacer,
80 $launcher3,
81 $spacer,
82 $launcher4
83 ]);
84}
$renderer
global $DIC
Definition: shib_login.php:26
$url
Definition: shib_logout.php:68