Improve load of course list and update icons - refs #7275

Sadly, the way the function was built prevents the $action variable to be set correctly in the calling context. I have had to change that in a future commit