weblinks/src/components/com_weblinks/views/weblink/view.html.php

63 lines
1.8 KiB
PHP
Raw Normal View History

<?php
/**
2017-05-16 06:03:22 +00:00
* @package Joomla.Site
* @subpackage com_weblinks
*
2017-02-13 16:20:35 +00:00
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
2017-05-16 06:42:34 +00:00
* HTML Weblink View class for the Weblinks component
*
2017-05-16 06:42:34 +00:00
* @since __DEPLOY_VERSION__
*/
class WeblinksViewWeblink extends JViewLegacy
{
2017-03-24 10:53:09 +00:00
protected $item;
2017-05-16 06:42:34 +00:00
protected $params;
protected $state;
/**
2017-05-16 06:42:34 +00:00
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
2017-05-16 06:42:34 +00:00
*
* @since __DEPLOY_VERSION__
*/
public function display($tpl = null)
{
2017-05-16 06:42:34 +00:00
$dispatcher = JEventDispatcher::getInstance();
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->params = $this->state->get('params');
// Create a shortcut for $item.
$item = $this->item;
$offset = $this->state->get('list.offset');
$dispatcher->trigger('onContentPrepare', array ('com_weblinks.weblink', &$item, &$item->params, $offset));
$item->event = new stdClass;
$results = $dispatcher->trigger('onContentAfterTitle', array('com_weblinks.weblink', &$item, &$item->params, $offset));
$item->event->afterDisplayTitle = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentBeforeDisplay', array('com_weblinks.weblink', &$item, &$item->params, $offset));
$item->event->beforeDisplayContent = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentAfterDisplay', array('com_weblinks.weblink', &$item, &$item->params, $offset));
$item->event->afterDisplayContent = trim(implode("\n", $results));
parent::display($tpl);
}
}