<?php
/**
 * Remove sponsor ad from free Mobile Joomla! version
 * Mobile Joomla!
 * http://www.mobilejoomla.com
 *
 * @version		1.0.1
 * @license		GNU/GPL v2 - http://www.gnu.org/licenses/gpl-2.0.html
 * @copyright	(C) 2008-2012 Kuneri Ltd.
 * @date		March 2012
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport('joomla.plugin.plugin');
 
class plgMobileAdremover extends JPlugin
{
	function plgMobileAdremover( &$subject, $config )
	{
		parent::__construct( $subject, $config );
		if(!isset($this->params))
			$this->params = new JParameter(null);
	}

	function onMobileJoomlaAdCheck()
	{
		if($this->params->get('noads', 1))
			return 'no-ads-2011';
		else
			return '';
	}

	function onMobile(&$MobileJoomla, &$MobileJoomla_Settings, &$MobileJoomla_Device)
	{
		if($this->params->get('nocopyright', 0))
			$MobileJoomla->setParam('jfooter', 0);
	}
}
