FIX escape & to &amp; for HTML output in view.php

This is a repost of r5354, with the double-encoding of the terms.php
url-parameter fixed. Additionally, the & before
'<?php echo hook("nextpreviousextraurl") ?>' is now escaped.

The goal of this patch is to bring view.php closer to a valid HTML5
document, so it is easier to see any remaining errors.

git-svn-id: http://svn.resourcespace.org/svn/resourcespace@5423 c08608d7-6e46-0410-86ca-f2a6f1370df5
FIX check if collection is writeable before adding to a collection or removing a saved search

Fixes issue #291.

git-svn-id: http://svn.resourcespace.org/svn/resourcespace@5424 c08608d7-6e46-0410-86ca-f2a6f1370df5