[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

/administrator/components/com_banners/controllers/ -> tracks.raw.php (source)

   1  <?php
   2  /**
   3   * @copyright    Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   4   * @license        GNU General Public License version 2 or later; see LICENSE.txt
   5   */
   6  
   7  // No direct access.
   8  defined('_JEXEC') or die;
   9  
  10  jimport('joomla.application.component.controller');
  11  
  12  /**
  13   * Tracks list controller class.
  14   *
  15   * @package        Joomla.Administrator
  16   * @subpackage    com_banners
  17   * @since        1.6
  18   */
  19  class BannersControllerTracks extends JController
  20  {
  21      /**
  22       * @var        string    The context for persistent state.
  23       * @since    1.6
  24       */
  25      protected $context = 'com_banners.tracks';
  26  
  27      /**
  28       * Proxy for getModel.
  29       *
  30       * @param    string    $name    The name of the model.
  31       * @param    string    $prefix    The prefix for the model class name.
  32       *
  33       * @return    JModel
  34       * @since    1.6
  35       */
  36  	public function getModel($name = 'Tracks', $prefix = 'BannersModel')
  37      {
  38          $model = parent::getModel($name, $prefix, array('ignore_request' => true));
  39          return $model;
  40      }
  41  
  42      /**
  43       * Display method for the raw track data.
  44       *
  45       * @param    boolean            If true, the view output will be cached
  46       * @param    array            An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  47       *
  48       * @return    JController        This object to support chaining.
  49       * @since    1.5
  50       * @todo    This should be done as a view, not here!
  51       */
  52  	public function display($cachable = false, $urlparams = false)
  53      {
  54          // Get the document object.
  55          $document    = JFactory::getDocument();
  56          $vName        = 'tracks';
  57          $vFormat    = 'raw';
  58  
  59          // Get and render the view.
  60          if ($view = $this->getView($vName, $vFormat)) {
  61              // Get the model for the view.
  62              $model = $this->getModel($vName);
  63  
  64              // Load the filter state.
  65              $app = JFactory::getApplication();
  66  
  67              $type = $app->getUserState($this->context.'.filter.type');
  68              $model->setState('filter.type', $type);
  69  
  70              $begin = $app->getUserState($this->context.'.filter.begin');
  71              $model->setState('filter.begin', $begin);
  72  
  73              $end = $app->getUserState($this->context.'.filter.end');
  74              $model->setState('filter.end', $end);
  75  
  76              $categoryId = $app->getUserState($this->context.'.filter.category_id');
  77              $model->setState('filter.category_id', $categoryId);
  78  
  79              $clientId = $app->getUserState($this->context.'.filter.client_id');
  80              $model->setState('filter.client_id', $clientId);
  81  
  82              $model->setState('list.limit', 0);
  83              $model->setState('list.start', 0);
  84  
  85              $form = JRequest::getVar('jform');
  86              $model->setState('basename', $form['basename']);
  87              $model->setState('compressed', $form['compressed']);
  88  
  89              $config = JFactory::getConfig();
  90              $cookie_domain = $config->get('cookie_domain', '');
  91              $cookie_path = $config->get('cookie_path', '/');
  92              jimport('joomla.utilities.utility');
  93              setcookie(JApplication::getHash($this->context.'.basename'), $form['basename'], time() + 365 * 86400, $cookie_path, $cookie_domain);
  94              setcookie(JApplication::getHash($this->context.'.compressed'), $form['compressed'], time() + 365 * 86400, $cookie_path, $cookie_domain);
  95  
  96              // Push the model into the view (as default).
  97              $view->setModel($model, true);
  98  
  99              // Push document object into the view.
 100              $view->assignRef('document', $document);
 101  
 102              $view->display();
 103          }
 104      }
 105  }


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1