Added a Joomla 3.1 compatible version.