Source for file controller.php

Documentation is available at controller.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_finder
  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('_JEXEC'or die;
  11.  
  12. /**
  13.  * Base controller class for Finder.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_finder
  17.  * @since       2.5
  18.  */
  19. {
  20.     /**
  21.      * @var    string  The default view.
  22.      * @since  2.5
  23.      */
  24.     protected $default_view = 'index';
  25.  
  26.     /**
  27.      * Method to display a view.
  28.      *
  29.      * @param   boolean  $cachable   If true, the view output will be cached
  30.      * @param   array    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  31.      *
  32.      * @return  JController  A JController object to support chaining.
  33.      *
  34.      * @since    2.5
  35.      */
  36.     public function display($cachable false$urlparams array())
  37.     {
  38.         include_once JPATH_COMPONENT '/helpers/finder.php';
  39.  
  40.         $view   $this->input->get('view''index''word');
  41.         $layout $this->input->get('layout''index''word');
  42.         $f_id   $this->input->get('filter_id'null'int');
  43.  
  44.         // Check for edit form.
  45.         if ($view == 'filter' && $layout == 'edit' && !$this->checkEditId('com_finder.edit.filter'$f_id))
  46.         {
  47.             // Somehow the person just went to the form - we don't allow that.
  48.             $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID'$f_id));
  49.             $this->setMessage($this->getError()'error');
  50.             $this->setRedirect(JRoute::_('index.php?option=com_finder&view=filters'false));
  51.  
  52.             return false;
  53.         }
  54.  
  55.         parent::display();
  56.  
  57.         return $this;
  58.     }
  59. }

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