Hide listing links that would go to empty pages

Migrated issue

Reported by: danielb

This is what I mean by sections:

Topics
Files
Globals
Constants
Functions
API Search

Only 'files' and 'functions' actually have content when you click the links - so what is the best way to hide the empty pages like 'globals' and 'constants'?

Also the search one just leads to a page that has the same thing as the block, and I haven't bothered to write up any 'topics' so I guess those links can go too.