Ising M-p-spin mean-field model for the structural glass: Continuous versus discontinuous transition