[ticket/12169] Split mode==headline into it's own function

PHPBB3-12169