Source for file highlight.php
Documentation is available at highlight.php
* @subpackage System.Highlight
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* System plugin to highlight terms.
* @subpackage System.Highlight
* Method to catch the onAfterDispatch event.
* This is where we setup the click-through content highlighting for.
* The highlighting is done with JavaScript so we just
* need to check a few parameters and the JHtml behavior will do the rest.
* @return boolean True on success
// Check that we are in the site application.
$extension =
$input->get('option', '', 'cmd');
// Check if the highlighter is enabled.
// Check if the highlighter should be activated in this environment.
if (JFactory::getDocument()->getType() !==
'html' ||
$input->get('tmpl', '', 'cmd') ===
'component')
// Get the terms to highlight from the request.
$terms =
$input->request->get('highlight', null, 'base64');
foreach ($terms as $term)
// Activate the highlighter.
JHtml::_('behavior.highlighter', $cleanTerms);
// Adjust the component buffer.
$buf =
$doc->getBuffer('component');
$buf =
'<br id="highlighter-start" />' .
$buf .
'<br id="highlighter-end" />';
$doc->setBuffer($buf, 'component');
Documentation generated on Tue, 19 Nov 2013 15:04:41 +0100 by phpDocumentor 1.4.3