ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\UI\examples\Button\Month Namespace Reference

Functions

 base ()
 

Function Documentation

◆ base()

ILIAS\UI\examples\Button\Month\base ( )

description: > Example for rendering a dropdown button showing the default month/year while not opened and a selection of months while opened.

expected output: > ILIAS shows a month and year. On browsers that support type='month' inputs like Chrome or Safari on iPhone and iPad: Clicking the button will open a picker for other months and years which can be selected. Another click onto a month opens a dialog which confirms the click. In this dialog the selected month (e.g. 03-2020) is mentioned. On other browsers like Firefox and Safari on desktop: There might be a flicker while the browser loads the fallback solution. Then, the month can be changed through a select input dropdown and the year can be changed through a text input. On a valid input, a dialog will appear and mention the selected month (e.g. 03-2020). On an invalid year input (e.g. one or three digits), the year text field will be highlighted as invalid. A two-digit year input

e.g.'24' will be converted to a four-digit year e.g. '2024'.

Definition at line 41 of file base.php.

42{
43 global $DIC;
44 $f = $DIC->ui()->factory();
45 $renderer = $DIC->ui()->renderer();
46
47 return $renderer->render($f->button()->month("02-2017")->withOnLoadCode(function ($id) {
48 return "$(\"#$id\").on('il.ui.button.month.changed', function(el, id, month) { alert(\"Clicked: \" + id + ' with ' + month);});";
49 }));
50}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$renderer
global $DIC
Definition: shib_login.php:26

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