lp_ajax_start_timer.php 727 B

123456789101112131415161718192021
  1. <?php //$id$
  2. /**
  3. * This script contains the server part of the xajax interaction process. The client part is located
  4. * in lp_api.php or other api's.
  5. * This is a first attempt at using xajax and AJAX in general, so the code might be a bit unsettling.
  6. * @package dokeos.learnpath
  7. * @author Yannick Warnier <ywarnier@beeznest.org>
  8. */
  9. /**
  10. * Start a timer and hand it back to the JS by assigning the current time (of start) to
  11. * var asset_timer
  12. */
  13. function start_timer()
  14. {
  15. //$objResponse = new xajaxResponse();
  16. $time = time();
  17. //$objResponse->addScript("asset_timer='$time';asset_timer_total=0;");
  18. //return $objResponse;
  19. return "olms.asset_timer='$time';olms.asset_timer_total=0;";
  20. }
  21. echo start_timer();