add compatibility for Joomla 3
Merge pull request #1 from davidjosephhayes/master

add compatibility for Joomla 3