Source for file download.php

Documentation is available at download.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_banners
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Download model.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_banners
  17.  * @since       1.5
  18.  */
  19. {
  20.     protected $_context = 'com_banners.tracks';
  21.  
  22.     /**
  23.      * Method to auto-populate the model state.
  24.      *
  25.      * Note. Calling getState in this method will result in recursion.
  26.      *
  27.      * @since   1.6
  28.      */
  29.     protected function populateState()
  30.     {
  31.         $input JFactory::getApplication()->input;
  32.  
  33.         $basename $input->cookie->getString(JApplication::getHash($this->_context.'.basename')'__SITE__');
  34.         $this->setState('basename'$basename);
  35.  
  36.         $compressed $input->cookie->getInt(JApplication::getHash($this->_context.'.compressed')1);
  37.         $this->setState('compressed'$compressed);
  38.     }
  39.  
  40.     /**
  41.      * Method to get the record form.
  42.      *
  43.      * @param   array  $data        Data for the form.
  44.      * @param   boolean    $loadData    True if the form is to load its own data (default case), false if not.
  45.      *
  46.      * @return  mixed  A JForm object on success, false on failure
  47.      * @since   1.6
  48.      */
  49.     public function getForm($data array()$loadData true)
  50.     {
  51.         // Get the form.
  52.         $form $this->loadForm('com_banners.download''download'array('control' => 'jform''load_data' => $loadData));
  53.         if (empty($form))
  54.         {
  55.             return false;
  56.         }
  57.  
  58.         return $form;
  59.     }
  60.  
  61.     /**
  62.      * Method to get the data that should be injected in the form.
  63.      *
  64.      * @return  mixed  The data for the form.
  65.      * @since   1.6
  66.      */
  67.     protected function loadFormData()
  68.     {
  69.         $data array(
  70.             'basename'        => $this->getState('basename'),
  71.             'compressed'    => $this->getState('compressed')
  72.         );
  73.  
  74.         $this->preprocessData('com_banners.download'$data);
  75.  
  76.         return $data;
  77.     }
  78. }

Documentation generated on Tue, 19 Nov 2013 15:01:40 +0100 by phpDocumentor 1.4.3