lp_ajax_start_timer.php 810 B

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