ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
base.php
Go to the documentation of this file.
1 <?php
5 function base()
6 {
7  //Loading factories
8  global $DIC;
9  $f = $DIC->ui()->factory();
10  $renderer = $DIC->ui()->renderer();
11 
12  //Some Target magic to get a behaviour closer to some real use case
13  $target = $DIC->http()->request()->getRequestTarget();
14  $param = "Mode";
15 
16  $active = 1;
17  if ($_GET[$param]) {
18  $active = $_GET[$param];
19  }
20 
21  //Here the real magic to draw the controls
22  $actions = array(
23  "$param 1" => "$target&$param=1",
24  "$param 2" => "$target&$param=2",
25  "$param 3" => "$target&$param=3",
26  );
27 
28  $aria_label = "change_the_currently_displayed_mode";
29  $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive("$param $active");
30  $html = $renderer->render($view_control);
31 
32  return $html;
33 }
$_GET["client_id"]
base()
Definition: base.php:4
$param
Definition: xapitoken.php:29
global $DIC
Definition: goto.php:24