documentapi.js 567 B

12345678910111213141516171819202122232425262728
  1. // JS interface enabling scrom content to use main/document/remote.php easily
  2. // CBlue SPRL, Arnaud Ligot <arnaud@cblue.be>
  3. lms_documents_list = function(path) {
  4. var result;
  5. $.ajax({
  6. async: false,
  7. type: "POST",
  8. datatype: "json",
  9. url: "../document/remote.php",
  10. data: {
  11. action: "list",
  12. cwd: path,
  13. cidReq: chamilo_courseCode,
  14. },
  15. success: function(data) {
  16. result = eval("("+data+")");
  17. }
  18. });
  19. return result;
  20. }
  21. // Accessor object
  22. function DOCUMENTAPIobject() {
  23. this.list = lms_documents_list;
  24. }
  25. var DOCUMENTAPI = new DOCUMENTAPIobject();