--- loncom/publisher/lonupload.pm 2019/03/06 03:39:54 1.70 +++ loncom/publisher/lonupload.pm 2023/07/23 11:54:56 1.71 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.70 2019/03/06 03:39:54 raeburn Exp $ +# $Id: lonupload.pm,v 1.71 2023/07/23 11:54:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -624,22 +624,35 @@ ENDJS $trailfile =~ s{^/(priv/)}{$londocroot/$1}; # Breadcrumbs - my $brcrum = [{'href' => &Apache::loncommon::authorspace($fn), - 'text' => 'Authoring Space'}, + my $text = 'Authoring Space'; + my $href = &Apache::loncommon::authorspace($fn); + my $crsauthor; + 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; + } + } + my $brcrum = [{'href' => $href, + 'text' => $text}, {'href' => '/adm/upload', - 'text' => 'Upload file to Authoring Space'}]; - $r->print(&Apache::loncommon::start_page('Upload file to Authoring Space', + 'text' => 'Upload file to '.$text}]; + $r->print(&Apache::loncommon::start_page('Upload file to '.$text, $javascript, {'bread_crumbs' => $brcrum,}) .&Apache::loncommon::head_subbox( &Apache::loncommon::CSTR_pageheader($trailfile)) ); - - if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { - $r->print('

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

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

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

' + ); + } } if ($warning) { $r->print($warning);