Source for file controller.php

Documentation is available at controller.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.  * Banners master display controller.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_banners
  17.  * @since       1.6
  18.  */
  19. {
  20.     /**
  21.      * Method to display a view.
  22.      *
  23.      * @param   boolean            If true, the view output will be cached
  24.      * @param   array  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  25.      *
  26.      * @return  JController        This object to support chaining.
  27.      * @since   1.5
  28.      */
  29.     public function display($cachable false$urlparams false)
  30.     {
  31.         require_once JPATH_COMPONENT.'/helpers/banners.php';
  32.         BannersHelper::updateReset();
  33.  
  34.         $view   $this->input->get('view''banners');
  35.         $layout $this->input->get('layout''default');
  36.         $id     $this->input->getInt('id');
  37.  
  38.         // Check for edit form.
  39.         if ($view == 'banner' && $layout == 'edit' && !$this->checkEditId('com_banners.edit.banner'$id)) {
  40.  
  41.             // Somehow the person just went to the form - we don't allow that.
  42.             $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID'$id));
  43.             $this->setMessage($this->getError()'error');
  44.             $this->setRedirect(JRoute::_('index.php?option=com_banners&view=banners'false));
  45.  
  46.             return false;
  47.         }
  48.         elseif ($view == 'client' && $layout == 'edit' && !$this->checkEditId('com_banners.edit.client'$id)) {
  49.  
  50.             // Somehow the person just went to the form - we don't allow that.
  51.             $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID'$id));
  52.             $this->setMessage($this->getError()'error');
  53.             $this->setRedirect(JRoute::_('index.php?option=com_banners&view=clients'false));
  54.  
  55.             return false;
  56.         }
  57.  
  58.         parent::display();
  59.  
  60.         return $this;
  61.     }
  62. }

Documentation generated on Tue, 19 Nov 2013 14:57:11 +0100 by phpDocumentor 1.4.3