lp_ajax_start_timer.php 813 B

123456789101112131415161718192021222324
  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. //$objResponse = new xajaxResponse();
  17. $time = time();
  18. //$objResponse->addScript("asset_timer='$time';asset_timer_total=0;");
  19. //return $objResponse;
  20. return "olms.asset_timer='$time';olms.asset_timer_total=0;";
  21. }
  22. echo start_timer();