CoreFiles by mySites.guru
Phphighlight.php50 lines, 1,170 bytes, from Joomla_1.5.0-Stable-Full_Package.zip
Raw History Compare with 1.0.15
md5
19a2793cb5101bb140651b084dced491
sha1
25883ce035b765ff67132a7a47bc4c199c7bab67
sha256
56cabbb930ae4f6401530ebdb9037832ae8ca98b112f9bfaa6d525cc227a457d
<?PHP
/**
 * patTemplate function that highlights PHP code in your templates
 *
 * $Id: Phphighlight.php 8287 2007-08-01 08:38:59Z eddieajau $
 *
 * @package		patTemplate
 * @subpackage	Functions
 * @author		Stephan Schmidt <[email protected]>
 */

// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();

/**
 * patTemplate function that highlights PHP code in your templates
 *
 * $Id: Phphighlight.php 8287 2007-08-01 08:38:59Z eddieajau $
 *
 * @package		patTemplate
 * @subpackage	Functions
 * @author		Stephan Schmidt <[email protected]>
 */
class patTemplate_Function_Phphighlight extends patTemplate_Function
{
	/**
	* name of the function
	* @access	private
	* @var		string
	*/
	var $_name	=	'Phphighlight';

	/**
	* call the function
	*
	* @access	public
	* @param	array	parameters of the function (= attributes of the tag)
	* @param	string	content of the tag
	* @return	string	content to insert into the template
	*/
	function call( $params, $content )
	{
		ob_start();
		highlight_string( $content );
		$content = ob_get_contents();
		ob_end_clean();
		return $content;
	}
}
?>

The same content is in 4 releases, Joomla 1.5.0 to 1.5.3. See them all, or every version of this file.