Source for file canceladmin.php

Documentation is available at canceladmin.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Libraries
  4.  * @subpackage  Controller
  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
  8.  */
  9.  
  10. defined('JPATH_PLATFORM'or die;
  11.  
  12. /**
  13.  * Cancel Controller for Admin
  14.  *
  15.  * @package     Joomla.Libraries
  16.  * @subpackage  com_config
  17.  * @since       3.2
  18.  */
  19. {
  20.     /**
  21.      * The context for storing internal data, e.g. record.
  22.      *
  23.      * @var    string 
  24.      * @since  3.2
  25.      */
  26.     protected $context;
  27.  
  28.     /**
  29.      * The URL option for the component.
  30.      *
  31.      * @var    string 
  32.      * @since  3.2
  33.      */
  34.     protected $option;
  35.  
  36.     /**
  37.      * URL for redirection.
  38.      *
  39.      * @var    string 
  40.      * @since  3.2
  41.      * @note   Replaces _redirect.
  42.      */
  43.     protected $redirect;
  44.  
  45.     /**
  46.      * Method to handle admin cancel
  47.      *
  48.      * @return  boolean  True on success.
  49.      *
  50.      * @since   3.2
  51.      */
  52.     public function execute()
  53.     {
  54.         // Check for request forgeries.
  55.         if (!JSession::checkToken())
  56.         {
  57.             $this->app->enqueueMessage(JText::_('JINVALID_TOKEN'));
  58.             $this->app->redirect('index.php');
  59.         }
  60.  
  61.         if (empty($this->context))
  62.         {
  63.             $this->context = $this->option . '.edit' $this->context;
  64.         }
  65.  
  66.         // Redirect.
  67.         $this->app->setUserState($this->context . '.data'null);
  68.  
  69.         if (!empty($this->redirect))
  70.         {
  71.             $this->app->redirect($this->redirect);
  72.         }
  73.         else
  74.         {
  75.             parent::execute();
  76.         }
  77.     }
  78. }

Documentation generated on Tue, 19 Nov 2013 14:55:01 +0100 by phpDocumentor 1.4.3