--- loncom/publisher/lonretrieve.pm 2012/10/29 17:38:55 1.49 +++ loncom/publisher/lonretrieve.pm 2023/07/23 12:24:16 1.53 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to retrieve an old version of a file # -# $Id: lonretrieve.pm,v 1.49 2012/10/29 17:38:55 raeburn Exp $ +# $Id: lonretrieve.pm,v 1.53 2023/07/23 12:24:16 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -161,7 +161,7 @@ sub phaseone { || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') { $r->print(''. &Apache::loncommon::modal_link( - '/adm/diff?filename=/priv/'.$udom,'/'.$uname.$fn. + '/adm/diff?filename=/priv/'.$udom.'/'.$uname.$fn. '&versiontwo=priv&versionone='.$version, &mt('Diffs with Version [_1]',$version),550,450). ''); @@ -194,7 +194,7 @@ sub phaseone { $r->print(&Apache::loncommon::end_data_table_row(). &Apache::loncommon::end_data_table(). '

'.''. - &mt('Retrieval of an old version will overwrite the file currently in construction space.').'

'); + &mt('Retrieval of an old version will overwrite the file currently in Authoring Space.').'

'); if (!$is_meta) { $r->print('

'.''. &mt('This will only retrieve the resource. If you want to retrieve the metadata, you will need to do that separately.'). @@ -302,6 +302,7 @@ sub handler { # ----------------------------------------------------------- Start page output my $uname; my $udom; + my $crsauthor; ($uname,$udom) = &Apache::lonnet::constructaccess($fn); unless (($uname ne '') && ($udom ne '')) { @@ -316,10 +317,20 @@ sub handler { $r->send_http_header; # Breadcrumbs + my $text = 'Authoring Space'; + my $href = &Apache::loncommon::authorspace($fn); + if ($env{'request.course.id'}) { + my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + if ($href eq "/priv/$cdom/$cnum/") { + $text = 'Course Authoring Space'; + $crsauthor = 1; + } + } &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb({ - 'text' => 'Construction Space', - 'href' => &Apache::loncommon::authorspace($fn), + 'text' => $text, + 'href' => $href, }); &Apache::lonhtmlcommon::add_breadcrumb({ 'text' => 'Retrieve previous version', @@ -342,13 +353,15 @@ sub handler { .&mt('Retrieve previous versions of [_1]' ,''.$fn.'') .'

'); - - if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { + + unless ($crsauthor) { + if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { $r->print('

' .&mt('Co-Author [_1]' ,&Apache::loncommon::plainname($uname,$udom) .' ('.$uname.':'.$udom.')') .'

'); + } }