[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonsyllabus.pm

raeburn raeburn at source.lon-capa.org
Tue Mar 14 17:27:51 EDT 2017


raeburn		Tue Mar 14 21:27:51 2017 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonsyllabus.pm 
  Log:
  - For 2.11
    - Backport 1.141
  
  
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.138.2.1 loncom/interface/lonsyllabus.pm:1.138.2.2
--- loncom/interface/lonsyllabus.pm:1.138.2.1	Fri Aug  5 20:56:42 2016
+++ loncom/interface/lonsyllabus.pm	Tue Mar 14 21:27:51 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.138.2.1 2016/08/05 20:56:42 raeburn Exp $
+# $Id: lonsyllabus.pm,v 1.138.2.2 2017/03/14 21:27:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -116,7 +116,7 @@
         }
         unless ($allowed && $forceedit) {
             my $file=&Apache::lonnet::filelocation("",$item);
-            if ($file =~ /\.(tex|x?html?)$/) {  
+            if ($file =~ /\.(tex|x?html?)$/) {
                 my $filetype = $1;
                 my $filecontents=&Apache::lonnet::getfile($file);
                 if ($filecontents eq -1) {
@@ -168,7 +168,16 @@
                               &mt('Print the syllabus directly from your web browser').
                               '\end{document}');
                 } else {
-                    $r->print(&Apache::lonwrapper::wrapper($item,undef,$env{'request.use_absolute'},
+                    my $brcrum;
+                    if ($env{'form.folderpath'} =~ /^supplemental/) {
+                        my $title = $env{'form.title'};
+                        if ($title eq '') {
+                            $title = &mt('Syllabus');
+                        }
+                        $brcrum =
+                            &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
+                    }
+                    $r->print(&Apache::lonwrapper::wrapper($item,$brcrum,$env{'request.use_absolute'},
                                                            undef,$is_pdf,&mt('Syllabus')));
                 }
             }
@@ -183,11 +192,19 @@
                          '\end{document}');
             } else {
                 my $is_ext = 1;
-                my $is_pdf;
+                my ($is_pdf,$brcrum);
                 if ($external =~ /\.pdf$/i) {
                     $is_pdf = 1;
                 }
-                $r->print(&Apache::lonwrapper::wrapper($external,undef,$env{'request.use_absolute'},
+                if ($env{'form.folderpath'} =~ /^supplemental/) {
+                    my $title = $env{'form.title'};
+                    if ($title eq '') {
+                        $title = &mt('Syllabus');
+                    }
+                    $brcrum =
+                        &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
+                }
+                $r->print(&Apache::lonwrapper::wrapper($external,$brcrum,$env{'request.use_absolute'},
                                                        $is_ext,$is_pdf,&mt('Syllabus')));
             }
             return OK;




More information about the LON-CAPA-cvs mailing list