Source for file content.php

Documentation is available at content.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Libraries
  4.  * @subpackage  HTML
  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
  8.  */
  9.  
  10. defined('JPATH_PLATFORM'or die;
  11.  
  12. /**
  13.  * Utility class to fire onContentPrepare for non-article based content.
  14.  *
  15.  * @package     Joomla.Libraries
  16.  * @subpackage  HTML
  17.  * @since       1.5
  18.  */
  19. abstract class JHtmlContent
  20. {
  21.     /**
  22.      * Fire onContentPrepare for content that isn't part of an article.
  23.      *
  24.      * @param   string  $text     The content to be transformed.
  25.      * @param   array   $params   The content params.
  26.      * @param   string  $context  The context of the content to be transformed.
  27.      *
  28.      * @return  string   The content after transformation.
  29.      *
  30.      * @since   1.5
  31.      */
  32.     public static function prepare($text$params null$context 'text')
  33.     {
  34.         if ($params === null)
  35.         {
  36.             $params new JObject;
  37.         }
  38.  
  39.         $article new stdClass;
  40.         $article->text $text;
  41.         JPluginHelper::importPlugin('content');
  42.         $dispatcher JEventDispatcher::getInstance();
  43.         $dispatcher->trigger('onContentPrepare'array($context&$article&$params0));
  44.  
  45.         return $article->text;
  46.     }
  47. }

Documentation generated on Tue, 19 Nov 2013 14:56:51 +0100 by phpDocumentor 1.4.3