--- loncom/interface/londocs.pm 2013/03/17 17:21:34 1.484.2.26 +++ loncom/interface/londocs.pm 2013/03/11 01:46:47 1.533 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.484.2.26 2013/03/17 17:21:34 raeburn Exp $ +# $Id: londocs.pm,v 1.533 2013/03/11 01:46:47 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -335,7 +335,7 @@ sub group_import { 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 = @@ -762,7 +762,7 @@ sub print_paste_buffer { $r->print('
'.$buffer); if ((!$areachange) && (!$othercourse) && ($env{'docs.markedcopy_cmd'} eq 'cut')) { - if (($is_uploaded_map) || + if (($is_uploaded_map) || ($env{'docs.markedcopy_url'} =~ /(bulletinboard|smppg)$/) || ($env{'docs.markedcopy_url'} =~ m{^/uploaded/$coursedom/$coursenum/(?:docs|supplemental)/(.+)$})) { my ($copytext,$movetext); @@ -1007,7 +1007,7 @@ sub do_paste_from_buffer { &url_paste_fixups($url,$folder,$prefixchg,$coursedom,$coursenum, $srcdom,$srcnum,$allmaps,\%rewrites, \%retitles,\%copies,\%dbcopies,\%zombies,\%params,\%mapmoves, - \%mapchanges,\%tomove,\%newsubdir,\%newurls); + \%mapchanges,\%tomove,\%newsubdir,\%newurls); } } elsif ($url=~m {^/res/}) { # published maps can only exists once, so remove it from paste buffer when done @@ -1043,9 +1043,9 @@ sub do_paste_from_buffer { $msg = &mt('Paste failed: An error occurred when copying the bulletin board.').' '.$errtext; } return ($result,undef,[$msg],$lockerr{$prefix}); - } + } if ($lockerr{$prefix}) { - $lockerrors = $lockerr{$prefix}; + $lockerrors = $lockerr{$prefix}; } } } @@ -1074,7 +1074,7 @@ sub do_paste_from_buffer { if ($newdocsdir eq '') { $newdocsdir = 'default'; } - if (($prefixchg) || + if (($prefixchg) || ($srcdom ne $coursedom) || ($srcnum ne $coursenum) || ($env{'form.docs.markedcopy_options'} ne 'move')) { my $newpath = "$newprefix/$newdocsdir/$newidx/$rem"; @@ -1152,7 +1152,7 @@ sub do_paste_from_buffer { $save_err = $errtext; } } - + if ($env{'form.docs.markedcopy_options'} eq 'move') { &Apache::lonnet::delenv('docs.markedcopy'); &Apache::lonnet::delenv('docs.markedcopy_nested'); @@ -1228,7 +1228,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]; @@ -1263,12 +1263,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'}); } @@ -1285,11 +1285,11 @@ 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} .= + $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.'); @@ -1463,7 +1463,7 @@ sub url_paste_fixups { } } } elsif ($ressrc =~ m{^/adm/($match_domain)/($match_courseid)/.+$}) { - next if ($skip); + next if ($skip); my $srcdom = $1; my $srcnum = $2; if (($srcdom ne $cdom) || ($srcnum ne $cnum)) { @@ -1975,7 +1975,7 @@ sub editor { \%paste_errors); if (ref($pastemsgarray) eq 'ARRAY') { if (@{$pastemsgarray} > 0) { - + $r->print('

'. join('
',@{$pastemsgarray}). '

'); @@ -2021,7 +2021,7 @@ sub editor { my ($name,$url,$residx)= map { &unescape($_); } split(/\=/,$item); if ($url =~ m{^\Q/uploaded/$coursedom/$coursenum/\E(default|supplemental)_new\.(sequence|page)$}) { - my ($suffix,$errortxt,$locknotfreed) = + my ($suffix,$errortxt,$locknotfreed) = &new_timebased_suffix($coursedom,$coursenum,'map',$1,$2); if ($locknotfreed) { $r->print($locknotfreed); @@ -2804,7 +2804,7 @@ sub new_timebased_suffix { } } if ($freedlock ne 'ok') { - $locknotfreed = + $locknotfreed = '
'. &mt('There was a problem removing a lockfile.').' '; if ($type eq 'map') { @@ -3359,6 +3359,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('Content Editor').'      
  • '."\n";