ILIAS 5.4 Evaluation
  • Anmelden
Screen-ID: sty/system_styles/documentation

Brotkrumen-Navigation

Dokumentation

'Kitchen Sink'-Dokumentation von Style: 'Delos' vom 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 and inactive states.
Effect
Clicking on an inactive Button turns this button active and all other inactive. Clicking on an active button has no effect.

Rules

Usage
  1. Exactly one Button MUST always be active.
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", ...
  4. The currently active Button must be labeled by setting aria-checked to "true".

Example 1: Base

/**
 * Only serving as Example
 */
function base()
{
    //Loading factories
    global $DIC;
    $f = $DIC->ui()->factory();
    $renderer = $DIC->ui()->renderer();
 
    //ViewControl element
    $actions = array(
        "Using ILIAS" => "http://www.ilias.de/docu/goto_docu_cat_580.html",
        "ILIAS Development" => "http://www.ilias.de/docu/goto.php?target=cat_582&client_id=docu",
        "ILIAS Community" => "http://www.ilias.de/docu/goto.php?target=cat_1444&client_id=docu"
    );
 
    $aria_label = "change_the_currently_displayed_mode";
    $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive("ILIAS Development");
    $html = $renderer->render($view_control);
 
    return $html;
}
 

Relations

Parents
  1. UIComponent
  2. View Control