[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/libraries/pattemplate/patTemplate/Function/ -> Time.php (source)

   1  <?PHP
   2  /**
   3   * patTemplate function that calculates the current time
   4   * or any other time and returns it in the specified format.
   5   *
   6   * $Id: Time.php 10381 2008-06-01 03:35:53Z pasamio $
   7   *
   8   * @package        patTemplate
   9   * @subpackage    Functions
  10   * @author        Stephan Schmidt <schst@php.net>
  11   */
  12  
  13  // Check to ensure this file is within the rest of the framework
  14  defined('JPATH_BASE') or die();
  15  
  16  /**
  17   * patTemplate function that calculates the current time
  18   * or any other time and returns it in the specified format.
  19   *
  20   * $Id: Time.php 10381 2008-06-01 03:35:53Z pasamio $
  21   *
  22   * @package        patTemplate
  23   * @subpackage    Functions
  24   * @author        Stephan Schmidt <schst@php.net>
  25   */
  26  class patTemplate_Function_Time extends patTemplate_Function
  27  {
  28      /**
  29      * name of the function
  30      * @access    private
  31      * @var        string
  32      */
  33      var $_name    =    'Time';
  34  
  35      /**
  36      * call the function
  37      *
  38      * @access    public
  39      * @param    array    parameters of the function (= attributes of the tag)
  40      * @param    string    content of the tag
  41      * @return    string    content to insert into the template
  42      */
  43  	function call( $params, $content )
  44      {
  45          if( !empty( $content ) )
  46          {
  47              $params['time'] = $content;
  48          }
  49  
  50          if( isset( $params['time'] ) )
  51          {
  52              $params['time'] = strtotime( $params['time'] );
  53          }
  54          else
  55          {
  56              $params['time'] = time();
  57          }
  58  
  59  
  60          return date( $params['format'], $params['time'] );
  61      }
  62  }
  63  ?>


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1