CoreFiles by mySites.guru
Time.php63 lines, 1,396 bytes, from Joomla_1.5.3-Stable-Full_Package.zip
Raw History Compare with 1.5.2
md5
a138324e557e5954d075fe93b4ae62c9
sha1
884d60803410936a7405fcbe76b1e22b80fc2141
sha256
42a2d9939d36c431b09d9e8f1afed3bce5ea2bb1736608974c8e8e15c0c00f55
<?PHP
/**
 * patTemplate function that calculates the current time
 * or any other time and returns it in the specified format.
 *
 * $Id: Time.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 calculates the current time
 * or any other time and returns it in the specified format.
 *
 * $Id: Time.php 8287 2007-08-01 08:38:59Z eddieajau $
 *
 * @package		patTemplate
 * @subpackage	Functions
 * @author		Stephan Schmidt <[email protected]>
 */
class patTemplate_Function_Time extends patTemplate_Function
{
	/**
	* name of the function
	* @access	private
	* @var		string
	*/
	var $_name	=	'Time';

	/**
	* 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 )
	{
		if( !empty( $content ) )
		{
			$params['time'] = $content;
		}

		if( isset( $params['time'] ) )
		{
			$params['time'] = strtotime( $params['time'] );
		}
		else
		{
			$params['time'] = time();
		}


		return date( $params['format'], $params['time'] );
	}
}
?>

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