[LON-CAPA-cvs] cvs: loncom /publisher testbankimport.pm
raeburn
raeburn at source.lon-capa.org
Sat Jul 22 21:09:04 EDT 2023
raeburn Sun Jul 23 01:09:04 2023 EDT
Modified files:
/loncom/publisher testbankimport.pm
Log:
- Breadcrumbs text when displaying/editing resource in Course Authoring Space.
Index: loncom/publisher/testbankimport.pm
diff -u loncom/publisher/testbankimport.pm:1.45 loncom/publisher/testbankimport.pm:1.46
--- loncom/publisher/testbankimport.pm:1.45 Sun Nov 12 23:08:58 2017
+++ loncom/publisher/testbankimport.pm Sun Jul 23 01:09:04 2023
@@ -1,5 +1,5 @@
# Handler for parsing text upload problem descriptions into .problems
-# $Id: testbankimport.pm,v 1.45 2017/11/12 23:08:58 raeburn Exp $
+# $Id: testbankimport.pm,v 1.46 2023/07/23 01:09:04 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1787,10 +1787,10 @@
}
sub print_header {
- my ($uname,$udom,$javascript,$loadentries,$title,$current_page,$pagesref,
- $namesref) = @_;
- my $brcrum = [{'href' => &Apache::loncommon::authorspace("/priv/$udom/$uname/"),
- 'text' => 'Authoring Space'}];
+ my ($uname,$udom,$javascript,$loadentries,$title,$crumbtext,$crumbhref,
+ $crsauthor,$current_page,$pagesref,$namesref) = @_;
+ my $brcrum = [{'href' => $crumbhref),
+ 'text' => $crumbtext}];
if ($env{'form.phase'} eq 'three') {
if (ref($pagesref) eq 'ARRAY') {
for (my $i=0; $i<$current_page; $i++) {
@@ -1816,10 +1816,12 @@
my $output = &Apache::loncommon::start_page($title,$javascript,
{'bread_crumbs' => $brcrum,
'add_entries' => $loadentries});
- if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
- $output .= '<p class="LC_info">'
- .&mt('Co-Author [_1]',$uname.':'.$udom)
- .'</p>';
+ unless ($crsauthor) {
+ if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
+ $output .= '<p class="LC_info">'
+ .&mt('Co-Author [_1]',$uname.':'.$udom)
+ .'</p>';
+ }
}
return $output;
}
@@ -1852,7 +1854,19 @@
my $page_name = '';
my $current_page = '';
my $qcount = '';
+ my $crsauthor;
my $title = 'Upload testbank questions to Authoring Space';
+ my $crumbtext = 'Authoring Space';
+ my $crumbhref = &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 ($crumbhref eq "/priv/$cdom/$cnum/") {
+ $title = 'Upload testbank questions to Course Authoring Space';
+ $crumbtext = 'Course Authoring Space';
+ $crsauthor = 1;
+ }
+ }
# ----------------------------------------------------------- Start page output
&Apache::loncommon::content_type($r,'text/html');
@@ -1914,7 +1928,8 @@
}
$r->print(&print_header($uname,$udom,$javascript,\%loadentries,$title,
- $current_page,\@pages,\%names));
+ $crumbtext,$crumbhref,$crsauthor,$current_page,
+ \@pages,\%names));
if (($env{'form.phase'} eq 'four') || ($env{'form.phase'} eq 'three')) {
if ($env{'form.phase'} eq 'four') {
More information about the LON-CAPA-cvs
mailing list