ILIAS  release_7 Revision v7.30-3-g800a261c036
base.php File Reference

Go to the source code of this file.

Functions

 base ()
 

Function Documentation

◆ base()

base ( )

Definition at line 3 of file base.php.

4{
5 //Loading factories
6 global $DIC;
7 $f = $DIC->ui()->factory();
8 $renderer = $DIC->ui()->renderer();
9
10 //Some Target magic to get a behaviour closer to some real use case
11 $target = $DIC->http()->request()->getRequestTarget();
12 $param = "Section";
13 $active = 0;
14 if ($_GET[$param]) {
15 $active = $_GET[$param];
16 }
17
18 //Here the real magic to draw the controls
19 $back = $f->button()->standard("Back", "$target&$param=" . ($active - 1));
20 $next = $f->button()->standard("Next" . " " . ($active - 1), "$target&$param=" . ($active + 1));
21 $middle = $f->button()->standard("Go to Engaged Section (Current Section: $active)", "$target&$param=0");
22 //Note that the if the middle button needs to be engaged by the surrounding component, as so, if need to be drawn
23 //as engaged. This can e.g. be the case for rendering a button labeled "Today" or similar.
24 if ($active == 0) {
25 $middle = $middle->withLabel("Engaged Section")->withEngagedState(true);
26 }
27 $view_control_section = $f->viewControl()->section($back, $middle, $next);
28 $html = $renderer->render($view_control_section);
29 return $html;
30}
$_GET["client_id"]
global $DIC
Definition: goto.php:24
$param
Definition: xapitoken.php:29

References $_GET, $DIC, Vendor\Package\$f, and $param.