ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  if ($page == "login") {
28  $legacy = $f->legacy("<p>The Login Page</p>");
29  $modal = $f->modal()->roundtrip("Login", [$button1, $button2, $legacy]);
30  }
31  if ($page == "register") {
32  $legacy = $f->legacy("<p>The Registration Page</p>");
33  $modal = $f->modal()->roundtrip("Registration", [$button1, $button2, $legacy]);
34  }
35 
36  echo $r->renderAsync([$modal]);
37  exit;
38  }
39 }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
global $DIC
Definition: saml.php:7
$_GET["client_id"]
$r
Definition: example_031.php:79
show_multi_step_modal()
exit
Definition: backend.php:16
$url