MDL-42318 coursecat: do not allow to sort if there are invisible children
MDL-42318 coursecat: show correct courses count

courses count should exclude courses that are not visible to the current user