Source for file controller.php

Documentation is available at controller.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Site
  4.  * @subpackage  com_weblinks
  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.  * Weblinks Component Controller
  14.  *
  15.  * @package     Joomla.Site
  16.  * @subpackage  com_weblinks
  17.  * @since       1.5
  18.  */
  19. {
  20.     /**
  21.      * Method to display a view.
  22.      *
  23.      * @param   boolean            If true, the view output will be cached
  24.      * @param   array  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  25.      *
  26.      * @return  JController        This object to support chaining.
  27.      * @since   1.5
  28.      */
  29.     public function display($cachable false$urlparams false)
  30.     {
  31.         $cachable    true;    // Huh? Why not just put that in the constructor?
  32.         $user        JFactory::getUser();
  33.  
  34.         // Set the default view name and format from the Request.
  35.         // Note we are using w_id to avoid collisions with the router and the return page.
  36.         // Frontend is a bit messier than the backend.
  37.         $id    $this->input->getInt('w_id');
  38.         $vName $this->input->get('view''categories');
  39.         $this->input->set('view'$vName);
  40.  
  41.         if ($user->get('id'||($this->input->getMethod(== 'POST' && $vName 'categories'))
  42.         {
  43.             $cachable false;
  44.         }
  45.  
  46.         $safeurlparams array(
  47.             'id'                => 'INT',
  48.             'limit'                => 'UINT',
  49.             'limitstart'        => 'UINT',
  50.             'filter_order'        => 'CMD',
  51.             'filter_order_Dir'    => 'CMD',
  52.             'lang'                => 'CMD'
  53.         );
  54.  
  55.         // Check for edit form.
  56.         if ($vName == 'form' && !$this->checkEditId('com_weblinks.edit.weblink'$id))
  57.         {
  58.             // Somehow the person just went to the form - we don't allow that.
  59.             return JError::raiseError(403JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID'$id));
  60.         }
  61.  
  62.         return parent::display($cachable$safeurlparams);
  63.     }
  64. }

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