Bitte zum Testen nur aktuelle Browser verwenden! ILIAS unterstützt alle aktuellen Browser wie z.B. Firefox, Safari, Microsoft Edge, Chrome und Chromium. Der von Micosoft nicht mehr unterstützte und weiterentwickelte 'Internet Explorer' kann nicht zum Testen von ILIAS 7 verwendet werden.
Testers are the best!

Documentation

Kitchen Sink documentation of style: 'Delos' of skin: 'ILIAS'

Mode

Description

Purpose
Mode View Controls enable the switching between different aspects of some data. The different modes are mutually exclusive and can therefore not be activated at once.
Composition
Mode View Controls are composed of Buttons switching between active/engaged and inactive states.
Effect
Clicking on an inactive Button turns this button active/engaged and all other inactive. Clicking on an active/engaged button has no effect.

Rules

Usage
  1. Exactly one Button MUST always be active/engaged.
Accessibility
  1. The HTML container enclosing the buttons of the Mode View Control MUST cary the role-attribute "group".
  2. The HTML container enclosing the buttons of the Mode View Control MUST set an aria-label describing the element. Eg. "Mode View Control"
  3. The Buttons of the Mode View Control MUST set an aria-label clearly describing what the button shows if clicked. E.g. "List View", "Month View", ...

Example 1: Base

/**
 * Base example performing a page reload if active view is changed.
 */
function base()
{
    //Loading factories
    global $DIC;
    $f = $DIC->ui()->factory();
    $renderer = $DIC->ui()->renderer();
 
    //Some Target magic to get a behaviour closer to some real use case
    $target = $DIC->http()->request()->getRequestTarget();
    $param = "Mode";
 
    $active = 1;
    if ($_GET[$param]) {
        $active = $_GET[$param];
    }
 
    //Here the real magic to draw the controls
    $actions = array(
        "$param 1" => "$target&$param=1",
        "$param 2" => "$target&$param=2",
        "$param 3" => "$target&$param=3",
    );
 
    $aria_label = "change_the_currently_displayed_mode";
    $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive("$param $active");
    $html = $renderer->render($view_control);
 
    return $html;
}
 

Relations

Parents
  1. UIComponent
  2. View Control