00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 include_once( 'kernel/classes/notification/eznotificationeventtype.php' );
00040 include_once( "lib/ezlocale/classes/ezdate.php" );
00041
00042 define( 'EZ_NOTIFICATIONTYPESTRING_CURRENTTIME', 'ezcurrenttime' );
00043
00044 class eZCurrentTimeType extends eZNotificationEventType
00045 {
00046
00047
00048
00049 function eZCurrentTimeType()
00050 {
00051 $this->eZNotificationEventType( EZ_NOTIFICATIONTYPESTRING_CURRENTTIME );
00052 }
00053
00054 function initializeEvent( &$event, $params )
00055 {
00056 eZDebugSetting::writeDebug( 'kernel-notification', $params, 'params for type' );
00057 $time = 0;
00058 if ( array_key_exists( 'time', $params ) )
00059 {
00060 $time = $params['time'];
00061 }
00062 else
00063 {
00064 $time = mktime();
00065 }
00066 $event->setAttribute( 'data_int1', $time );
00067 }
00068
00069 function &eventContent( &$event )
00070 {
00071 $date = new eZDate( );
00072 $stamp = $event->attribute( 'data_int1' );
00073 $date->setTimeStamp( $stamp );
00074 return $date;
00075 }
00076
00077 }
00078
00079 eZNotificationEventType::register( EZ_NOTIFICATIONTYPESTRING_CURRENTTIME, 'ezcurrenttimetype' );
00080
00081
00082 ?>