ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\UI\examples\Dropdown\Standard Namespace Reference

Functions

 with_aria_label ()
 

description: > Example for rendering a dropdown with aria labels More...

 
 with_buttons_and_links ()
 

description: > Example for rendering a dropdown with buttons and links More...

 
 with_divider ()
 

description: > Example for rendering a dropdown with dividers More...

 
 with_divider_with_label ()
 

description: > Example for rendering a dropdown with a divider including a label More...

 

Function Documentation

◆ with_aria_label()

ILIAS\UI\examples\Dropdown\Standard\with_aria_label ( )


description: > Example for rendering a dropdown with aria labels

expected output: > ILIAS shows base dropdown button without a title. Clicking the button will open a dropdown menu with two entries rendered as shy buttons. Clicking the entries will open the

appropriate website in the same browser window.

Definition at line 34 of file with_aria_label.php.

References $DIC, Vendor\Package\$f, and $renderer.

35 {
36  global $DIC;
37  $f = $DIC->ui()->factory();
38  $renderer = $DIC->ui()->renderer();
39 
40  $items = array(
41  $f->button()->shy("GitHub", "https://www.github.com"),
42  $f->button()->shy("Bugs", "https://mantis.ilias.de"),
43  );
44  return $renderer->render($f->dropdown()->standard($items)->withAriaLabel("MyLabel"));
45 }
$renderer
global $DIC
Definition: shib_login.php:26

◆ with_buttons_and_links()

ILIAS\UI\examples\Dropdown\Standard\with_buttons_and_links ( )


description: > Example for rendering a dropdown with buttons and links

expected output: > ILIAS shows a base dropdown button. Clicking the button will open a dropdown menu with the entries "ILIAS" rendered as a link and "GitHub" rendered as a shy button. Clicking the shy button will open the appropriate website in the same browser window while clicking the link will open the appropriate website in a new browser tab. One entry reads "An unavailable action" with a dull design to

indicate inactivity. Clicking it does nothing.

Definition at line 36 of file with_buttons_and_links.php.

References $DIC, Vendor\Package\$f, and $renderer.

37 {
38  global $DIC;
39  $f = $DIC->ui()->factory();
40  $renderer = $DIC->ui()->renderer();
41 
42  $items = array(
43  $f->button()->shy("Github", "https://www.github.com"),
44  $f->button()->shy("An unavailable action", "#")->withUnavailableAction(),
45  $f->link()->standard("ILIAS", "https://www.ilias.de")->withOpenInNewViewport(true)
46  );
47  return $renderer->render($f->dropdown()->standard($items)->withLabel("Actions"));
48 }
$renderer
global $DIC
Definition: shib_login.php:26

◆ with_divider()

ILIAS\UI\examples\Dropdown\Standard\with_divider ( )


description: > Example for rendering a dropdown with dividers

expected output: > ILIAS shows a base dropdown button. Clicking the button will open a dropdown menu with entries divided by a fine line.

Clicking the entries will open the appropriate website in the same browser window.

Definition at line 34 of file with_divider.php.

References $DIC, Vendor\Package\$f, and $renderer.

35 {
36  global $DIC;
37  $f = $DIC->ui()->factory();
38  $renderer = $DIC->ui()->renderer();
39 
40  $items = array(
41  $f->button()->shy("ILIAS", "https://www.ilias.de"),
42  $f->divider()->horizontal(),
43  $f->button()->shy("GitHub", "https://www.github.com")
44  );
45  return $renderer->render($f->dropdown()->standard($items)->withLabel("Actions"));
46 }
$renderer
global $DIC
Definition: shib_login.php:26

◆ with_divider_with_label()

ILIAS\UI\examples\Dropdown\Standard\with_divider_with_label ( )


description: > Example for rendering a dropdown with a divider including a label

expected output: > ILIAS shows a base dropdown button. Clicking the button will open a dropdown menu with entries. The last three entries are positioned under the not clickable caption "ILIAS".

Clicking the entries will open the appropriate website in the same browser window.

Definition at line 34 of file with_divider_with_label.php.

References $DIC, Vendor\Package\$f, and $renderer.

35 {
36  global $DIC;
37  $f = $DIC->ui()->factory();
38  $renderer = $DIC->ui()->renderer();
39 
40  $items = array(
41  $f->button()->shy("GitHub", "https://www.github.com"),
42  $f->divider()->horizontal()->withLabel("ILIAS"),
43  $f->button()->shy("Docu", "https://www.ilias.de"),
44  $f->button()->shy("Features", "https://feature.ilias.de"),
45  $f->button()->shy("Bugs", "https://mantis.ilias.de"),
46  );
47  return $renderer->render($f->dropdown()->standard($items)->withLabel("Actions"));
48 }
$renderer
global $DIC
Definition: shib_login.php:26