version 1.41, 2013/07/15 14:32:51
|
version 1.49, 2023/07/23 13:33:52
|
Line 38 use HTML::Entities();
|
Line 38 use HTML::Entities();
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonupload; |
use Apache::lonupload; |
use File::Basename(); |
use File::Basename(); |
|
use File::Path(); |
use LONCAPA; |
use LONCAPA; |
|
|
# ---------------------------------------------------------------- Jscript One |
# ---------------------------------------------------------------- Jscript One |
Line 57 sub jscript_one {
|
Line 58 sub jscript_one {
|
my $end_page = |
my $end_page = |
&Apache::loncommon::end_page({'js_ready' => 1,}); |
&Apache::loncommon::end_page({'js_ready' => 1,}); |
|
|
my %lt = &Apache::lonlocal::texthash( |
my %js_lt = &Apache::lonlocal::texthash( |
ddir => 'You must choose a destination directory for the import', |
ddir => 'You must choose a destination directory for the import', |
cmss => 'You must choose the Course Management System from which the IMS package was exported', |
cmss => 'You must choose the Course Management System from which the IMS package was exported', |
|
); |
|
my %html_lt = &Apache::lonlocal::texthash( |
loca => 'Location:', |
loca => 'Location:', |
newd => 'New Directory', |
newd => 'New Directory', |
nndi => 'Enter the name of the new directory where you will store the contents of your IMS package.', |
nndi => 'Enter the name of the new directory where you will store the contents of your IMS package.', |
go => 'Go', |
go => 'Go', |
); |
); |
|
&js_escape(\%js_lt); |
|
&html_escape(\%html_lt); |
return <<"END_OF_ONE"; |
return <<"END_OF_ONE"; |
function verify() { |
function verify() { |
if ((document.forms.$formname.newdir.value == '') || (!document.forms.$formname.newdir.value)) { |
if ((document.forms.$formname.newdir.value == '') || (!document.forms.$formname.newdir.value)) { |
alert('$lt{'ddir'}') |
alert('$js_lt{'ddir'}') |
return false |
return false |
} |
} |
if (document.forms.$formname.source.selectedIndex == 0) { |
if (document.forms.$formname.source.selectedIndex == 0) { |
alert('$lt{'cmss'}'); |
alert('$js_lt{'cmss'}'); |
return false |
return false |
} |
} |
return true |
return true |
Line 92 function createWin() {
|
Line 97 function createWin() {
|
newWindow.document.write("\\n<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]' />\\n") |
newWindow.document.write("\\n<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]' />\\n") |
newWindow.document.write("<table border='0' cellspacing='0' cellpadding='0' width='600'>\\n") |
newWindow.document.write("<table border='0' cellspacing='0' cellpadding='0' width='600'>\\n") |
newWindow.document.write("<tr><td width='2'> </td><td width='3'> </td>\\n") |
newWindow.document.write("<tr><td width='2'> </td><td width='3'> </td>\\n") |
newWindow.document.write("<td><h3>$lt{'loca'} <tt>$fullpath</tt></h3><h3>$lt{'newd'}</h3></td></tr>\\n") |
newWindow.document.write("<td><h3>$html_lt{'loca'} <tt>$fullpath</tt></h3><h3>$html_lt{'newd'}</h3></td></tr>\\n") |
newWindow.document.write("<tr><td width='2'> </td><td width='3'> </td>\\n") |
newWindow.document.write("<tr><td width='2'> </td><td width='3'> </td>\\n") |
newWindow.document.write("<td><form name='fileaction' action='/adm/cfile' method='post'>\\n") |
newWindow.document.write("<td><form name='fileaction' action='/adm/cfile' method='post'>\\n") |
newWindow.document.write("$lt{'nndi'}<br /><br />") |
newWindow.document.write("$html_lt{'nndi'}<br /><br />") |
newWindow.document.write("<input type='hidden' name='filename' value='$fullpath' />") |
newWindow.document.write("<input type='hidden' name='filename' value='$fullpath' />") |
newWindow.document.write("<input type='hidden' name='action' value='newdir' />") |
newWindow.document.write("<input type='hidden' name='action' value='newdir' />") |
newWindow.document.write("<input type='hidden' name='callingmode' value='imsimport' />") |
newWindow.document.write("<input type='hidden' name='callingmode' value='imsimport' />") |
newWindow.document.write("$fullpath<input type='text' name='newfilename' value='' />") |
newWindow.document.write("$fullpath<input type='text' name='newfilename' value='' />") |
newWindow.document.write("<input type='button' value='$lt{'go'}' onclick='document.fileaction.submit();' />") |
newWindow.document.write("<input type='button' value='$html_lt{'go'}' onclick='document.fileaction.submit();' />") |
newWindow.document.write("</td></tr>\\n") |
newWindow.document.write("</td></tr>\\n") |
newWindow.document.write("</table>") |
newWindow.document.write("</table>") |
newWindow.document.write('$end_page') |
newWindow.document.write('$end_page') |
Line 133 sub jscript_two {
|
Line 138 sub jscript_two {
|
$course_list = '"'.join('","',@crslist).'"'; |
$course_list = '"'.join('","',@crslist).'"'; |
$$numcrs = @crslist; |
$$numcrs = @crslist; |
|
|
|
my %js_lt = &Apache::lonlocal::texthash( |
|
sel => 'Please select', |
|
impto => 'Import topics only', |
|
imptpa => 'Import topics + posts (with author)', |
|
imptpn => 'Import topics + posts (no author)', |
|
enrst => 'Enroll students only', |
|
enrall => 'Enroll all users', |
|
notreq => 'Not required', |
|
errao => 'You must select one of the additional options when importing Discussion Boards.', |
|
errtd => 'You must select a target course when importing Discussion Boards.', |
|
errap => 'You must select one of the additional options when importing Enrollment.', |
|
errte => 'You must select a target course when importing enrollment information.', |
|
errcc => 'You must check at least one Content Type.', |
|
); |
|
&js_escape(\%js_lt); |
return <<"END_OF_TWO"; |
return <<"END_OF_TWO"; |
|
|
function checkCourse() { |
function checkCourse() { |
Line 181 function setCourse(step2Form,call) {
|
Line 201 function setCourse(step2Form,call) {
|
step2Form.targetcourse.length = 0 |
step2Form.targetcourse.length = 0 |
if (call == 'add') { |
if (call == 'add') { |
step2Form.targetcourse.length = 0 |
step2Form.targetcourse.length = 0 |
step2Form.targetcourse.options[0] = new Option("Please Select","0",true,true) |
step2Form.targetcourse.options[0] = new Option("$js_lt{'sel'}","0",true,true) |
for (var i=0; i<courseID_array.length; i++) { |
for (var i=0; i<courseID_array.length; i++) { |
step2Form.targetcourse.options[i+1] = new Option(courseTitle_array[i],courseID_array[i],false,false) |
step2Form.targetcourse.options[i+1] = new Option(courseTitle_array[i],courseID_array[i],false,false) |
} |
} |
Line 201 function setOptions(caller,itemnum) {
|
Line 221 function setOptions(caller,itemnum) {
|
opForm.elements[menu].length = 0 |
opForm.elements[menu].length = 0 |
if (opForm.elements[itemnum*2].checked == true) { |
if (opForm.elements[itemnum*2].checked == true) { |
if (caller == "board") { |
if (caller == "board") { |
opForm.elements[menu].options[0] = new Option("Select","-1",true,true) |
opForm.elements[menu].options[0] = new Option("$js_lt{'sel'}","-1",true,true) |
opForm.elements[menu].options[1] = new Option("Import topics only","topics",true,true) |
opForm.elements[menu].options[1] = new Option("$js_lt{'impto'}","topics",true,true) |
opForm.elements[menu].options[2] = new Option("Import topics + posts (with author)","allpost",true,true) |
opForm.elements[menu].options[2] = new Option("$js_lt{'imptpa'}","allpost",true,true) |
opForm.elements[menu].options[3] = new Option("Import topics + posts (no author)","allanon",true,true) |
opForm.elements[menu].options[3] = new Option("$js_lt{'imptpn'}","allanon",true,true) |
} |
} |
else { |
else { |
if (caller == "users") { |
if (caller == "users") { |
opForm.elements[menu].length = 0 |
opForm.elements[menu].length = 0 |
opForm.elements[menu].options[0] = new Option("Select","-1",true,true) |
opForm.elements[menu].options[0] = new Option("$js_lt{'sel'}","-1",true,true) |
opForm.elements[menu].options[1] = new Option("Enroll students only","students",true,true) |
opForm.elements[menu].options[1] = new Option("$js_lt{'enrst'}","students",true,true) |
opForm.elements[menu].options[2] = new Option("Enroll all users","all",true,true) |
opForm.elements[menu].options[2] = new Option("$js_lt{'enrall'}","all",true,true) |
} |
} |
} |
} |
} |
} |
else { |
else { |
opForm.elements[menu].options[0] = new Option("Not required","0",true,true) |
opForm.elements[menu].options[0] = new Option("$js_lt{'notreq'}","0",true,true) |
} |
} |
opForm.elements[menu].selectedIndex = 0 |
opForm.elements[menu].selectedIndex = 0 |
if (numCrs > 0) { |
if (numCrs > 0) { |
Line 234 function verify(caller) {
|
Line 254 function verify(caller) {
|
totcheck ++ |
totcheck ++ |
if (opForm.elements[2*i].name == "board") { |
if (opForm.elements[2*i].name == "board") { |
if (opForm.elements[2*i+1].selectedIndex == 0) { |
if (opForm.elements[2*i+1].selectedIndex == 0) { |
alert("You must select one of the additional options when importing Discussion Boards ") |
alert("$js_lt{'errao'}") |
return false |
return false |
} |
} |
if (numCrs == 0) { |
if (numCrs == 0) { |
Line 243 function verify(caller) {
|
Line 263 function verify(caller) {
|
} |
} |
else { |
else { |
if (opForm.targetcourse.selectedIndex == 0) { |
if (opForm.targetcourse.selectedIndex == 0) { |
alert("You must select a target course when importing Discussion Boards") |
alert("$js_lt{'errtd'}") |
return false |
return false |
} |
} |
} |
} |
} |
} |
if (opForm.elements[2*i].name == "users") { |
if (opForm.elements[2*i].name == "users") { |
if (opForm.elements[2*i+1].selectedIndex == 0) { |
if (opForm.elements[2*i+1].selectedIndex == 0) { |
alert("You must select one of the additional options when importing Enrollment") |
alert("$js_lt{'errap'}") |
return false |
return false |
} |
} |
if (numCrs == 0) { |
if (numCrs == 0) { |
Line 259 function verify(caller) {
|
Line 279 function verify(caller) {
|
} |
} |
else { |
else { |
if (opForm.targetcourse.selectedIndex == 0) { |
if (opForm.targetcourse.selectedIndex == 0) { |
alert("You must select a target course when importing enrollment information") |
alert("$js_lt{'errte'}") |
return false |
return false |
} |
} |
} |
} |
Line 267 function verify(caller) {
|
Line 287 function verify(caller) {
|
} |
} |
} |
} |
if (totcheck == 0) { |
if (totcheck == 0) { |
alert("You must check the Checkbox for at least one Content Type"); |
alert("$js_lt{'errcc'}"); |
return false |
return false |
} |
} |
return true |
return true |
Line 286 END_OF_TWO
|
Line 306 END_OF_TWO
|
# ---------------------------------------------------------------- Display One |
# ---------------------------------------------------------------- Display One |
sub display_one { |
sub display_one { |
my ($r,$fn,$fullpath,$formname) = @_; |
my ($r,$fn,$fullpath,$formname) = @_; |
$r->print('<form name="'.$formname.'" method="post">'. |
$r->print('<form name="'.$formname.'" method="post" action="">'. |
&Apache::lonhtmlcommon::topic_bar(1,&mt('Specify the Course Management system used to create the package')). |
&Apache::lonhtmlcommon::topic_bar(1,&mt('Specify the Course Management system used to create the package')). |
&mt('Choose the CMS used to create your IMS content package.').' |
&mt('Choose the CMS used to create your IMS content package.').' |
<select name="source"> |
<select name="source"> |
<option value="-1" selected="selected">Please select</option> |
<option value="-1" selected="selected">'.&mt('Please select').'</option> |
<option value="bb5">Blackboard 5</option> |
<option value="bb5">Blackboard 5</option> |
<option value="bb6">Blackboard 6</option> |
<option value="bb6">Blackboard 6</option> |
<option value="angel5">ANGEL 5.5</option> |
<option value="angel5">ANGEL 5.5</option> |
Line 298 sub display_one {
|
Line 318 sub display_one {
|
<option value="webctvista4">WebCT Vista 4</option> |
<option value="webctvista4">WebCT Vista 4</option> |
</select><br />'."\n". |
</select><br />'."\n". |
&Apache::lonhtmlcommon::topic_bar(2,&mt('Create a directory where you will unpack your IMS package'))."\n". |
&Apache::lonhtmlcommon::topic_bar(2,&mt('Create a directory where you will unpack your IMS package'))."\n". |
&mt('Create a destination LON-CAPA directory in which to store the contents of the IMS package file.').' <input type="button" name="createdir" value="Create Directory" onclick="javascript:createWin()" /><input type="hidden" name="newdir" value="" /><br /><br /> |
&mt('Create a destination LON-CAPA directory in which to store the contents of the IMS package file.').' <input type="button" name="createdir" value="'.&mt('Create Directory').'" onclick="javascript:createWin()" /><input type="hidden" name="newdir" value="" /><br /><br /> |
<input type="hidden" name="filename" value="'.$fn.'" /> |
<input type="hidden" name="filename" value="'.$fn.'" /> |
<input type="hidden" name="phase" value="three" /> |
<input type="hidden" name="phase" value="three" /> |
<input type="button" name="nextpage" value="'.&mt('Proceed').'" onclick="javascript:nextPage();" /> |
<input type="button" name="nextpage" value="'.&mt('Proceed').'" onclick="javascript:nextPage();" /> |
Line 332 sub display_two {
|
Line 352 sub display_two {
|
type => 'Content type', |
type => 'Content type', |
addo => 'Additional options', |
addo => 'Additional options', |
chec => 'Check Import first', |
chec => 'Check Import first', |
bbus => 'Choose a course to receive bulletin boards and user enrollment', |
bbus => 'Choose a course to receive discussion boards and user enrollment', |
list => 'A listing of possible course targets will be displayed if import of bulletin boards and/or enrollment is checked above (step 3). If you do not plan to import either of these content types, there is no need to specify a course.', |
list => 'A listing of possible course targets will be displayed if import of discussion boards and/or enrollment is checked above (step 3). If you do not plan to import either of these content types, there is no need to specify a course.', |
chco => 'Choose course:', |
chco => 'Choose course:', |
nreq => 'Not required', |
nreq => 'Not required', |
yodo => 'You do not have active course coordinator status in any LON-CAPA courses currently, so bulletin boards and enrollment information included in your IMS package will be discarded, regardless of your import choice for these two items above (step 3).', |
yodo => 'You do not have active course coordinator status in any LON-CAPA courses currently, so discussion boards and enrollment information included in your IMS package will be discarded, regardless of your import choice for these two items above (step 3).', |
ifyo => "If you wish to import bulletin boards and/or user information into LON-CAPA please click 'Exit now' to quit the current IMS import process, and contact your domain coordinator and request a course coordinator role in a LON-CAPA course into which you can upload bulletin boards and/or enroll users.", |
ifyo => "If you wish to import discussion boards and/or user information into LON-CAPA please click 'Exit now' to quit the current IMS import process, and contact your domain coordinator and request a course coordinator role in a LON-CAPA course into which you can upload discussion boards and/or enroll users.", |
impa => 'Import package', |
impa => 'Import package', |
unpa => 'Unpacking of your IMS package failed because an IMS manifest file was not located in the package', |
unpa => 'Unpacking of your IMS package failed because an IMS manifest file was not located in the package', |
proc => 'Processing of your IMS package failed because the file you uploaded could not be unzipped', |
proc => 'Processing of your IMS package failed because the file you uploaded could not be unzipped', |
Line 364 sub display_two {
|
Line 384 sub display_two {
|
$tempdir,\%resources,\%items,\%hrefs,\%resinfo, |
$tempdir,\%resources,\%items,\%hrefs,\%resinfo, |
'choose',\%includedres,\%includeditems); |
'choose',\%includedres,\%includeditems); |
if ($manifest_result eq 'ok') { |
if ($manifest_result eq 'ok') { |
foreach my $res (sort keys %resources) { |
foreach my $res (sort(keys(%resources))) { |
if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webctce4' |
if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webctce4' |
|| $cms eq 'webctvista4') { |
|| $cms eq 'webctvista4') { |
foreach my $area (keys %{$$cmsmap{$cms}}) { |
foreach my $area (keys(%{$$cmsmap{$cms}})) { |
if ($resources{$res}{type} eq $$cmsmap{$cms}{$area}) { |
if ($resources{$res}{type} eq $$cmsmap{$cms}{$area}) { |
$count{$area} ++; |
$count{$area} ++; |
} |
} |
} |
} |
} elsif ($cms eq 'angel5') { |
} elsif ($cms eq 'angel5') { |
foreach my $area (keys %{$$cmsmap{$cms}}) { |
foreach my $area (keys(%{$$cmsmap{$cms}})) { |
if ($area eq 'doc') { |
if ($area eq 'doc') { |
if (grep/^$resources{$res}{type}$/,@{$$cmsmap{$cms}{doc}}) { |
if (grep/^$resources{$res}{type}$/,@{$$cmsmap{$cms}{doc}}) { |
$count{$area} ++; |
$count{$area} ++; |
Line 396 sub display_two {
|
Line 416 sub display_two {
|
$conditions = 'none'; |
$conditions = 'none'; |
} |
} |
|
|
$r->print('<form name="pickoptions" method="post">'. |
$r->print('<form name="pickoptions" method="post" action="">'. |
&Apache::lonhtmlcommon::topic_bar(3,$lt{'cont'}). |
&Apache::lonhtmlcommon::topic_bar(3,$lt{'cont'}). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
Line 465 sub display_two {
|
Line 485 sub display_two {
|
$r->print($lt{'unpa'}); |
$r->print($lt{'unpa'}); |
} |
} |
} else { |
} else { |
$r->print($lt{'proc'}); |
$r->print( |
|
'<br />'.&Apache::loncommon::confirmwrapper( |
|
&Apache::lonhtmlcommon::confirm_success($lt{'proc'},1) |
|
.'<br />'.&mt('Error: [_1]',$unzip_result)) |
|
); |
} |
} |
} |
} |
|
|
Line 543 sub display_three {
|
Line 567 sub display_three {
|
my $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir, |
my $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir, |
\%resources,\%items,\%hrefs,\%resinfo,'prepare', |
\%resources,\%items,\%hrefs,\%resinfo,'prepare', |
\%includedres); |
\%includedres); |
|
|
if ($manifest_result eq 'ok') { |
if ($manifest_result eq 'ok') { |
foreach my $res (sort keys %resources) { |
my %possibledep; |
|
foreach my $res (sort(keys(%resources))) { |
if ($importareas{$resources{$res}{type}}) { |
if ($importareas{$resources{$res}{type}}) { |
$includedres{$res} = 1; |
$includedres{$res} = 1; |
if ($resources{$res}{type} eq 'webct.manifest' || |
if ($resources{$res}{type} eq 'webct.manifest' || |
Line 552 sub display_three {
|
Line 578 sub display_three {
|
$resources{$res}{type} eq 'webct.question') { |
$resources{$res}{type} eq 'webct.question') { |
push(@assessmentfiles,$res); |
push(@assessmentfiles,$res); |
} |
} |
|
} elsif ($resources{$res}{usedby}) { |
|
$possibledep{$res} = 1; |
|
} |
|
} |
|
foreach my $res (sort(keys(%possibledep))) { |
|
if ($includedres{$resources{$res}{usedby}}) { |
|
$includedres{$res} = 1; |
} |
} |
} |
} |
foreach my $itm (sort keys %items) { |
foreach my $itm (sort(keys(%items))) { |
&Apache::imsprocessor::get_imports(\%includeditems,\%items,\%resources,\%importareas,$itm); |
&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); |
&Apache::imsprocessor::get_parents(\%includeditems,\%items,$itm); |
} |
} |
|
|
$manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir, |
$manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir, |
\%resources,\%items,\%hrefs,\%resinfo,'build', |
\%resources,\%items,\%hrefs,\%resinfo,'build', |
\%includedres,\%includeditems); |
\%includedres,\%includeditems); |
|
|
if ($manifest_result eq 'ok') { |
if ($manifest_result eq 'ok') { |
&Apache::imsprocessor::target_resources(\%resources,\%importareas,\@targets); |
&Apache::imsprocessor::target_resources(\%resources,\%importareas,\@targets); |
|
|
Line 584 sub display_three {
|
Line 618 sub display_three {
|
|
|
&Apache::imsprocessor::process_resinfo($cms,'CSTR',$tempdir,$destdir,\%items,\%resources,\@targets,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\@groups,\%messages,\@timestamp,\%boardnum,\%resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,\%total,$seqstem,$seqstem,\@resrcfiles,\@packages,\%hrefs,\@pages,\@sequences,\%randompicks); |
&Apache::imsprocessor::process_resinfo($cms,'CSTR',$tempdir,$destdir,\%items,\%resources,\@targets,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\@groups,\%messages,\@timestamp,\%boardnum,\%resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,\%total,$seqstem,$seqstem,\@resrcfiles,\@packages,\%hrefs,\@pages,\@sequences,\%randompicks); |
|
|
my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$destdir,$timenow,\@assessmentfiles,\%total); |
my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,\%resources,$tempdir,\@targets,\%urls,$crs,$cdom,$destdir,$timenow,\@assessmentfiles,\%total); |
|
|
&Apache::imsprocessor::build_structure($cms,'CSTR',$destdir,\%items,\%resinfo,\%resources,\@targets,\%hrefs,$udom,$uname,$dirpath,$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames,\@packages,\%includeditems,\%randompicks); |
&Apache::imsprocessor::build_structure($cms,'CSTR',$destdir,\%items,\%resinfo,\%resources,\@targets,\%hrefs,$udom,$uname,$dirpath,$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames,\@packages,\%includeditems,\%randompicks); |
|
|
$r->print("<h3>IMS import completed</h3>"); |
my $message = |
|
&Apache::lonhtmlcommon::confirm_success( |
|
&mt('IMS import completed')) |
|
.'<br />'.$lt{'yims'}.' '; |
|
|
if ($cms eq 'angel5') { |
if ($cms eq 'angel5') { |
$r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], and [quant,_3,bulletin board] have been created, and [quant,_4,file] copied.',$total{seq},$total{page},$total{board},$total{file})."\n"); |
$message .= &mt('A total of [quant,_1,sequence], [quant,_2,composite page], and [quant,_3,discussion board] have been created, and [quant,_4,file] copied.',$total{seq},$total{page},$total{board},$total{file})."\n"; |
} else { |
} else { |
$r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], [quant,_3,bulletin board], [quant,_4,quiz,quizzes], [quant,_5,survey], and [quant,_6,problem] have been created, and [quant,_7,file] copied.',$total{seq},$total{page},$total{board},$total{quiz},$total{surv},$total{prob},$total{file})."\n"); |
$message .= &mt('A total of [quant,_1,sequence], [quant,_2,composite page], [quant,_3,discussion board], [quant,_4,quiz,quizzes], [quant,_5,survey], and [quant,_6,problem] have been created, and [quant,_7,file] copied.',$total{seq},$total{page},$total{board},$total{quiz},$total{surv},$total{prob},$total{file})."\n"; |
} |
} |
$r->print('<br /><br />'.$lt{'plsv'}.' '.$lt{'tseq'}.'<br /><br />'.$lt{'tfin'}.'<br /><br /><a href="/priv/'.$udom.'/'.$uname.'/'.$dirpath.'/">'.$lt{'disp'}.'</a>'); |
$r->print( |
|
'<br />'.&Apache::loncommon::confirmwrapper($message) |
|
.'<p>'.$lt{'plsv'}.' '.$lt{'tseq'}.'</p>' |
|
.'<p>'.$lt{'tfin'}.'</p>' |
|
.&Apache::lonhtmlcommon::actionbox( |
|
['<a href="/priv/'.$udom.'/'.$uname.'/'.$dirpath.'/">'.$lt{'disp'}.'</a>']) |
|
); |
my $londocroot = $r->dir_config('lonDocRoot'); |
my $londocroot = $r->dir_config('lonDocRoot'); |
if ($destdir =~ m{^\Q$londocroot/priv/$udom/$uname/$dirpath\E}) { |
if ($destdir =~ m{^\Q$londocroot/priv/$udom/$uname/$dirpath\E}) { |
system (" rm -r -f $destdir/temp"); |
&File::Path::remove_tree("$destdir/temp",{ safe => 1 }); |
} |
} |
} elsif ($manifest_result eq 'nomanifest') { |
} elsif ($manifest_result eq 'nomanifest') { |
$r->print($lt{'proc'}); |
$r->print( |
|
'<br />'.&Apache::loncommon::confirmwrapper( |
|
&Apache::lonhtmlcommon::confirm_success($lt{'proc'},1)) |
|
); |
} |
} |
} |
} |
|
|
Line 646 sub get_ccroles {
|
Line 692 sub get_ccroles {
|
push @{$courses{$currcode}}, $cdom.'/'.$crs; |
push @{$courses{$currcode}}, $cdom.'/'.$crs; |
} |
} |
} |
} |
foreach my $code (sort @codes) { |
foreach my $code (sort(@codes)) { |
foreach my $crsdom (@{$courses{$code}}) { |
foreach my $crsdom (@{$courses{$code}}) { |
my ($cdom,$crs) = split/\//,$crsdom; |
my ($cdom,$crs) = split/\//,$crsdom; |
my $showcode = ''; |
my $showcode = ''; |
Line 727 END_JS
|
Line 773 END_JS
|
} |
} |
|
|
my $title = 'Upload IMS package to Authoring Space'; |
my $title = 'Upload IMS package to Authoring Space'; |
|
my $crsauthor; |
|
if ($env{'request.course.id'}) { |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
if (($udom eq $cdom) && ($uname eq $cnum)) { |
|
$title = 'Upload IMS package to Course Authoring Space'; |
|
$crsauthor = 1; |
|
} |
|
} |
|
|
$r->print(&Apache::loncommon::start_page($title, $javascript)); |
$r->print(&Apache::loncommon::start_page($title, $javascript)); |
|
|
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { |
unless ($crsauthor) { |
$r->print('<p><span class="LC_info">' |
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { |
.&mt('Co-Author [_1]',$uname.':'.$udom) |
$r->print('<p><span class="LC_info">' |
.'</span></p>' |
.&mt('Co-Author [_1]',$uname.':'.$udom) |
); |
.'</span></p>' |
|
); |
|
} |
} |
} |
if ($env{'form.phase'} eq 'two') { |
if ($env{'form.phase'} eq 'two') { |
my $flag = &Apache::lonupload::phasetwo($r,$fn,'imsimport'); |
my $flag = &Apache::lonupload::phasetwo($r,$fn,'imsimport'); |
if ($flag eq 'ok') { |
if ($flag eq 'ok') { |
&display_one($r,$fn,$fullpath,$formname_one); |
&display_one($r,$fn,$fullpath,$formname_one); |
|
} else { |
|
$r->print( |
|
'<br />'.&Apache::loncommon::confirmwrapper( |
|
&Apache::lonhtmlcommon::confirm_success( |
|
&mt('Error uploading IMS package'),1)) |
|
); |
} |
} |
} elsif ( ($env{'form.phase'} eq 'three') || ($env{'form.phase'} eq 'four') ) { |
} elsif ( ($env{'form.phase'} eq 'three') || ($env{'form.phase'} eq 'four') ) { |
my $destdir = $env{'form.newdir'}; |
my $destdir = $env{'form.newdir'}; |