A novel strain- and temperature-sensing mechanism based on dynamic grating in polarization-maintaining erbium-doped fiber