ILIAS  release_7 Revision v7.30-3-g800a261c036
show_multi_step_modal.php
Go to the documentation of this file.
1<?php
3{
4 global $DIC;
5 $f = $DIC->ui()->factory();
6 $r = $DIC->ui()->renderer();
7
8 $url = $_SERVER['REQUEST_URI'];
9
10 $page = $_GET["page"];
11 if ($page == "") {
12 $modal = $f->modal()->roundtrip("Modal Title", $f->legacy("b"));
13 $asyncUrl = $url . '&page=login&replaceSignal=' . $modal->getReplaceSignal()->getId();
14 $modal = $modal->withAsyncRenderUrl($asyncUrl);
15 $button = $f->button()->standard("Sign In", '#')
16 ->withOnClick($modal->getShowSignal());
17 $content = $r->render([$modal, $button]);
18 return $content;
19 } else {
20 $signalId = $_GET['replaceSignal'];
21 $replaceSignal = new \ILIAS\UI\Implementation\Component\ReplaceSignal($signalId);
22 $button1 = $f->button()->standard('Login', '#')
23 ->withOnClick($replaceSignal->withAsyncRenderUrl($url . '&page=login&replaceSignal=' . $replaceSignal->getId()));
24 $button2 = $f->button()->standard('Registration', '#')
25 ->withOnClick($replaceSignal->withAsyncRenderUrl($url . '&page=register&replaceSignal=' . $replaceSignal->getId()));
26
27 $modal = null;
28 if ($page == "login") {
29 $legacy = $f->legacy("<p>The Login Page</p>");
30 $modal = $f->modal()->roundtrip("Login", [$button1, $button2, $legacy]);
31 }
32 if ($page == "register") {
33 $legacy = $f->legacy("<p>The Registration Page</p>");
34 $modal = $f->modal()->roundtrip("Registration", [$button1, $button2, $legacy]);
35 }
36
37 echo $r->renderAsync([$modal]);
38 exit;
39 }
40}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
global $DIC
Definition: goto.php:24
exit
Definition: login.php:29
$url
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
show_multi_step_modal()