Ensure ajax type is set for legacy calls

This sets type=ajax for all legacy requests using ajax.php as entrypoint.
Merge pull request #2092 from Guite/1.4

Ensure ajax type is set for legacy calls