--- loncom/imspackages/imsimport.pm 2005/04/07 06:56:22 1.11
+++ loncom/imspackages/imsimport.pm 2006/03/23 23:17:46 1.15
@@ -27,7 +27,6 @@ use strict;
use Apache::Constants qw(:common :http :methods);
use Apache::loncacc;
use Apache::loncommon();
-use Apache::Log();
use Apache::lonnet;
use Apache::imsprocessor;
use HTML::Parser;
@@ -39,6 +38,15 @@ use File::Basename();
# ---------------------------------------------------------------- Jscript One
sub jscript_one {
my ($fullpath,$jsref) = @_;
+
+ my $start_page =
+ &Apache::loncommon::start_page('Create IMS import directory',undef,
+ {'only_body' => 1,
+ 'add_entries' => "topmargin='0' leftmargin='0' marginheight='0'marginwidth='0' rightmargin='0'",
+ 'js_ready' => 1,});
+ my $end_page =
+ &Apache::loncommon::end_page({'js_ready' => 1,});
+
$$jsref = <<"END_OF_ONE";
function verify() {
if ((document.forms.dataForm.newdir.value == '') || (!document.forms.dataForm.newdir.value)) {
@@ -62,22 +70,22 @@ function createWin() {
document.dataForm.newdir.value = "";
newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes")
newWindow.document.open()
- newWindow.document.write("
Create IMS import directory \\n")
- newWindow.document.write("\\n")
- newWindow.document.write(" \\n")
+ newWindow.document.write('$start_page')
+ newWindow.document.write("\\n \\n")
newWindow.document.write("\\n")
newWindow.document.write(" \\n")
newWindow.document.write("Location: $fullpath New Directory \\n")
newWindow.document.write(" \\n")
newWindow.document.write(" \\n")
- newWindow.document.write("
")
+ newWindow.document.write("")
+ newWindow.document.write('$end_page')
newWindow.document.close()
newWindow.focus()
}
@@ -292,11 +300,11 @@ sub display_one {
Please choose the CMS used to create your IMS content package.
- Please select
- Blackboard 5
- Blackboard 6
- ANGEL
- WebCT 4
+ Please select
+ Blackboard 5
+ Blackboard 6
+ ANGEL
+ WebCT 4
@@ -319,7 +327,7 @@ Please choose the CMS used to create you
-Please choose a destination LON-CAPA directory in which to store the contents of the IMS package file.
+Please choose a destination LON-CAPA directory in which to store the contents of the IMS package file.
@@ -331,9 +339,9 @@ Please choose a destination LON-CAPA dir
-
-
-
+
+
+
@@ -344,10 +352,10 @@ Please choose a destination LON-CAPA dir
@@ -482,13 +490,13 @@ ENDBLOCK
if ($area eq 'board') {
$r->print("
- <-- Check Import first
+ <-- Check Import first
");
} elsif ($area eq 'users') {
$r->print("
- <-- Check Import first
+ <-- Check Import first
");
@@ -535,7 +543,7 @@ ENDBLOCKTWO
Choose course:
- Not required
+ Not required
@@ -579,10 +587,10 @@ ENDBLOCK
@@ -606,14 +614,12 @@ sub display_three {
my ($r,$uname,$udom,$areas,$areaname,$cmsmap,$destdir,$newdir) = @_;
my $crs = '';
my $cdom = '';
- my $chome = '';
my $db_handling = '';
my $timenow = time;
my $announce_handling = 'ok';
my $cms = $env{'form.source'};
if ( defined($env{'form.bb_crs'}) ) {
($cdom,$crs) = split/\//,$env{'form.bb_crs'};
- $chome = &Apache::lonnet::homeserver($crs,$cdom);
}
my $user_crs = '';
my $user_cdom = '';
@@ -699,7 +705,7 @@ 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);
- my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$chome,$destdir,$timenow,\%importareas);
+ my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$destdir,$timenow,\%importareas);
&Apache::imsprocessor::build_structure($cms,'CSTR',$destdir,\%items,\%resinfo,\%resources,\@targets,\%hrefs,$udom,$uname,$newdir,$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames,\@packages,\%includeditems,\%randompicks);
@@ -863,10 +869,13 @@ sub handler {
} elsif ($env{'form.phase'} eq 'four') {
&jscript_three(\$javascript);
}
- $r->print("LON-CAPA Construction Space \n");
-
- $r->print(&Apache::loncommon::bodytag('Upload IMS package to Construction Space',undef,$loadentries));
-
+ $javascript = "\n";
+
+ my $title = 'Upload IMS package to Construction Space';
+ $r->print(&Apache::loncommon::start_page($title, $javascript,
+ {'add_entries' =>
+ $loadentries,}));
+
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
$r->print(''.&mt('Co-Author').': '.$uname.
&mt(' at ').$udom.' ');
@@ -890,7 +899,7 @@ sub handler {
} else {
&Apache::lonupload::phaseone($r,$fn,$uname,$udom,'imsimport');
}
- $r->print('