Moved the display of links to previous, next and index page to PHP.

Change-Id: I58983f1bd4300d599e9e6787d50b2495af315e9d