1_async.php 1.1 KB

1234567891011121314151617181920212223242526272829
  1. <?
  2. // Make sure nothing is cached
  3. header("Cache-Control: must-revalidate");
  4. header("Cache-Control: post-check=0, pre-check=0", false);
  5. header("Pragma: no-cache");
  6. header("Expires: ".gmdate("D, d M Y H:i:s", mktime(date("H")-2, date("i"), date("s"), date("m"), date("d"), date("Y")))." GMT");
  7. header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
  8. // So that the loading indicator is visible
  9. sleep(1);
  10. // The id of the node being opened
  11. $id = $_REQUEST["id"];
  12. //echo $id;
  13. if($id == "0") {
  14. echo '['."\n";
  15. echo "\t".'{ attributes: { id : "pjson_1" }, state: "closed", data: "Root node 1" },'."\n";
  16. echo "\t".'{ attributes: { id : "pjson_5" }, data: "Root node 2" }'."\n";
  17. echo ']'."\n";
  18. }
  19. else {
  20. echo '['."\n";
  21. echo "\t".'{ attributes: { id : "pjson_2" }, data: { title : "Custom icon", icon : "../media/images/ok.png" } },'."\n";
  22. echo "\t".'{ attributes: { id : "pjson_3" }, data: "Child node 2" },'."\n";
  23. echo "\t".'{ attributes: { id : "pjson_4" }, data: "Some other child node" }'."\n";
  24. echo ']'."\n";
  25. }
  26. exit();
  27. ?>