[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonmsgdisplay.pm
raeburn
raeburn at source.lon-capa.org
Wed Nov 11 17:04:25 EST 2020
raeburn Wed Nov 11 22:04:25 2020 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface lonmsgdisplay.pm
Log:
- For 2.11
Backport 1.193
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.181.2.6 loncom/interface/lonmsgdisplay.pm:1.181.2.7
--- loncom/interface/lonmsgdisplay.pm:1.181.2.6 Wed Sep 9 00:48:17 2020
+++ loncom/interface/lonmsgdisplay.pm Wed Nov 11 22:04:25 2020
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.181.2.6 2020/09/09 00:48:17 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.181.2.7 2020/11/11 22:04:25 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;
@@ -2682,13 +2702,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
@@ -2698,11 +2721,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