Fork from EXT:rgfolderselector to be compatible with TYPO3 6.x