SCORM MDL-21333 remove link to allow manual opening of window as JS communication...
authorDan Marsden <Dan@digitalclay.co.nz>
Thu, 22 Jul 2010 01:52:25 +0000 (01:52 +0000)
committerDan Marsden <Dan@digitalclay.co.nz>
Thu, 22 Jul 2010 01:52:25 +0000 (01:52 +0000)
mod/scorm/lang/en/scorm.php
mod/scorm/loadSCO.php
mod/scorm/player.php

index 6b76a72..b85a8a4 100644 (file)
@@ -196,8 +196,7 @@ $string['passed'] = 'Passed';
 $string['php5'] = 'PHP 5 (DOMXML native library)';
 $string['pluginname'] = 'SCORM package';
 $string['popup'] = 'New window';
-$string['popupblocked'] = 'If a new window does not appear, {$a}';
-$string['popupblockedlinkname'] = 'click here to launch the activity';
+$string['popupblockmessage'] = 'If a pop-up window doesn\'t appear, please enable pop-ups in your browser.';
 $string['popupmenu'] = 'In a drop down menu';
 $string['popupopen'] = 'Open package in a new window';
 $string['position_error'] = 'The {$a->tag} tag can\'t be child of {$a->parent} tag';
index c0c7844..35d8c20 100755 (executable)
                                                 }
                                             }, 1000);
             }
-            removelink();
-        }
-        function removelink() {
-            try {
-                if (window.opener.document.getElementById('altpopuplink')) {
-                    window.opener.document.getElementById('altpopuplink').style.display='none';
-                } else {
-                    window.opener.document.all['altpopuplink'].style.display='none';
-                }
-            } catch(error) {
-                // nothing to be done
-            }
         }
         //]]>
         </script>
index 4313740..1f77ab2 100755 (executable)
 <?php
     if ($result->prerequisites) {
         if ($scorm->popup != 0) {
+            //Added incase javascript popups are blocked we don't provide a direct link to the pop-up as JS communication can fail - the user must disable their pop-up blocker.
             $linkcourse = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$scorm->course.'">' . get_string('finishscormlinkname','scorm') . '</a>';
-            echo $OUTPUT->box(get_string('finishscorm','scorm',$linkcourse), 'generalbox', 'altfinishlink');
+            echo $OUTPUT->box(get_string('popupblockmessage','scorm'). ' '. get_string('finishscorm','scorm',$linkcourse), 'generalbox', 'altfinishlink');
         }
     }
 ?>
             <![endif]-->
             </noscript>
 <?php
-            //Added incase javascript popups are blocked
-            $link = '<a href="'.$CFG->wwwroot.'/mod/scorm/loadSCO.php?id='.$cm->id.$scoidstr.$modestr.'" target="_blank">'.get_string('popupblockedlinkname','scorm').'</a>';
-            echo $OUTPUT->box(get_string('popupblocked','scorm',$link), 'generalbox', 'altpopuplink');
-            //$linkcourse = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$scorm->course.'">' . get_string('finishscormlinkname','scorm') . '</a>';
-            //echo $OUTPUT->box(get_string('finishscorm','scorm',$linkcourse), 'generalbox', 'altfinishlink');
         }
     } else {
         echo $OUTPUT->box(get_string('noprerequisites','scorm'));