CoreFiles by mySites.guru
view.html.php47 lines, 1,061 bytes, from Joomla_2.5.0-Stable-Full_Package.zip
Raw History Compare with 1.7.5
md5
d616877787850aee58280fe0291891c1
sha1
fef3df0c802a428cb6ca9a8fd08811b55f363665
sha256
5db69f8cc66749848c5cff028896d879acf353c6d43cdf9d2963fcb43977b615
<?php
/**
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

/**
 * HTML View class for the WebLinks component
 *
 * @package		Joomla.Site
 * @subpackage	com_weblinks
 * @since		1.5
 */
class WeblinksViewWeblink extends JView
{
	protected $state;
	protected $item;

	function display($tpl = null)
	{
		$app		= JFactory::getApplication();
		$params		= $app->getParams();

		// Get some data from the models
		$state		= $this->get('State');
		$item		= $this->get('Item');
		$category	= $this->get('Category');

		if ($this->getLayout() == 'edit') {
			$this->_displayEdit($tpl);
			return;
		}

		if ($item->url) {
			// redirects to url if matching id found
			$app->redirect($item->url);
		} else {
			//TODO create proper error handling
			$app->redirect(JRoute::_('index.php'), JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND'), 'notice');
		}
	}
}

The same content is in 6 releases, Joomla 2.5.0 to 2.5.5. See them all, or every version of this file.