--- loncom/interface/londocs.pm 2009/12/07 02:22:24 1.411.2.1 +++ loncom/interface/londocs.pm 2010/01/21 23:19:17 1.416 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.411.2.1 2009/12/07 02:22:24 raeburn Exp $ +# $Id: londocs.pm,v 1.416 2010/01/21 23:19:17 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 ++; @@ -425,37 +423,33 @@ 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" .'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().''."\n"; # Existing discussion posts? if ($discussiontime{$ressymb} > 0) { $boards ++; - $currelem = $count+$boards+$startcount; $display .= '' .'' .''."\n"; - } else { + } elsif ($numdisc > 0) { $display .= ' '."\n"; } $display .= &Apache::loncommon::end_data_table_row(); @@ -2618,14 +2612,6 @@ sub handler { return OK if $r->header_only; my $crstype = &Apache::loncommon::course_type(); - my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'}; - if ($coursedom eq 'gcitest') { - my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'}); - if ($allowed) { - &concept_test_builder($r); - return OK; - } - } # --------------------------------------------- Initialize help topics for this foreach my $topic ('Adding_Course_Doc','Main_Course_Documents', @@ -2980,9 +2966,9 @@ FUFORM SEDFFORM my @simpleeditdefaultforma = ( - { ''.&mt('Search').'' => "$uploadtag$lt{'srch'}" }, - { ''.&mt('Import').'' => "$lt{'impo'}$help{'Importing_LON-CAPA_Resource'}" }, - { ''.&mt('Import Bookmarks').'' => "$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=( - {''.&mt('New Composite Page').''=>$newpageform}, - {''.&mt('Syllabus').''=>$newsylform}, - {''.&mt('Group Portfolio').''=>$newgroupfileform}, + {''.$lt{newp}.''=>$newpageform}, + {''.$lt{syll}.''=>$newsylform}, + {''.$lt{grpo}.''=>$newgroupfileform}, ); } - push @specialdocumentsforma, ({''.&mt('Navigate Contents').''=>$newnavform}, - {''.&mt('Simple Course Page').''=>$newsmppageform}, - {''.&mt('Simple Problem').''=>$newsmpproblemform}, - {''.&mt('Drop Box').''=>$newdropboxform}, - {''.&mt('Score Upload Form').''=>$newexuploadform}, - {''.&mt('Discussion Board').''=>$newbulform}, - {''.&mt('My Personal Information Page').''=>$newaboutmeform}, - {''.&mt('Personal Information Page for a User').''=>$newaboutsomeoneform}, - {''.&mt('Course Roster').''=>$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)); @@ -3300,9 +3286,9 @@ if($env{'form.pagepath'}) { } my @tools = ( - {''.&mt('External Resource').''=>$extresourcesform}, - {''.&mt('IMS Import').''=>$imspform}, - {''.&mt('Recover Deleted Resources').''=>$recoverform}, + {''.$lt{extr}.''=>$extresourcesform}, + {''.$lt{imsf}.''=>$imspform}, + {''.$lt{reco}.''=>$recoverform}, ); my %orderhash = ( @@ -3417,9 +3403,9 @@ SNAMFORM my @specialdocs = ( - {''.&mt('External Resource').''=>$supnewextform}, - {''.&mt('Syllabus').''=>$supnewsylform}, - {''.&mt('My Personal Information Page').''=>$supnewaboutmeform}, + {''.$lt{extr}.''=>$supnewextform}, + {''.$lt{syll}.''=>$supnewsylform}, + {''.$lt{mypi}.''=>$supnewaboutmeform}, ); my %suporderhash = ( '00' => ['Supnewfolder', $supnewfolderform], @@ -3474,22 +3460,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 = ( - {''.&mt('Verify Content').''=>"$lt{'vc'}$help{'Verify_Content'}"}, - {''.&mt('Check/Set Resource Versions').''=>"$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, {''.&mt('Dump Course DOCS to Construction Space: available on other servers').''=>$dumpbut}; + push @list, {''.$lt{dcd}.''=>$dumpbut}; } - push @list, ({''.&mt('IMS Export').''=>$exportbut}, - {''.&mt('List Symbs').''=>"$lt{'ls'}"}, - {''.&mt('Show Log').''=>"$lt{'sl'}"}, + push @list, ({''.$lt{imse}.''=>$exportbut}, + {''.$lt{ls}.''=>"$lt{'ls'}"}, + {''.$lt{sl}.''=>"$lt{'sl'}"}, ); return ''.create_form_ul(create_list_elements(@list)).''; @@ -3540,20 +3528,6 @@ sub generate_edit_table { return $form; } -sub concept_test_builder { - my ($r) = @_; - $r->print(&Apache::loncommon::start_page('Assemble Test')); - &Apache::londocsgci::setdefaults(); - if ($env{'form.phase'} eq 'storemap') { - &Apache::londocsgci::evaluate(); - &Apache::londocsgci::store($r); - } - &Apache::londocsgci::load(); - &Apache::londocsgci::listresources($r); - $r->print(&Apache::loncommon::end_page()); - return; -} - sub editing_js { my ($udom,$uname) = @_; my $now = time();