--- loncom/interface/londocs.pm 2010/01/22 01:23:34 1.325.2.5 +++ 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.5 2010/01/22 01:23:34 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 ''; } @@ -265,10 +265,10 @@ sub dumpcourse { sub exportbutton { my $type = &Apache::loncommon::course_type(); - return ''. - &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'
'; + return '
'. + ''. + &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'
'; } @@ -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 '.$type.' 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); @@ -312,17 +302,7 @@ sub exportcourse { my @exportitems = &Apache::loncommon::get_env_multiple('form.archive'); my @discussions = &Apache::loncommon::get_env_multiple('form.discussion'); if (@exportitems == 0 && @discussions == 0) { - $outcome = - '

' - .&mt('As you did not select any content items or discussions' - .' for export, an IMS package has not been created.') - .'

' - .'

' - .&mt('Please [_1]go back[_2] to select either content items' - .' or discussions for export.' - ,'' - ,'') - .'

'; + $outcome = '
As you did not select any content items or discussions for export, an IMS package has not been created. Please go back to select either content items or discussions for export'; } else { my $now = time; my %symbs; @@ -345,53 +325,35 @@ 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 this posts at this time,' - .' because there was a problem creating a' - .' manifest file.') - .'

' - .'

' - .&mt('Go Back') - .'

'; + $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 '.$type.' to IMS Package')); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export')); + $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); $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; @@ -400,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 ++; @@ -427,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 '.$type.' to IMS Package', - $scripttag)); + $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().'' - .'' - .'    
'. '

'. '

'); + &mt('Export '.$type.' DOCS').'" />

'); } } @@ -551,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". ' 0) { my $num = 0; my $state = ' @@ -2010,7 +1966,7 @@ END my $ro_set= ((&LONCAPA::map::getparameter($orderidx,'parameter_randomorder'))[0]=~/^yes$/i?' checked="checked"':''); $rand_order_text =' -'; +'; } if ($ispage) { my $pagename=&escape($pagetitle); @@ -2054,12 +2010,12 @@ END $line.=(< $form_start - + $form_end $form_start - + $form_end $form_start $rand_order_text $form_end @@ -2142,7 +2098,7 @@ sub checkonthis { if (($errorcount) || ($warningcount)) { if ($errorcount) { - $r->print(''.&mt('bomb').''. + $r->print(''. &mt('[quant,_1,error]',$errorcount).''); } if ($warningcount) { @@ -2532,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"); } @@ -2552,7 +2503,7 @@ sub init_breadcrumbs { my ($form,$text)=@_; &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs", - text=>&Apache::loncommon::course_type().' Editor', + text=>"Edit ".&Apache::loncommon::course_type(), faq=>273, bug=>'Instructor Interface', help => 'Docs_Adding_Course_Doc'}); @@ -2613,7 +2564,7 @@ sub handler { &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space'); &dumpcourse($r); } elsif ($allowed && $env{'form.exportcourse'}) { - &init_breadcrumbs('exportcourse','IMS Export'); + &init_breadcrumbs('exportcourse','Export '.&Apache::loncommon::course_type().' to IMS'); &exportcourse($r); } else { # is this a standard course? @@ -2697,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, @@ -2825,24 +2772,13 @@ sub handler { 'grpo' => 'Group Portfolios', 'rost' => 'Course Roster', 'abou' => 'About User', - 'imsf' => 'IMS Import', - 'imsl' => 'Import IMS package', + 'imsf' => 'Import IMS package', 'file' => 'File', 'title' => 'Title', 'comment' => 'Comment', 'parse' => 'If HTML file, upload embedded images/multimedia files' ); # ----------------------------------------------------------------------------- - my %tabtitles = ( - main => { - Course => &mt('Main Course Documents'), - Community => &mt('Main Community Documents'), - }, - supplemental => { - Course => &mt('Supplemental Course Documents'), - Community => &mt('Supplemental Community Documents'), - }, - ); if ($allowed) { &update_paste_buffer($coursenum,$coursedom); my $dumpbut=&dumpbutton(); @@ -2858,7 +2794,8 @@ sub handler { if (!$folderpath) { if ($env{'form.folder'} eq '' || $env{'form.folder'} eq 'supplemental') { - $folderpath='default&'.&escape($tabtitles{'main'}{$type}); + $folderpath='default&'. + &escape(&mt('Main '.$type.' Documents')); } } unless ($env{'form.pagepath'}) { @@ -2919,12 +2856,7 @@ ENDCOURSEVERIFY } my $postexec=''; if ($folder eq 'default') { - $r->print(''."\n" - ); + $r->print(''); } else { #$postexec='self.close();'; } @@ -2982,27 +2914,27 @@ $uploadtag
$lt{'pubd'}
$uploadtag - +
- + $help{'Importing_LON-CAPA_Resource'}
- +

$lt{'copm'}

$help{'Load_Map'}


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

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

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

@@ -3156,7 +3088,7 @@ $uploadtag +onClick="javascript:makeexamupload();" /> $help{'Score_Upload_Form'}
@@ -3178,7 +3110,7 @@ ENDBLOCK if ($folder =~ /^supplemental$/ && (($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) { $env{'form.folderpath'} = 'supplemental&'. - &escape($tabtitles{'supplemental'}{$type}); + &escape(&mt('Supplemental '.$type.' Documents')); } my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); if ($error) { @@ -3224,7 +3156,7 @@ $lt{'comment'}:
$help{'Adding_Folders'} @@ -3233,7 +3165,7 @@ value="$lt{'newf'}" /> $help{'Adding_Fol $help{'Adding_External_Resource'}