/** * This method should be called from each successor to add * common data to the event. * * <p>When you call this method you should pass an associative * array that contains the event data. This method will populate * it with the missing information and will check the validity of * the presented.</p> * * @access public * * @return bool true on success, false otherwise * */ public function filterMultipleEvents(&$event) { if (!isset($event['time']) || $event['time'] === null) { $event['time'] = XOAD_Utilities::getMicroTime(); } return true; }
/** * Registers XOAD Events header data. * * <p>You should call this method after {@link XOAD_Utilities::header}.</p> * <p>XOAD Events header data includes server time and callback URL.</p> * * @access public * * @param string $callbackUrl XOAD Events callback URL. * * @return string HTML code to initialize XOAD Events. * * @static * */ public static function eventsHeader($callbackUrl = null) { if ($callbackUrl == null) { $callbackUrl = XOAD_Utilities::getRequestUrl(); } $returnValue = '<script type="text/javascript">'; $returnValue .= 'xoad.events.callbackUrl = ' . XOAD_Client::register($callbackUrl) . ';'; $returnValue .= 'xoad.events.lastRefresh = ' . XOAD_Client::register(XOAD_Utilities::getMicroTime()) . ';'; $returnValue .= '</script>'; return $returnValue; }