Added the attributes array to the icon display code

This is the Joomla 3 equivalent PR for this Joomla 2.5 PR:
https://github.com/joomla/joomla-cms/pull/925