25. Internationale ILIAS-Konferenz

Development Guide

Please note: This document is no longer actively maintained. For up-to-date information, please refer to the documentation on GitHub and the collection of development how-tos here.

Modal

This component has been moved to the Kitchen Sink. See: Kitchen Sink Documentation

ILIAS 5.0 integrates the bootstrap UI framework. Bootstrap supports modal dialogs as UI components. In the past some ILIAS features made use of YUI panels. These should be replaced by bootstrap modals.

Rendering the content of the modal on server side:

1
2
3
4
5
6
include_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
$modal = ilModalGUI::getInstance();
$modal->setHeading($lng->txt("..."));
$modal->setId("ilMyModal");
$modal->setBody($my_content);
$tpl->setVariable("MY_MODAL", $modal->getHTML());

Showing/hiding the modal on client side:

1
2
3
$('#ilIntLinkModal').modal('show');
...
$('#ilIntLinkModal').modal('hide');