Controlled spontaneous-emission phenomena in semiconductor slabs with a two-dimensional photonic bandgap