--- loncom/interface/londocs.pm 2010/01/22 00:49:08 1.325.2.3 +++ loncom/interface/londocs.pm 2009/09/24 22:04:40 1.325.4.1 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.325.2.3 2010/01/22 00:49:08 raeburn Exp $ +# $Id: londocs.pm,v 1.325.4.1 2009/09/24 22:04:40 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,22 +281,12 @@ sub exportcourse { my $numdisc = keys(%discussiontime); my $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { - $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'}); + $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'}); return; } my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef); @@ -335,18 +325,12 @@ sub exportcourse { open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $outcome .= '

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

'; + $outcome .= &mt('Download the zip file from IMS '.lc($type).' archive
',$imszipfile,); 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 your course 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 this posts 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')); @@ -354,26 +338,22 @@ sub exportcourse { $r->print($outcome); $r->print(&Apache::loncommon::end_page()); } else { - my $display=''."\n". - '

'. - &mt('Choose which items you wish to export from your '.$crstype.'.'). - '

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

'. '

'); @@ -533,7 +507,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); @@ -2036,12 +2010,12 @@ END $line.=(< $form_start - + $form_end $form_start - + $form_end $form_start $rand_order_text $form_end @@ -2124,7 +2098,7 @@ sub checkonthis { if (($errorcount) || ($warningcount)) { if ($errorcount) { - $r->print(''.&mt('bomb').''. + $r->print(''. &mt('[quant,_1,error]',$errorcount).''); } if ($warningcount) { @@ -2514,19 +2488,14 @@ 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,' '). -$help{'Caching'}.'

'."\n\n"); - + &mt('re-initializing '.$course_type).'" onClick="reinit(this.form)" />'). +$help{'Caching'}.'

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

$lt{'copm'}

$help{'Load_Map'}


- +
ENDFORM unless ($env{'form.pagepath'}) { @@ -2984,13 +2944,13 @@ ENDFORM $uploadtag - $help{'Adding_External_Resource'}
- +
ENDFORM } @@ -3003,7 +2963,7 @@ ENDFORM $help{'Adding_Folders'} @@ -3012,7 +2972,7 @@ value="$lt{'newf'}" />$help{'Adding_Fold $help{'Adding_Pages'} @@ -3039,7 +2999,7 @@ $uploadtag $help{'Simple Page'} +onClick="javascript:makesmppage();" /> $help{'Simple Page'}
@@ -3047,7 +3007,7 @@ $uploadtag $help{'Simple Problem'} +onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}

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

@@ -3063,7 +3023,7 @@ $uploadtag +onClick="javascript:makeexamupload();" /> $help{'Score_Upload_Form'}
@@ -3072,7 +3032,7 @@ $uploadtag +onClick="javascript:makebulboard();" /> $help{'Bulletin Board'} @@ -3090,7 +3050,7 @@ $uploadtag +onClick="javascript:makeabout();" />
@@ -3120,7 +3080,7 @@ $uploadtag $help{'Simple Problem'} +onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}

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