Capillary condensation and hysteresis in disordered porous materials