--- loncom/interface/londocs.pm 2009/10/31 19:54:51 1.408 +++ loncom/interface/londocs.pm 2010/01/21 19:22:03 1.415 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.408 2009/10/31 19:54:51 raeburn Exp $ +# $Id: londocs.pm,v 1.415 2010/01/21 19:22:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -341,20 +341,20 @@ 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.' + ,'','') + .'

'; if ($copyresult) { $outcome .= '

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

'; } - $outcome .= '

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

'; } else { $outcome = '

' .&mt('Unfortunately you will not be able to retrieve' - .' an IMS archive of this posts at this time,' + .' an IMS archive of your course at this time,' .' because there was a problem creating a' .' manifest file.') .'

' @@ -368,24 +368,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 '.$crstype.'.') - .'

'; - $display .= '
'. + my $display=''."\n". + '

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

'. + '
'. ''.&mt('Content items').''. ''. '  
'. - '
'. - ''.&mt('Discussion posts').''. - ''. - '  '. - '
'; + ' onclick="javascript:uncheckAll(document.exportdoc.archive)" />
'; + if ($numdisc > 0) { + $display .= '
'. + ''.&mt('Discussion posts').''. + ''. + '  '. + '
'; + } + $display .= '
'; my $curRes; my $depth = 0; my $count = 0; @@ -396,15 +398,11 @@ sub exportcourse { my $lastcontainer = $startcount; $display .= &Apache::loncommon::start_data_table() .&Apache::loncommon::start_data_table_header_row() - .''.&mt('Export content item?').'' - .''; + .''.&mt('Export content item?').''; if ($numdisc > 0) { - $display .= &mt('Export discussion posts?'); - } else { - $display .= ' '; + $display .= ''.&mt('Export discussion posts?').''; } - $display .= '' - .&Apache::loncommon::end_data_table_header_row(); + $display .= &Apache::loncommon::end_data_table_header_row(); while ($curRes = $it->next()) { if (ref($curRes)) { $count ++; @@ -455,7 +453,7 @@ sub exportcourse { $display .= '' .'' .''."\n"; - } else { + } elsif ($numdisc > 0) { $display .= ' '."\n"; } $display .= &Apache::loncommon::end_data_table_row(); @@ -2478,7 +2476,7 @@ ENDHEADERS ('select_form_order' => ['',1..$currentversion,'mostrecent'], '' => '', - 'mostrecent' => 'most recent', + 'mostrecent' => &mt('most recent'), map {$_,$_} (1..$currentversion)))); $r->print(''); my $lastold=1; @@ -2682,7 +2680,12 @@ sub handler { &Apache::loncommon::restore_course_settings('docs_folderpath', {'folderpath' => 'scalar'}); } - if (!$env{'form.folderpath'}) { + if (!$allowed) { + unless($env{'form.folderpath'} =~ /^supplemental/) { + $env{'form.folderpath'} = ''; + } + } + if (!$env{'form.folderpath'} && $allowed) { &Apache::loncommon::restore_course_settings('docs_folderpath', {'pagepath' => 'scalar'}); } @@ -2967,9 +2970,9 @@ FUFORM SEDFFORM my @simpleeditdefaultforma = ( - { 'pic03' => "$uploadtag$lt{'srch'}" }, - { 'pic04' => "$lt{'impo'}$help{'Importing_LON-CAPA_Resource'}" }, - { 'pic05' => "$lt{'book'}" }, + { ''.$lt{srch}.'' => "$uploadtag$lt{'srch'}" }, + { ''.$lt{impo}.'' => "$lt{'impo'}$help{'Importing_LON-CAPA_Resource'}" }, + { ''.$lt{book}.'' => "$lt{'book'}" }, ); $simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma)); $simpleeditdefaultform .=(< NGFFORM @specialdocumentsforma=( - {'pic06'=>$newpageform}, - {'pic07'=>$newsylform}, - {'pic08'=>$newgroupfileform}, + {''.$lt{newp}.''=>$newpageform}, + {''.$lt{syll}.''=>$newsylform}, + {''.$lt{grpo}.''=>$newgroupfileform}, ); } - push @specialdocumentsforma, ({'pic09'=>$newnavform}, - {'pic10'=>$newsmppageform}, - {'pic11'=>$newsmpproblemform}, - {'pic12'=>$newdropboxform}, - {'pic13'=>$newexuploadform}, - {'pic14'=>$newbulform}, - {'pic15'=>$newaboutmeform}, - {'pic16'=>$newaboutsomeoneform}, - {'pic17'=>$newrosterform},); + push @specialdocumentsforma, ({''.$lt{navc}.''=>$newnavform}, + {''.$lt{sipa}.''=>$newsmppageform}, + {''.$lt{sipr}.''=>$newsmpproblemform}, + {''.$lt{drbx}.''=>$newdropboxform}, + {''.$lt{scuf}.''=>$newexuploadform}, + {''.$lt{bull}.''=>$newbulform}, + {''.$lt{mypi}.''=>$newaboutmeform}, + {''.$lt{abou}.''=>$newaboutsomeoneform}, + {''.$lt{rost}.''=>$newrosterform},); $specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma)); if($env{'form.pagepath'}) { @specialdocumentsforma=( - {'pic32'=>$newsmpproblemform}, - {'pic33'=>$newexuploadform} + {''.&mt('Simple Problem').''=>$newsmpproblemform}, + {''.&mt('Score Upload Form').''=>$newexuploadform} ); $specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma)); } my @tools = ( - {'pic18'=>$extresourcesform}, - {'pic19'=>$imspform}, - {'pic20'=>$recoverform}, + {''.$lt{extr}.''=>$extresourcesform}, + {''.$lt{imsf}.''=>$imspform}, + {''.$lt{reco}.''=>$recoverform}, ); my %orderhash = ( @@ -3404,9 +3407,9 @@ SNAMFORM my @specialdocs = ( - {'pic29'=>$supnewextform}, - {'pic30'=>$supnewsylform}, - {'pic31'=>$supnewaboutmeform}, + {''.$lt{extr}.''=>$supnewextform}, + {''.$lt{syll}.''=>$supnewsylform}, + {''.$lt{mypi}.''=>$supnewaboutmeform}, ); my %suporderhash = ( '00' => ['Supnewfolder', $supnewfolderform], @@ -3461,22 +3464,24 @@ sub generate_admin_options { 'vc' => 'Verify Content', 'cv' => 'Check/Set Resource Versions', 'ls' => 'List Symbs', - 'sl' => 'Show Log' + 'sl' => 'Show Log', + 'imse' => 'IMS Export', + 'dcd' => 'Dump Course DOCS to Construction Space: available on other servers' ); my %help = %{$help_ref}; my %env = %{$env_ref}; my $dumpbut=&dumpbutton(); my $exportbut=&exportbutton(); my @list = ( - {'pic21'=>"$lt{'vc'}$help{'Verify_Content'}"}, - {'pic22'=>"$lt{'cv'}$help{'Check_Resource_Versions'}"}, + {''.$lt{vc}.''=>"$lt{'vc'}$help{'Verify_Content'}"}, + {''.$lt{cv}.''=>"$lt{'cv'}$help{'Check_Resource_Versions'}"}, ); if($dumpbut ne ''){ - push @list, {'pic23'=>$dumpbut}; + push @list, {''.$lt{dcd}.''=>$dumpbut}; } - push @list, ({'pic24'=>$exportbut}, - {'pic25'=>"$lt{'ls'}"}, - {'pic26'=>"$lt{'sl'}"}, + push @list, ({''.$lt{imse}.''=>$exportbut}, + {''.$lt{ls}.''=>"$lt{'ls'}"}, + {''.$lt{sl}.''=>"$lt{'sl'}"}, ); return ''.create_form_ul(create_list_elements(@list)).'';