what ever happened AFTER the Jews built the temple. While King Salomon Temple was built in 960 BC The Dom of the Rock was built in 691CE and the El Aktsa in 720CE. All and all, Jerusalem was a Jewish city long before the Dom of the Rock and El Aktsa were built. Therefore, it is correct to say that the Muslims were the occupier and Israel took it back and not the opposite.
Rohani: Nuclear deal achieves Iran's goals (AP)
from the article: Lieberman: Jerusalem is our eternal capital, it will never be divided