fix(views): prevent output of empty heading when there is no page title

fixes #7387
See [PSR-2 section 5](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md#51-if-elseif-else). Our [style guide](http://learn.elgg.org/en/1.9/contribute/code.html#php-guidelines) is now based on PSR-2.