Your IP : 10.10.0.253


Current Path : /var/www/components/com_contactpush/controllers/
Upload File :
Current File : /var/www/components/com_contactpush/controllers/pushuids.php

<?php
/**                               ______________________________________________
*                          o O   |                                              |
*                 (((((  o      <    Generated with Cook Self Service  V3.1     |
*                ( o o )         |______________________________________________|
* --------oOOO-----(_)-----OOOo---------------------------------- www.j-cook.pro --- +
* @version		1.0.0
* @package		Contact Push
* @subpackage	Push UIDs
* @copyright	Netamity 2017
* @author		Andy Hickey - www.netamity.com - andy@netamity.com
* @license		GPL V2+
*
*             .oooO  Oooo.
*             (   )  (   )
* -------------\ (----) /----------------------------------------------------------- +
*               \_)  (_/
*/

// no direct access
defined('_JEXEC') or die('Restricted access');



/**
* Contactpush Pushuids Controller
*
* @package	Contactpush
* @subpackage	Pushuids
*/
class ContactpushCkControllerPushuids extends ContactpushClassControllerList
{
	/**
	* The context for storing internal data, e.g. record.
	*
	* @var string
	*/
	protected $context = 'pushuids';

	/**
	* The URL view item variable.
	*
	* @var string
	*/
	protected $view_item = 'pushuid';

	/**
	* The URL view list variable.
	*
	* @var string
	*/
	protected $view_list = 'pushuids';

	/**
	* Constructor
	*
	* @access	public
	* @param	array	$config	An optional associative array of configuration settings.
	*
	* @return	void
	*/
	public function __construct($config = array())
	{
		parent::__construct($config);
		$app = JFactory::getApplication();

	}

	/**
	* Return the current layout.
	*
	* @access	protected
	* @param	bool	$default	If true, return the default layout.
	*
	* @return	string	Requested layout or default layout
	*/
	protected function getLayout($default = null)
	{
		if ($default)
			return 'default';

		$jinput = JFactory::getApplication()->input;
		return $jinput->get('layout', 'default', 'CMD');
	}

	/**
	* Method to publish an element.
	*
	* @access	public
	*
	* @return	void
	*/
	public function publish()
	{
		JSession::checkToken() or JSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));
		$this->_result = $result = parent::publish();
		$model = $this->getModel();

		//Define the redirections
		switch($this->getLayout() .'.'. $this->getTask())
		{
			case 'pushreg.publish':
				$this->applyRedirection($result, array(
					'stay',
					'com_contactpush.cpanel.default'
				), array(
					'cid[]' => null
				));
				break;

			case 'pushreg.unpublish':
				$this->applyRedirection($result, array(
					'stay',
					'com_contactpush.cpanel.default'
				), array(
					'cid[]' => null
				));
				break;

			default:
				$this->applyRedirection($result, array(
					'stay',
					'stay'
				));
				break;
		}
	}


}

// Load the fork
ContactpushHelper::loadFork(__FILE__);

// Fallback if no fork has been found
if (!class_exists('ContactpushControllerPushuids')){ class ContactpushControllerPushuids extends ContactpushCkControllerPushuids{} }