--- loncom/interface/londocs.pm 2006/11/13 01:57:57 1.249 +++ loncom/interface/londocs.pm 2006/11/20 17:45:11 1.254 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.249 2006/11/13 01:57:57 www Exp $ +# $Id: londocs.pm,v 1.254 2006/11/20 17:45:11 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -954,6 +954,7 @@ sub breadcrumbs { } my $folderpath; my $cpinfo=''; + my $plain=''; if ($env{'form.markedcopy_url'}) { $cpinfo='&markedcopy_url='. &escape($env{'form.markedcopy_url'}). @@ -986,9 +987,11 @@ sub breadcrumbs { 'text'=>''. $name.'' }); + $plain.=$name.' > '; } + $plain=~s/\>\;\s*$//; return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp', - 'LC_docs_path'),$randompick,$ishidden,$isencrypted); + 'LC_docs_path'),$randompick,$ishidden,$isencrypted,$plain); } sub log_docs { @@ -1021,10 +1024,9 @@ sub log_docs { } sub log_differences { - my ($coursenum,$coursedom,$folder)=@_; - my %storehash=('folder' => '/uploaded/'.$coursedom.'/'.$coursenum.'/userfiles/'.$folder); + my ($plain)=@_; + my %storehash=('folder' => $plain); if ($parmidx) { - $storehash{'parameter_idx'}=$parmidx; $storehash{'parameter_res'}=$oldresources[$parmidx]; foreach my $parm (keys %parmaction) { $storehash{'parameter_action_'.$parm}=$parmaction{$parm}; @@ -1042,13 +1044,12 @@ sub log_docs { $changedflag=1; } if ($LONCAPA::map::order[$idx] ne $oldorder[$idx]) { - $storehash{'before_order_'.$idx}=$oldorder[$idx]; - $storehash{'after_order_'.$idx}=$LONCAPA::map::order[$idx]; - $storehash{'before_order_res_'.$idx}=$oldresources[$idx]; - $storehash{'after_order_res_'.$idx}=$LONCAPA::map::resources[$idx]; + $storehash{'before_order_res_'.$idx}=$oldresources[$oldorder[$idx]]; + $storehash{'after_order_res_'.$idx}=$LONCAPA::map::resources[$LONCAPA::map::order[$idx]]; $changedflag=1; } } + $storehash{'maxidx'}=$maxidx; if ($changedflag) { &log_docs(\%storehash); } } } @@ -1061,32 +1062,37 @@ sub docs_change_log { my ($r)=@_; $r->print(&Apache::loncommon::start_page('Course Document Change Log')); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Document Change Log')); - + my %docslog=&Apache::lonnet::dump('nohist_docslog', $env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}); - + if ((keys(%docslog))[0]=~/^error\:/) { undef(%docslog); } - + $r->print('
'); $r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row(). - ''.$errtext.'
'); @@ -1183,6 +1233,12 @@ sub editor { &LONCAPA::map::delparameter($idx,'parameter_encrypturl'); &remember_parms($idx,'encrypturl','del'); } +# store the changed version + ($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container); + if ($fatal) { + $r->print(''.$errtext.'
'); + return; + } } if ($env{'form.newpos'}) { @@ -1362,8 +1418,7 @@ sub editor { $r->print(''.&mt('No map selected.').'
'); } } - &log_differences($coursenum,$coursedom, - $folder.'.'.$container); + &log_differences($plain); } # ---------------------------------------------------------------- End commands # ---------------------------------------------------------------- Print screen