CoreFiles by mySites.guru
view.html.php44 lines, 1,000 bytes, from Joomla_2.5.8-Stable-Full_Package.zip
Raw History Compare with 2.5.7
md5
584100264c030a3155312e2b16b5c6f5
sha1
1375ccb03d23a7bfe1542839bfb71f514f6593ab
sha256
6169173fbfc9bb95cf45c9877628e06fa3ca9842a07b5289a5b6e9cb4c8e9962
<?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
 */

defined('_JEXEC') or die;

/**
 * HTML View class for the WebLinks component
 *
 * @package		Joomla.Site
 * @subpackage	com_weblinks
 * @since		1.5
 */
class WeblinksViewWeblink extends JViewLegacy
{
	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 3 releases, Joomla 2.5.6 to 2.5.8. See them all, or every version of this file.