Core-Level line shapes of adsorbates: effects of electronic and vibrational excitations