Calculation of static and dynamic linear magnetic response in approximate time-dependent density functional theory.