[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

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


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