author: A. Schempp
updated for use in contao 3.x