--- loncom/imspackages/imsimportdocs.pm 2013/07/27 22:04:49 1.31
+++ loncom/imspackages/imsimportdocs.pm 2014/12/11 00:35:53 1.34
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: imsimportdocs.pm,v 1.31 2013/07/27 22:04:49 raeburn Exp $
+# $Id: imsimportdocs.pm,v 1.34 2014/12/11 00:35:53 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,9 +48,9 @@ sub jscript_one {
es => 'Enroll students only',
ea => 'Enroll all users',
nr => 'Not required',
- id => 'You must select one of the additional options when importing Disussion Boards',
- ie => 'You must select one of the additional options when importing Enrollment',
- ct => 'You must check at least one Content Type',
+ id => 'You must select one of the additional options when importing Discussion Boards.',
+ ie => 'You must select one of the additional options when importing Enrollment.',
+ ct => 'You must check at least one Content Type.',
);
return <<"ENDJS";
function setOptions(caller,itemnum) {
@@ -225,10 +225,11 @@ sub display_one {
if ($unzip_result ne 'ok') {
$r->print(
- '
'
- .&mt('Processing of your IMS package failed because the file you'
- .' uploaded could not be unzipped.')
- .'
'
+ &Apache::loncommon::confirmwrapper(
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('Processing of your IMS package failed because the file you'
+ .' uploaded could not be unzipped.'),1)
+ .' '.&mt('Error: [_1]',$unzip_result))
);
return();
}
@@ -239,23 +240,24 @@ sub display_one {
\%resinfo,'choose',\%includedres,\%includeditems);
if ($manifest_result ne 'ok') {
$r->print(
- '
'
- .&mt('Unpacking of your IMS package failed because an IMS manifest file was not located in the package.')
- .'
'
+ ' '.&Apache::loncommon::confirmwrapper(
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('Unpacking of your IMS package failed because an IMS manifest file'
+ .' was not located in the package.'),1))
);
return();
}
# Count areas depending on cms version
- foreach my $res (sort keys %resources) {
+ foreach my $res (sort(keys(%resources))) {
if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webctce4') {
- foreach my $area (keys %{$cmsmap{$cms}}) {
+ foreach my $area (keys(%{$cmsmap{$cms}})) {
if ($resources{$res}{type} eq $cmsmap{$cms}{$area}) {
$count{$area} ++;
}
}
} elsif ($cms eq 'angel5') {
- foreach my $area (keys %{$cmsmap{$cms}}) {
+ foreach my $area (keys(%{$cmsmap{$cms}})) {
if ($area eq 'doc') {
if (grep/^$resources{$res}{type}$/,@{$cmsmap{$cms}{doc}}) {
$count{$area} ++;
@@ -455,16 +457,16 @@ sub display_two {
my $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,\%resources,\%items,\%hrefs,\%resinfo,'prepare',\%includedres,\%includeditems);
if ($manifest_result eq 'ok') {
- foreach my $res (sort keys %resources) {
+ foreach my $res (sort(keys(%resources))) {
if ($importareas{$resources{$res}{type}}) {
$includedres{$res} = 1;
}
}
- foreach my $itm (sort keys %items) {
+ foreach my $itm (sort(keys(%items))) {
&Apache::imsprocessor::get_imports(\%includeditems,\%items,\%resources,\%importareas,$itm);
}
}
- foreach my $itm (sort keys %includeditems) {
+ foreach my $itm (sort(keys(%includeditems))) {
&Apache::imsprocessor::get_parents(\%includeditems,\%items,$itm);
}
@@ -558,7 +560,7 @@ sub display_two {
# Re-initialize Button
my $initbutton =
'';
$r->print(
'