CoreFiles by mySites.guru
tracks.raw.php106 lines, 3,218 bytes, from Joomla_1.7.2-Stable-Full_Package.zip
Raw History Compare with 1.7.1
md5
b33281fc05b8bc7def3a88e5e0dade08
sha1
089c6cf44f253af8a080e7b1f734b021060b6286
sha256
1570d126faa4d54c00414d1f339e9a8467633e864c591ef348a690b2e367622b
<?php
/**
 * @version		$Id: tracks.raw.php 20196 2011-01-09 02:40:25Z ian $
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access.
defined('_JEXEC') or die;

jimport('joomla.application.component.controller');

/**
 * Tracks list controller class.
 *
 * @package		Joomla.Administrator
 * @subpackage	com_banners
 * @since		1.6
 */
class BannersControllerTracks extends JController
{
	/**
	 * @var		string	The context for persistent state.
	 * @since	1.6
	 */
	protected $context = 'com_banners.tracks';

	/**
	 * Proxy for getModel.
	 *
	 * @param	string	$name	The name of the model.
	 * @param	string	$prefix	The prefix for the model class name.
	 *
	 * @return	JModel
	 * @since	1.6
	 */
	public function getModel($name = 'Tracks', $prefix = 'BannersModel')
	{
		$model = parent::getModel($name, $prefix, array('ignore_request' => true));
		return $model;
	}

	/**
	 * Display method for the raw track data.
	 *
	 * @param	boolean			If true, the view output will be cached
	 * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
	 *
	 * @return	JController		This object to support chaining.
	 * @since	1.5
	 * @todo	This should be done as a view, not here!
	 */
	public function display($cachable = false, $urlparams = false)
	{
		// Get the document object.
		$document	= JFactory::getDocument();
		$vName		= 'tracks';
		$vFormat	= 'raw';

		// Get and render the view.
		if ($view = $this->getView($vName, $vFormat)) {
			// Get the model for the view.
			$model = $this->getModel($vName);

			// Load the filter state.
			$app = JFactory::getApplication();

			$type = $app->getUserState($this->context.'.filter.type');
			$model->setState('filter.type', $type);

			$begin = $app->getUserState($this->context.'.filter.begin');
			$model->setState('filter.begin', $begin);

			$end = $app->getUserState($this->context.'.filter.end');
			$model->setState('filter.end', $end);

			$categoryId = $app->getUserState($this->context.'.filter.category_id');
			$model->setState('filter.category_id', $categoryId);

			$clientId = $app->getUserState($this->context.'.filter.client_id');
			$model->setState('filter.client_id', $clientId);

			$model->setState('list.limit', 0);
			$model->setState('list.start', 0);

			$form = JRequest::getVar('jform');
			$model->setState('basename',$form['basename']);
			$model->setState('compressed',$form['compressed']);

			$config = JFactory::getConfig();
			$cookie_domain = $config->get('cookie_domain', '');
			$cookie_path = $config->get('cookie_path', '/');
			jimport('joomla.utilities.utility');
			setcookie(JUtility::getHash($this->context.'.basename'), $form['basename'], time() + 365 * 86400, $cookie_path, $cookie_domain);
			setcookie(JUtility::getHash($this->context.'.compressed'), $form['compressed'], time() + 365 * 86400, $cookie_path, $cookie_domain);

			// Push the model into the view (as default).
			$view->setModel($model, true);

			// Push document object into the view.
			$view->assignRef('document', $document);

			$view->display();
		}
	}
}

The same content is in 10 releases, Joomla 1.6.0 to 1.7.2. See them all, or every version of this file.