This could be more refactored, but I think this component needs to be completly refactored for ZF3, so consider it a patch in the meantime.