Forráskód Böngészése

[svn r12369] Updated messaging on unrecognized format.
Fixed a bug in preg_match expression whereby most packages were attributed 'aicc' type for no reason.

Yannick Warnier 18 éve
szülő
commit
f9ff3eb9aa
2 módosított fájl, 11 hozzáadás és 3 törlés
  1. 2 2
      main/newscorm/learnpath.class.php
  2. 9 1
      main/upload/upload.scorm.php

+ 2 - 2
main/newscorm/learnpath.class.php

@@ -1739,8 +1739,8 @@ class learnpath {
 				$package_type = 'scorm';
 				break;//exit the foreach loop
 			}
-			elseif(preg_match('/aicc\//i',$thisContent['filename'])!==FALSE)
-			{//if found an aicc directory...
+			elseif(preg_match('/aicc\//i',$thisContent['filename'])!=false)
+			{//if found an aicc directory... (!= false means it cannot be false (error) or 0 (no match))
 				$package_type='aicc';
 				//break;//don't exit the loop, because if we find an imsmanifest afterwards, we want it, not the AICC
 			}

+ 9 - 1
main/upload/upload.scorm.php

@@ -8,9 +8,17 @@
 /**
  * Process the SCORM package and return to the SCORM tool
  */
+$language_file = "scorm";
 $cwdir = getcwd();
 require('../newscorm/lp_upload.php');
 //reinit current working directory as many functions in upload change it
 chdir($cwdir);
-header('location: ../newscorm/lp_controller.php?action=list&dialog_box='.urlencode(get_lang('UplUploadSucceeded')));
+$error = api_failure::get_last_failure();
+if($error=='not_a_learning_path')
+{
+        $msg = urlencode(get_lang('UnknownPackageFormat'));
+}else{
+        $msg = urlencode(get_lang('UplUploadSucceeded'));
+}
+header('location: ../newscorm/lp_controller.php?action=list&dialog_box='.$msg);
 ?>