[LON-CAPA-cvs] cvs: loncom /interface lonmsgdisplay.pm
raeburn
raeburn at source.lon-capa.org
Tue Nov 10 20:27:04 EST 2020
raeburn Wed Nov 11 01:27:04 2020 EDT
Modified files:
/loncom/interface lonmsgdisplay.pm
Log:
- If display of a message in course context by a privileged user includes
"student's view of problem" in Resource Details section, load CSS file(s)
for the resource.
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.192 loncom/interface/lonmsgdisplay.pm:1.193
--- loncom/interface/lonmsgdisplay.pm:1.192 Tue Sep 8 23:54:40 2020
+++ loncom/interface/lonmsgdisplay.pm Wed Nov 11 01:27:04 2020
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.192 2020/09/08 23:54:40 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.193 2020/11/11 01:27:04 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2147,8 +2147,28 @@
my $number_of_messages = scalar(@messages); #subtract 1 for last index
+ my $head_extra;
+
+# if student's view of resource will be included
+# get <link> tag(s) for css file(s) in use, and pass to &header to include
+# in call to loncommon::start_page()
+
+ if (($env{'request.course.id'} eq $content{'courseid'}) &&
+ (&Apache::lonnet::allowed('vgr',$content{'courseid'}))) {
+ my $symb;
+ if (defined($content{'symb'})) {
+ $symb = $content{'symb'};
+ } elsif (defined($content{'baseurl'})) {
+ $symb=&Apache::lonnet::symbread($content{'baseurl'});
+ }
+ if ($symb) {
+ $head_extra = &Apache::loncommon::css_links($symb);
+ }
+ }
+
# start output
- &printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'});
+ &printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',
+ $content{'baseurl'},$head_extra);
# Prepare available functions
my @functionlist;
@@ -2689,13 +2709,16 @@
# ================================================================== The Header
sub header {
- my ($r,$title,$baseurl)=@_;
+ my ($r,$title,$baseurl,$head_extra)=@_;
my $extra = &Apache::loncommon::studentbrowser_javascript();
if ($baseurl) {
$extra .= "<base href=\"".&Apache::lonnet::absolute_url()."/$baseurl\" />";
}
$extra .= '<script type="text/javascript"
src="/res/adm/includes/file_upload.js"></script>';
+ if ($head_extra) {
+ $extra .= "\n$head_extra";
+ }
$r->print(&Apache::loncommon::start_page('Messages',
$extra));
$r->print(&Apache::lonhtmlcommon::breadcrumbs
@@ -2705,11 +2728,11 @@
# ---------------------------------------------------------------- Print header
sub printheader {
- my ($r,$url,$desc,$title,$baseurl)=@_;
+ my ($r,$url,$desc,$title,$baseurl,$head_extra)=@_;
&Apache::lonhtmlcommon::add_breadcrumb
({href=>$url,
text=>$desc});
- &header($r,$title,$baseurl);
+ &header($r,$title,$baseurl,$head_extra);
}
# ------------------------------------------------------------ Store the comment
More information about the LON-CAPA-cvs
mailing list