--- loncom/imspackages/imsimportdocs.pm 2004/08/05 23:21:49 1.7 +++ loncom/imspackages/imsimportdocs.pm 2006/03/23 23:12:21 1.15 @@ -143,59 +143,54 @@ sub handler { &Apache::imsprocessor::ims_config(\@areas,\%cmsmap,\%areaname); # get course data - my $coursenum=$ENV{'course.'.$ENV{'request.course.id'}.'.num'}; - my $coursedom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; - my $coursehome=$ENV{'course.'.$ENV{'request.course.id'}.'.home'}; + my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'}; + my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'}; # get personal data - my $uname=$ENV{'user.name'}; - my $udom=$ENV{'user.domain'}; + my $uname=$env{'user.name'}; + my $udom=$env{'user.domain'}; my $plainname=&Apache::lonnet::escape( &Apache::loncommon::plainname($uname,$udom)); # does this user have privileges to post, etc? - my $allowed=&Apache::lonnet::allowed('mdc',$ENV{'request.course.id'}); + my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'}); unless ($allowed) { - $r->print("The LearningOnline Network with CAPA"); - $r->print(&Apache::loncommon::bodytag('Import IMS package')); - $r->print('

'.&mt('Modification of Course Contents Disallowed').'

'.&mt('Your current role does not grant you the right to modify course content in this course.').''); + $r->print(&Apache::loncommon::start_page('Import IMS package',undef, + {'only_body' => 1,})); + $r->print('

'.&mt('Modification of Course Contents Disallowed').'

'.&mt('Your current role does not grant you the right to modify course content in this course.'). + &Apache::loncommon::end_page()); return OK; } &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['phase']); - if ($ENV{'form.phase'} eq 'one') { + if ($env{'form.phase'} eq 'one') { &jscript_one(\$javascript); - } elsif ($ENV{'form.phase'} eq 'two') { + } elsif ($env{'form.phase'} eq 'two') { &jscript_two(\$javascript); - } elsif ($ENV{'form.phase'} eq 'three') { + } elsif ($env{'form.phase'} eq 'three') { &jscript_three(\$javascript); } + $javascript = + "\n"; + my $start_page = &Apache::loncommon::start_page('Import IMS package', + $javascript, + {'only_body' => 1,}); # print screen - $r->print(< - -The LearningOnline Network with CAPA - - -ENDHEAD -# -------------------------------------------------------------------- Body tag - $r->print(&Apache::loncommon::bodytag('Import IMS package')); - if ($ENV{'form.phase'} eq 'one') { + $r->print($start_page); + + if ($env{'form.phase'} eq 'one') { &display_one($r); - } elsif ($ENV{'form.phase'} eq 'two') { + } elsif ($env{'form.phase'} eq 'two') { &display_two($r,$coursenum,\@areas,\%areaname,%cmsmap); - } elsif ($ENV{'form.phase'} eq 'three') { - &display_three($r,$coursenum,$coursedom,$coursehome,$uname,$udom,\@areas,%cmsmap); + } elsif ($env{'form.phase'} eq 'three') { + &display_three($r,$coursenum,$coursedom,$uname,$udom,\@areas,%cmsmap); } - $r->print(""); + $r->print(&Apache::loncommon::end_page()); return OK; } @@ -235,6 +230,7 @@ Please choose the CMS used to create you