--- loncom/interface/londocs.pm 2013/09/01 03:21:46 1.484.2.40 +++ loncom/interface/londocs.pm 2013/08/07 00:03:24 1.557 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.484.2.40 2013/09/01 03:21:46 raeburn Exp $ +# $Id: londocs.pm,v 1.557 2013/08/07 00:03:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -355,7 +355,7 @@ $initialtext END $env{'form.output'}=$newhtml; - my $result = + my $result = &Apache::lonnet::finishuserfileupload($coursenum,$coursedom, 'output', "$filepath/$residx/$fname.html"); @@ -380,7 +380,7 @@ END removefrommap => \%removefrommap, removeparam => \%removeparam, ); - my ($result,$msgsarray,$lockerror) = + my ($result,$msgsarray,$lockerror) = &apply_fixups($folder,1,$coursedom,$coursenum,\%import_errors,\%updated); if (keys(%import_errors) > 0) { $fixuperrors = @@ -410,8 +410,6 @@ END unless ($fatal) { if ($folder =~ /^supplemental/) { &Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); - my ($errtext,$fatal) = &mapread($coursenum,$coursedom, - $folder.'.'.$container); } } return ($errtext,$fatal,$fixuperrors); @@ -1319,7 +1317,7 @@ sub do_paste_from_buffer { next; } if ($lockerr{$prefix}) { - $lockerrs{$suffix} = $lockerr{$prefix}; + $lockerrs{$suffix} = $lockerr{$prefix}; } } } @@ -1358,7 +1356,7 @@ sub do_paste_from_buffer { if ($newdocsdir eq '') { $newdocsdir = 'default'; } - if (($prefixchg{$suffix}) || + if (($prefixchg{$suffix}) || ($srcdom{$suffix} ne $coursedom) || ($srcnum{$suffix} ne $coursenum) || ($env{'form.docs.markedcopy_options_'.$suffix} ne 'move')) { @@ -1565,7 +1563,7 @@ sub dbcopy { if (ref($dbref) eq 'HASH') { if ($url =~ m{/(smppg|bulletinboard)$}) { my $prefix = $1; - if (($dbref->{'cdom'} =~ /^$match_domain$/) && + if (($dbref->{'cdom'} =~ /^$match_domain$/) && ($dbref->{'cnum'} =~ /^$match_courseid$/)) { my $db_name; my $marker = (split(m{/},$url))[4]; @@ -1600,12 +1598,12 @@ sub dbcopy { my $photo = $contents{'uploaded.photourl'}; my ($subdir,$fname) = ($photo =~ m{^/uploaded/$match_domain/$match_courseid/+(bulletin|simplepage)/(?:|\d+/)([^/]+)$}); - my $newphoto; + my $newphoto; if ($fname ne '') { my $content = &Apache::lonnet::getfile($photo); unless ($content eq '-1') { $env{'form.'.$suffix.'.photourl'} = $content; - $newphoto = + $newphoto = &Apache::lonnet::finishuserfileupload($coursenum,$coursedom,$suffix.'.photourl',"$subdir/$suffix/$fname"); delete($env{'form.'.$suffix.'.photourl'}); } @@ -1622,18 +1620,16 @@ sub dbcopy { } } if (($freedlock ne 'ok') && (ref($lockerrorsref) eq 'HASH')) { - $lockerrorsref->{$prefix} = + $lockerrorsref->{$prefix} = '
'. &mt('There was a problem removing a lockfile.'); if ($prefix eq 'smppg') { - $lockerrorsref->{$prefix} .= - ' '.&mt('This will prevent creation of additional simple pages in this course.'); + $lockerrorsref->{$prefix} .= + &mt('This will prevent creation of additional simple pages in this course.'); } else { - $lockerrorsref->{$prefix} .= ' '.&mt('This will prevent creation of additional bulletin boards in this course.'); + $lockerrorsref->{$prefix} .= &mt('This will prevent creation of additional bulletin boards in this course.'); } - $lockerrorsref->{$prefix} .= ' '.&mt('Please contact the [_1]helpdesk[_2] for assistance.', - '',''). - '
'; + $lockerrorsref->{$prefix} .= &mt('Please contact the domain coordinator for your LON-CAPA domain.').''; } } } elsif ($url =~ m{/syllabus$}) { @@ -1750,7 +1746,7 @@ sub url_paste_fixups { } next if ($token->[2]->{'type'} eq 'external'); if ($token->[2]->{'type'} eq 'zombie') { - next if ($skip); + next if ($skip); $zombies->{$oldurl}{$id} = $ressrc; $changed = 1; } elsif ($ressrc =~ m{^/uploaded/($match_domain)/($match_courseid)/(.+)$}) { @@ -2196,7 +2192,7 @@ sub update_parameter { 'randomorder' => {}, ); foreach my $which (keys(%allchecked)) { - $env{'form.all'.$which} =~ s/,$//; + $env{'form.all'.$which} =~ s/,$//; if ($which eq 'randompick') { foreach my $item (split(/,/,$env{'form.all'.$which})) { my ($res,$value) = split(/:/,$item); @@ -2223,7 +2219,7 @@ sub update_parameter { foreach my $which (keys(%allchecked)) { if (($which eq 'randompick' || $which eq 'randomorder')) { next if (!$is_map); - } + } my $oldvalue = 0; my $newvalue = 0; if ($allchecked{$which}{$res}) { @@ -2682,11 +2678,11 @@ sub editor { if (@allidx > 0) { my $path; if ($env{'form.folderpath'}) { - $path = + $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); } if (@allidx > 1) { - $to_show .= + $to_show .= &Apache::loncommon::continue_data_table_row(). ' '. ''. @@ -2830,7 +2826,7 @@ sub process_file_upload { } my $quotatype = 'unofficial'; if ($crstype eq 'Community') { - $quotatype = 'community'; + $quotatype = 'community'; } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.instcode'}) { $quotatype = 'official'; } @@ -3300,7 +3296,7 @@ $form_common."\n". $form_param."\n". $form_common."\n". ''. -$form_end; +$form_end; } } elsif ($supplementalflag && !$allowed) { $url .= ($url =~ /\?/) ? '&':'?'; @@ -3504,7 +3500,7 @@ sub new_timebased_suffix { } } if ($freedlock ne 'ok') { - $locknotfreed = + $locknotfreed = '
'. &mt('There was a problem removing a lockfile.').' '; if ($type eq 'paste') { @@ -3520,8 +3516,7 @@ sub new_timebased_suffix { } unless ($type eq 'paste') { $locknotfreed .= - ' '.&mt('Please contact the [_1]helpdesk[_2] for assistance.', - '',''); + ' '.&mt('Please contact the domain coordinator for your LON-CAPA domain.'); } $locknotfreed .= '
'; } @@ -4064,6 +4059,7 @@ sub startContentScreen { if (($mode eq 'navmaps') || ($mode eq 'supplemental')) { $output .= '    '.&mt('Content Overview').'    '."\n"; $output .= '     '.&mt('Content Search').'     '."\n"; + $output .= '      '.&mt('Content Index').'      '."\n"; $output .= '
  • '.&mt('Supplemental Content').'
  • '; } else { $output .= '
  •       '.&mt('Main Content Editor').'      
  • '."\n"; @@ -4185,9 +4181,9 @@ sub handler { # supplementalflag=0: show standard documents # toolsflag=1: show utilities - my $unesc_folderpath = &unescape($env{'form.folderpath'}); - my $supplementalflag=($unesc_folderpath=~/^supplemental/); - if (($unesc_folderpath=~/^default/) || ($unesc_folderpath eq "")) { + $env{'form.folderpath'} = &unescape($env{'form.folderpath'}); + my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/); + if (($env{'form.folderpath'}=~/^default/) || ($env{'form.folderpath'} eq "")) { $supplementalflag=0; } if ($env{'form.forcesupplement'}) { $supplementalflag=1; } @@ -4458,7 +4454,7 @@ sub handler { 'navc' => 'Table of Contents', 'sipa' => 'Simple Course Page', 'sipr' => 'Simple Problem', - 'webp' => 'Blank Web Page (editable)', + 'webp' => 'Blank Web Page (editable)', 'drbx' => 'Drop Box', 'scuf' => 'External Scores (handgrade, upload, clicker)', 'bull' => 'Discussion Board', @@ -4819,7 +4815,7 @@ NGFFORM ); } push(@importdoc, - {''.$lt{upl}.''=>$fileuploadform} + {''.$lt{upl}.''=>$fileuploadform} ); $fileuploadform = &create_form_ul(&create_list_elements(@importdoc)); @@ -5001,8 +4997,8 @@ my %suporderhash = ( } &Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); undef($suppchanges); - } - } + } + } } } elsif ($supplementalflag) { my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, @@ -5150,7 +5146,7 @@ sub remove_archive { my $currcmd = $env{'form.cmd'}; my $position = $env{'form.position'}; if ($position > 0) { - $env{'form.cmd'} = 'remove_'.$position; + $env{'form.cmd'} = 'del_'.$position; my ($title,$url,@rrest) = split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$position]]); if (&handle_edit_cmd($docuname,$docudom)) { @@ -5376,7 +5372,7 @@ sub editing_js { p_msb => 'Title for the Problem', p_mdb => 'Title for the Drop Box', p_mbb => 'Title for the Discussion Board', - p_mwp => 'Title for Web Page', + p_mwp => 'Title for Web Page', p_mab => "Enter user:domain for User's Personal Information Page", p_mab2 => 'Personal Information Page of ', p_mab_alrt1 => 'Not a valid user:domain', @@ -5490,7 +5486,7 @@ function makewebpage(type) { formname = this.document.forms.newwebpage; } if (title) { - var webpage = formname.importdetail.value; + var webpage = formname.importdetail.value; formname.importdetail.value = escape(title)+'='+webpage; formname.submit(); }