Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / mod / resource / type / ims / javascript.php
blob68640e820bd1aa6297677eb6b6003474763eb70b
1 <?php /// $Id $
2 /// Load IMS required Javascript libraries, adding them
3 /// before the standard one ($standard_javascript)
5 if (!defined('MOODLE_INTERNAL')) {
6 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
9 /// We use this globals to be able to generate the proper JavaScripts
10 global $jsarg, $standard_javascript;
12 /// Load IMS needed JavaScript
13 /// The dummy LMS API hack to stop some SCORM packages giving errors.
14 echo "<script type=\"text/javascript\" src=\"$CFG->wwwroot/mod/resource/type/ims/dummyapi.js\"></script>\n";
15 /// The resize iframe script
16 echo " <script type=\"text/javascript\" src=\"$CFG->wwwroot/mod/resource/type/ims/resize.js\"></script>\n";
17 echo " <script type=\"text/javascript\">
18 window.onresize = function() {
19 resizeiframe($jsarg);
21 window.name='ims-cp-page';
23 // Set Interval until ims-contentframe or ims-contentframe-no-nav is available
24 function waiting() {
25 var cf = document.getElementById('ims-contentframe');
26 var cfnv = document.getElementById('ims-contentframe-no-nav');
28 if (cf || cfnv) {
29 resizeiframe($jsarg);
30 clearInterval(ourInterval);
31 return true;
33 return false;
36 var ourInterval = setInterval('waiting()', 100);
37 </script>\n";
39 /// Load standard JavaScript
40 include("$standard_javascript");