Source for file view.html.php

Documentation is available at view.html.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.  * HTML View class for the WebLinks component
  14.  *
  15.  * @package     Joomla.Site
  16.  * @subpackage  com_weblinks
  17.  * @since       1.5
  18.  */
  19. {
  20.     protected $state;
  21.  
  22.     protected $item;
  23.  
  24.     public function display($tpl null)
  25.     {
  26.         // Get some data from the models
  27.         $item        $this->get('Item');
  28.  
  29.         if ($this->getLayout(== 'edit')
  30.         {
  31.             $this->_displayEdit($tpl);
  32.             return;
  33.         }
  34.  
  35.         if ($item->url)
  36.         {
  37.             // redirects to url if matching id found
  38.             JFactory::getApplication()->redirect($item->url);
  39.         }
  40.         else
  41.         {
  42.             //TODO create proper error handling
  43.             JFactory::getApplication()->redirect(JRoute::_('index.php')JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND')'notice');
  44.         }
  45.     }
  46. }

Documentation generated on Tue, 19 Nov 2013 15:16:58 +0100 by phpDocumentor 1.4.3