--- loncom/interface/londocs.pm 2009/05/21 02:47:48 1.325.2.1 +++ loncom/interface/londocs.pm 2010/01/21 23:42:55 1.325.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.325.2.1 2009/05/21 02:47:48 raeburn Exp $ +# $Id: londocs.pm,v 1.325.2.2 2010/01/21 23:42:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -145,7 +145,7 @@ sub dumpcourse { my ($r) = @_; my $type = &Apache::loncommon::course_type(); $r->print(&Apache::loncommon::start_page('Dump '.$type.' DOCS to Construction Space'). - '
'); + ''); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Dump '.$type.' DOCS to Construction Space')); my ($home,$other,%outhash)=&authorhosts(); unless ($home) { return ''; } @@ -281,12 +281,22 @@ sub exportcourse { my $numdisc = keys(%discussiontime); my $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { - $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package'). - '

IMS Export Failed

'. - '
'. - &mt('Unable to retrieve information about course contents'). - '
'.&mt('Return to Course Editor').''); - &Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($type).':'.$env{'request.course.id'}); + $r->print(&Apache::loncommon::start_page('Export '.$crstype.' to IMS Package'). + '

'.&mt('IMS Export Failed').'

'. + '
'); + if ($crstype eq 'Community') { + $r->print(&mt('Unable to retrieve information about community contents')); + } else { + $r->print(&mt('Unable to retrieve information about course contents')); + } + $r->print('
'); + if ($crstype eq 'Community') { + $r->print(&mt('Return to Community Editor')); + } else { + $r->print(&mt('Return to Course Editor')); + } + $r->print(''); + &Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'}); return; } my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef); @@ -325,12 +335,18 @@ sub exportcourse { open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $outcome .= &mt('Download the zip file from IMS '.lc($type).' archive
',$imszipfile,); + $outcome .= '

' + .&mt('[_1]Your IMS package[_2] is ready for download.' + ,'','') + .'

'; if ($copyresult) { - $outcome .= &mt('The following errors occurred during export - [_1]',$copyresult); + $outcome .= '

' + .&mt('The following errors occurred during export - [_1]' + ,$copyresult) + .'

'; } } else { - $outcome = '
'.&mt('Unfortunately you will not be able to retrieve an IMS archive of this posts at this time, because there was a problem creating a manifest file.').'
'; + $outcome = '
'.&mt('Unfortunately you will not be able to retrieve an IMS archive of your course at this time, because there was a problem creating a manifest file.').'
'; } } $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package')); @@ -338,22 +354,26 @@ sub exportcourse { $r->print($outcome); $r->print(&Apache::loncommon::end_page()); } else { - my $display; - $display = ''."\n"; - $display .= &mt('Choose which items you wish to export from your '.$type.'.

'); - $display .= ''. - ''. - ''. - ''. - '
 Content items'. - ''. + &mt('Choose which items you wish to export from your '.$crstype.'.'). + '

'. + '
'. + ''.&mt('Content items').''. + ''. - '  
  
 Discussion posts'. - ''. - '  
'; + '  '; + if ($numdisc > 0) { + $display .= '
'. + ''.&mt('Discussion posts').''. + ''. + '  '. + '
'; + } + $display .= ''; my $curRes; my $depth = 0; my $count = 0; @@ -362,13 +382,13 @@ sub exportcourse { my %parent = (); my %children = (); my $lastcontainer = $startcount; - my @bgcolors = ('#F6F6F6','#FFFFFF'); - $display .= ''. - ''; if ($numdisc > 0) { - $display.='Export discussion posts?'."\n"; + $display .= ''; } - $display.=' '; + $display .= &Apache::loncommon::end_data_table_header_row(); while ($curRes = $it->next()) { if (ref($curRes)) { $count ++; @@ -389,38 +409,43 @@ sub exportcourse { $ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard'; } } - my $color = $count%2; - $display .=''; + $display .= ' '.$curRes->title().''."\n"; + + # Existing discussion posts? + if ($discussiontime{$ressymb} > 0) { $boards ++; - $currelem = $count+$boards+$startcount; - $display .= ''."\n"; + $display .= ''."\n"; } else { - $display .= ''."\n"; + $display .= ''."\n"; } + $display .= &Apache::loncommon::end_data_table_row(); } } + $display .= &Apache::loncommon::end_data_table(); my $scripttag = qq| - |; $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package', $scripttag)); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); - $r->print($display.'
Export content item?
 '."\n"; + $display .= &Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row() + .''.&mt('Export content item?').''.&mt('Export discussion posts?').'
'."\n". - ''."\n" + .'is_sequence()) || ($curRes->is_page())) { - my $checkitem = $count + $boards + $startcount; - $display .= 'onClick="javascript:propagateCheck('."'$checkitem'".')"'; + $lastcontainer = $currelem; + $display .= 'onclick="javascript:propagateCheck('."'$currelem'".')"'; } $display .= ' />'."\n"; for (my $i=0; $i<$depth; $i++) { - $display .= ''."\n"; + $display .= ('' x2)."\n"; } if ($curRes->is_sequence()) { $display .= ' '."\n"; - $lastcontainer = $count + $startcount + $boards; } elsif ($curRes->is_page()) { $display .= ' '."\n"; - $lastcontainer = $count + $startcount + $boards; } - my $currelem = $count+$boards+$startcount; $children{$parent{$depth}} .= $currelem.':'; - $display .= ' '.$curRes->title().'  ' + .'' + .'  
'. + $r->print($display. '

'. '

'); @@ -507,7 +533,7 @@ sub create_ims_store { my $manifestfilename = $$tempexport.$manifest; if ($ims_manifest = Apache::File->new('>'.$manifestfilename)) { $$manifestok=1; - print $ims_manifest + print $ims_manifest ''."\n". ' '.&mt('Random Order').' '; +'; } if ($ispage) { my $pagename=&escape($pagetitle); @@ -2010,12 +2036,12 @@ END $line.=(< $form_start - + $form_end $form_start - + $form_end $form_start $rand_order_text $form_end @@ -2098,7 +2124,7 @@ sub checkonthis { if (($errorcount) || ($warningcount)) { if ($errorcount) { - $r->print(''. + $r->print(''.&mt('bomb').''. &mt('[quant,_1,error]',$errorcount).''); } if ($warningcount) { @@ -2488,13 +2514,17 @@ sub changewarning { $message='Changes will become active for your current session after [_1], or the next time you log in.'; } $r->print("\n\n". -''."\n". +''."\n". '
'. '

'. &mt($message,' '). + &mt('re-initializing '.$course_type).'" onclick="reinit(this.form)" />'). $help{'Caching'}.'

'."\n\n"); } @@ -2648,7 +2678,11 @@ sub handler { $script .= &editing_js($udom,$uname); } # -------------------------------------------------------------------- Body tag - $script = ''; + $script = ''; my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}]; $r->print(&Apache::loncommon::start_page("$type Documents", $script, {'force_register' => $showdoc, @@ -2856,7 +2890,12 @@ ENDCOURSEVERIFY } my $postexec=''; if ($folder eq 'default') { - $r->print(''); + $r->print('' + ); } else { #$postexec='self.close();'; } @@ -2914,27 +2953,27 @@ $uploadtag
$lt{'pubd'}
$uploadtag - +
- + $help{'Importing_LON-CAPA_Resource'}
- +

$lt{'copm'}

$help{'Load_Map'}


- +
ENDFORM unless ($env{'form.pagepath'}) { @@ -2944,13 +2983,13 @@ ENDFORM $uploadtag - $help{'Adding_External_Resource'}
- +
ENDFORM } @@ -2963,7 +3002,7 @@ ENDFORM $help{'Adding_Folders'} @@ -2972,7 +3011,7 @@ value="$lt{'newf'}" />$help{'Adding_Fold $help{'Adding_Pages'} @@ -2999,7 +3038,7 @@ $uploadtag $help{'Simple Page'} +onclick="javascript:makesmppage();" /> $help{'Simple Page'}
@@ -3007,7 +3046,7 @@ $uploadtag $help{'Simple Problem'} +onclick="javascript:makesmpproblem();" />$help{'Simple Problem'}

@@ -3015,7 +3054,7 @@ $uploadtag +onclick="javascript:makedropbox();" />

@@ -3023,7 +3062,7 @@ $uploadtag +onclick="javascript:makeexamupload();" /> $help{'Score_Upload_Form'}
@@ -3032,7 +3071,7 @@ $uploadtag +onclick="javascript:makebulboard();" /> $help{'Bulletin Board'} @@ -3050,7 +3089,7 @@ $uploadtag +onclick="javascript:makeabout();" />
@@ -3080,7 +3119,7 @@ $uploadtag $help{'Simple Problem'} +onclick="javascript:makesmpproblem();" />$help{'Simple Problem'}

@@ -3088,7 +3127,7 @@ $uploadtag +onclick="javascript:makeexamupload();" /> $help{'Score_Upload_Form'}
@@ -3156,7 +3195,7 @@ $lt{'comment'}:
$help{'Adding_Folders'} @@ -3165,7 +3204,7 @@ value="$lt{'newf'}" /> $help{'Adding_Fol $help{'Adding_External_Resource'}