Source for file controller.php

Documentation is available at controller.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_contact
  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.  * Component Controller
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_contact
  17.  */
  18. {
  19.     /**
  20.      * @var        string    The default view.
  21.      * @since   1.6
  22.      */
  23.     protected $default_view = 'contacts';
  24.  
  25.     /**
  26.      * Method to display a view.
  27.      *
  28.      * @param   boolean            If true, the view output will be cached
  29.      * @param   array  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  30.      *
  31.      * @return  JController        This object to support chaining.
  32.      * @since   1.5
  33.      */
  34.     public function display($cachable false$urlparams false)
  35.     {
  36.         require_once JPATH_COMPONENT.'/helpers/contact.php';
  37.  
  38.         $view   $this->input->get('view''contacts');
  39.         $layout $this->input->get('layout''default');
  40.         $id     $this->input->getInt('id');
  41.  
  42.         // Check for edit form.
  43.         if ($view == 'contact' && $layout == 'edit' && !$this->checkEditId('com_contact.edit.contact'$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_contact&view=contacts'false));
  49.  
  50.             return false;
  51.         }
  52.  
  53.         parent::display();
  54.  
  55.         return $this;
  56.     }
  57. }

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