Diff for /loncom/interface/lonsyllabus.pm between versions 1.138.2.5 and 1.142

version 1.138.2.5, 2019/07/30 21:59:39 version 1.142, 2017/02/18 23:39:16
Line 177  sub handler { Line 177  sub handler {
                         $brcrum =                          $brcrum =
                             &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);                              &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
                     }                      }
                     $r->print(&Apache::lonwrapper::wrapper($r,$item,$brcrum,$env{'request.use_absolute'},                      $r->print(&Apache::lonwrapper::wrapper($item,$brcrum,$env{'request.use_absolute'},
                                                            undef,$is_pdf,&mt('Syllabus')));                                                             undef,$is_pdf,undef,&mt('Syllabus')));
                 }                  }
             }              }
             return OK;              return OK;
Line 204  sub handler { Line 204  sub handler {
                     $brcrum =                      $brcrum =
                         &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);                          &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
                 }                  }
                 $r->print(&Apache::lonwrapper::wrapper($r,$external,$brcrum,$env{'request.use_absolute'},                  $r->print(&Apache::lonwrapper::wrapper($external,$brcrum,$env{'request.use_absolute'},
                                                        $is_ext,$is_pdf,&mt('Syllabus')));                                                         $is_ext,$is_pdf,undef,&mt('Syllabus')));
             }              }
             return OK;              return OK;
         }          }
Line 306  sub handler { Line 306  sub handler {
     if ($allowed) {      if ($allowed) {
 #---------------------------------- Print External URL Syllabus Info if editing  #---------------------------------- Print External URL Syllabus Info if editing
         if ($target ne 'tex') {          if ($target ne 'tex') {
             my $hostname = &Apache::lonnet::hostname($homeserver);  
             my $protocol = $Apache::lonnet::protocol{$homeserver};              my $protocol = $Apache::lonnet::protocol{$homeserver};
             $protocol = 'http' if ($protocol ne 'https');              $protocol = 'http' if ($protocol ne 'https');
             my $link = $r->uri;              my $link = $protocol.'://'.&Apache::lonnet::hostname($homeserver).$r->uri;
             if (($protocol eq 'https') && ($external =~ m{^http://})) {              if (($protocol eq 'https') && ($external =~ m{^http://})) {
                 unless (&Apache::lonnet::uses_sts()) {                  $link .= '?usehttp=1';
                     $link .= '?usehttp=1';  
                     $protocol = 'http';  
                 }  
             }              }
             $link = $protocol.'://'.$hostname.$link;  
             $r->print('<div class="LC_left_float">'              $r->print('<div class="LC_left_float">'
                      .'<span class="LC_help_open_topic LC_info">'                       .'<span class="LC_help_open_topic LC_info">'
                      .'<span class="LC_info">'                       .'<span class="LC_info">'
Line 752  ENDSCRIPT Line 747  ENDSCRIPT
     if ($env{'form.only_body'}) {      if ($env{'form.only_body'}) {
         $args->{'only_body'} = 1;          $args->{'only_body'} = 1;
     }      }
     $args->{'hostname'} = $r->hostname();  
     my $start_page =      my $start_page =
         &Apache::loncommon::start_page("Syllabus", $rss_link.$js,$args);          &Apache::loncommon::start_page("Syllabus", $rss_link.$js,$args);
     if ($start_page) {      if ($start_page) {
Line 902  sub chooser { Line 896  sub chooser {
   
 sub syllabus_file_info {  sub syllabus_file_info {
     my ($item,$cnum,$cdom,$lonhost,$context) = @_;      my ($item,$cnum,$cdom,$lonhost,$context) = @_;
     my $hostname = &Apache::lonnet::hostname($lonhost);  
     my $protocol = $Apache::lonnet::protocol{$lonhost};      my $protocol = $Apache::lonnet::protocol{$lonhost};
     $protocol = 'http' if ($protocol ne 'https');      $protocol = 'http' if ($protocol ne 'https');
     my $absurl = $protocol.'://'.$hostname.$item;      my $absurl = $protocol.'://'.&Apache::lonnet::hostname($lonhost).$item;
     my ($filename) = ($item =~ m{([^/]+)$});      my ($filename) = ($item =~ m{([^/]+)$});
     my $file=&Apache::lonnet::filelocation("",$item);      my $file=&Apache::lonnet::filelocation("",$item);
     my ($depbutton,$filetype,$editable);      my ($depbutton,$filetype,$editable);
Line 1315  sub save_changes { Line 1308  sub save_changes {
                               &mt('An error occurred storing the external URL: [_1]',$putres).                                &mt('An error occurred storing the external URL: [_1]',$putres).
                               '</div>';                                '</div>';
                 }                  }
                 $is_ext = $external;  
             }              }
               $is_ext = $external;
         } else {          } else {
             $output = '<div class="LC_error">'.              $output = '<div class="LC_error">'.
                       &mt('External URL not saved -- invalid URL.').                        &mt('External URL not saved -- invalid URL.').
Line 1578  sub home_http_host { Line 1571  sub home_http_host {
     my ($cdom,$cnum) = @_;      my ($cdom,$cnum) = @_;
     my $home=&Apache::lonnet::homeserver($cnum,$cdom);      my $home=&Apache::lonnet::homeserver($cnum,$cdom);
     if ($home ne 'no_host') {      if ($home ne 'no_host') {
         my $hostname = &Apache::lonnet::hostname($home);  
         my $protocol = $Apache::lonnet::protocol{$home};          my $protocol = $Apache::lonnet::protocol{$home};
         $protocol = 'http' if ($protocol ne 'https');          $protocol = 'http' if ($protocol ne 'https');
         return $protocol.'://'.$hostname;          return $protocol.'://'.&Apache::lonnet::hostname($home);
     }      }
     return;      return;
 }  }

Removed from v.1.138.2.5  
changed lines
  Added in v.1.142


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>