[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

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


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