bugfix ($this not allowed in closure); +2 more fixes

bugfixes for:
* Using $this when not in object context
* printfooter inserted twice
* searchbar contains invalid HTML

Change-Id: I7d9099399df886c61adb1cf8e3de8cf7d0d95824