[svn r17327] Fixed warning when uploading SCORM archive (or not uploading anything, actually)

skala
Yannick Warnier 17 years ago
parent 094954db82
commit 3de4586761
  1. 46
      main/newscorm/learnpath.class.php

@ -1837,28 +1837,30 @@ class learnpath {
$manifest = ''; $manifest = '';
//the following loop should be stopped as soon as we found the right imsmanifest.xml (how to recognize it?) //the following loop should be stopped as soon as we found the right imsmanifest.xml (how to recognize it?)
foreach($zipContentArray as $thisContent) if (is_array($zipContentArray) && count($zipContentArray)>0) {
{ foreach($zipContentArray as $thisContent)
if ( preg_match('~.(php.*|phtml)$~i', $thisContent['filename']) ) {
{ if ( preg_match('~.(php.*|phtml)$~i', $thisContent['filename']) )
//New behaviour: Don't do anything. These files will be removed in scorm::import_package {
} //New behaviour: Don't do anything. These files will be removed in scorm::import_package
elseif(stristr($thisContent['filename'],'imsmanifest.xml')!==FALSE) }
{ elseif(stristr($thisContent['filename'],'imsmanifest.xml')!==FALSE)
$manifest = $thisContent['filename']; //just the relative directory inside scorm/ {
$package_type = 'scorm'; $manifest = $thisContent['filename']; //just the relative directory inside scorm/
break;//exit the foreach loop $package_type = 'scorm';
} break;//exit the foreach loop
elseif(preg_match('/aicc\//i',$thisContent['filename'])!=false) }
{//if found an aicc directory... (!= false means it cannot be false (error) or 0 (no match)) elseif(preg_match('/aicc\//i',$thisContent['filename'])!=false)
$package_type='aicc'; {//if found an aicc directory... (!= false means it cannot be false (error) or 0 (no match))
//break;//don't exit the loop, because if we find an imsmanifest afterwards, we want it, not the AICC $package_type='aicc';
} //break;//don't exit the loop, because if we find an imsmanifest afterwards, we want it, not the AICC
else }
{ else
$package_type = ''; {
} $package_type = '';
} }
}
}
return $package_type; return $package_type;
} }
/** /**

Loading…
Cancel
Save