--- loncom/interface/londocs.pm 2007/07/12 23:56:29 1.289 +++ loncom/interface/londocs.pm 2007/07/13 00:29:21 1.290 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.289 2007/07/12 23:56:29 albertel Exp $ +# $Id: londocs.pm,v 1.290 2007/07/13 00:29:21 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1259,9 +1259,23 @@ sub do_paste_from_buffer { &Apache::lonnet::getfile($url)); $url = $newurl; } +# published maps can only exists once, so remove it from paste buffer when done if (($url=~/\.(page|sequence)$/) && ($url=~m {^/res/})) { &Apache::lonnet::delenv('docs\\.markedcopy'); } + if ($url=~ m{/smppg$}) { + my $db_name = &Apache::lonsimplepage::get_db_name($url); + if ($db_name =~ /^smppage_/) { + #simple pages, need to copy the db contents to a new one. + my %contents=&Apache::lonnet::dump($db_name,$coursedom,$coursenum); + my $now = time(); + $db_name =~ s{_\d*$ }{_$now}x; + my $result=&Apache::lonnet::put($db_name,\%contents, + $coursedom,$coursenum); + $url =~ s{/(\d*)/smppg$ }{/$now/smppg}x; + $title=&mt('Copy of').' '.$title; + } + } $title = &LONCAPA::map::qtunescape($title); my $ext='false'; if ($url=~m{^http(|s)://}) { $ext='true'; }