Theory of spin-polarized transport in inhomogeneous magnetic semiconductors