Handling of userfiles, images and downloads is probably not necessary, as this should already be handled by the filebrowser. Otherwise media had to be handled also.
Change the DIVs to SPANs and require the $tooltip to be an inline fragment (requires block level elements to be removed from all help texts–even $plugin_tx).