--- loncom/interface/lonsyllabus.pm	2020/04/07 18:42:25	1.138.2.3.4.1
+++ loncom/interface/lonsyllabus.pm	2016/01/26 14:30:25	1.139
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.138.2.3.4.1 2020/04/07 18:42:25 raeburn Exp $
+# $Id: lonsyllabus.pm,v 1.139 2016/01/26 14:30:25 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -116,7 +116,7 @@ sub handler {
         }
         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) {
@@ -125,13 +125,8 @@ sub handler {
                     if ($target eq 'tex') {
                         $r->print($filecontents);
                     } else {
-                        my $texengine = $env{'form.texengine'};
-                        if ($texengine eq '') {
-                            $texengine = 'tth';
-                        } elsif (lc($texengine) eq 'jsmath') {
-                            $texengine = 'MathJax';
-                        }
-                        my $result = &Apache::lontexconvert::converted(\$filecontents,$texengine);
+                        my $result = &Apache::lontexconvert::converted(\$filecontents,
+                                                                       $env{'form.texengine'});
                         my %args;
                         &get_breadcrumbs($cdom,$cnum,$crstype,\%args);
                         if ($env{'form.only_body'}) {
@@ -168,17 +163,8 @@ sub handler {
                               &mt('Print the syllabus directly from your web browser').
                               '\end{document}');
                 } else {
-                    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')));
+                    $r->print(&Apache::lonwrapper::wrapper($item,undef,$env{'request.use_absolute'},
+                                                           undef,$is_pdf,undef,&mt('Syllabus')));
                 }
             }
             return OK;
@@ -192,20 +178,12 @@ sub handler {
                          '\end{document}');
             } else {
                 my $is_ext = 1;
-                my ($is_pdf,$brcrum);
+                my $is_pdf;
                 if ($external =~ /\.pdf$/i) {
                     $is_pdf = 1;
                 }
-                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')));
+                $r->print(&Apache::lonwrapper::wrapper($external,undef,$env{'request.use_absolute'},
+                                                       $is_ext,$is_pdf,undef,&mt('Syllabus')));
             }
             return OK;
         }
@@ -627,16 +605,11 @@ function toggleEditor(pick) {
 
 var regexp = $urlregexp;
 
-function extUrlPreview(caller,protocol) {
+function extUrlPreview(caller) {
     if (document.getElementById(caller)) {
         var url = document.getElementById(caller).value;
         if (regexp.test(url)) {
-            var http_regex = /^http\:\/\//gi;
-            if ((protocol == 'https') && (http_regex.test(url))) {
-                window.open(url,"syllabuspreview","height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1");
-            } else {
-                openMyModal(url,500,400,'yes');
-            }
+            openMyModal(url,500,400,'yes');
         } else {
             alert("$invurl");
         }
@@ -824,7 +797,6 @@ sub chooser {
         $checked{'templatebox'} = $check;
         $display{'templatebox'} = 'block';
     }
-    my $protocol = ($ENV{'SERVER_PORT'} == 443?'https':'http');
 
     my $output = 
         '<form name="syllabus" method="post" enctype="multipart/form-data" action="">'."\n".
@@ -837,7 +809,7 @@ sub chooser {
     $output .= '</fieldset></div>'."\n".
                '<div id="url" class="LC_left_float" style="display: '.$display{'url'}.'">'."\n".
                '<fieldset><legend>'.$lt{'chourl'}.'</legend><span class="LC_nobreak">'."\n".
-               '<a href="javascript:extUrlPreview('."'syllabusurl','$protocol'".');">'.$lt{'pr'}.'</a></span>&nbsp;'."\n".
+               '<a href="javascript:extUrlPreview('."'syllabusurl'".');">'.$lt{'pr'}.'</a></span>&nbsp;'."\n".
                '<input type="text" id="syllabusurl" name="externalsyllabus" value="'.$external.'" size="55" />'."\n".
                '&nbsp;<input type="submit" name="storeurl" value="'.$lt{'save'}.'" />'."\n".
                '</fieldset></div>'."\n".