Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.90 and 1.94

version 1.90, 2004/09/29 14:50:43 version 1.94, 2004/10/21 11:18:06
Line 131  sub select_recent { Line 131  sub select_recent {
  ">\n<option value=''>--- ".&mt('Recent')." ---</option>";   ">\n<option value=''>--- ".&mt('Recent')." ---</option>";
     foreach (sort keys %recent) {      foreach (sort keys %recent) {
  unless ($_=~/^error\:/) {   unless ($_=~/^error\:/) {
     $return.="\n<option value='$_'>".      my $escaped = &Apache::loncommon::escape_url($_);
       $return.="\n<option value='$escaped'>".
  &Apache::lonnet::unescape((split(/\&/,$recent{$_}))[1]).   &Apache::lonnet::unescape((split(/\&/,$recent{$_}))[1]).
  '</option>';   '</option>';
  }   }
Line 804  sub Increment_PrgWin { Line 805  sub Increment_PrgWin {
     my $sec = $time_est % 60;      my $sec = $time_est % 60;
     #       # 
     my $str;      my $str;
     if ($min == 1 && $sec > 1) {      if ($min == 0 && $sec > 1) {
         $str = '[_2] seconds';          $str = '[_2] seconds';
       } elsif ($min == 1 && $sec > 1) {
           $str = '1 minute [_2] seconds';
     } elsif ($min == 1 && $sec < 2) {      } elsif ($min == 1 && $sec < 2) {
         $str = '1 minute';          $str = '1 minute';
     } elsif ($min < 10 && $sec > 1) {      } elsif ($min < 10 && $sec > 1) {
Line 885  sub crumbs { Line 888  sub crumbs {
     unless ($path eq $uri) { $path.='/'; }      unless ($path eq $uri) { $path.='/'; }
     my $linkpath=$path;      my $linkpath=$path;
     if ($form) {      if ($form) {
  $linkpath="javascript:$form.action='$path';$form.submit();";   my $escaped_path = &Apache::loncommon::escape_single($path);
    $linkpath="javascript:$form.action='$escaped_path';$form.submit();";
     }      }
     $output.='<a href="'.$linkpath.'"'.($target?' target="'.$target.'"':'').'>'.$_.'</a>/';      my $escaped_linkpath = &Apache::loncommon::escape_single($linkpath);
       my $escaped_target   = &Apache::loncommon::escape_single($target);
       $output.='<a href="'.$escaped_linkpath.'"'.($target?' target="'.$escaped_target.'"':'').'>'.$_.'</a>/';
  }   }
     } else {      } else {
  $output.=$uri;   $output.=$uri;
Line 902  sub spellheader { Line 908  sub spellheader {
     my $nothing = &javascript_nothing();      my $nothing = &javascript_nothing();
     return (<<ENDCHECK);      return (<<ENDCHECK);
 <script type="text/javascript">   <script type="text/javascript"> 
 // BEGIN LON-CAPA Internal  //<!-- BEGIN LON-CAPA Internal
 var checkwin;  var checkwin;
   
 function spellcheckerwindow() {  function spellcheckerwindow() {
Line 910  function spellcheckerwindow() { Line 916  function spellcheckerwindow() {
     checkwin.document.writeln('<html><body bgcolor="#DDDDDD"><form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="" /></form></body></html>');      checkwin.document.writeln('<html><body bgcolor="#DDDDDD"><form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="" /></form></body></html>');
     checkwin.document.close();      checkwin.document.close();
 }  }
 // END LON-CAPA Internal  // END LON-CAPA Internal -->
 </script>  </script>
 ENDCHECK  ENDCHECK
 }  }
Line 974  sub disablelink { Line 980  sub disablelink {
     if (defined($#fields)) {      if (defined($#fields)) {
  unless ($#fields>=0) { return ''; }   unless ($#fields>=0) { return ''; }
     }      }
     return '<a href="/adm/preferences?action=set_wysiwyg&wysiwyg=off&returnurl='.&Apache::lonnet::escape($ENV{'REQUEST_URI'}).'">'.&mt('Disable WYSIWYG Editor').'</a>';      return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=off&returnurl=','<>&"').&Apache::lonnet::escape($ENV{'REQUEST_URI'}).'">'.&mt('Disable WYSIWYG Editor').'</a>';
 }  }
   
 sub enablelink {  sub enablelink {
Line 982  sub enablelink { Line 988  sub enablelink {
     if (defined($#fields)) {      if (defined($#fields)) {
  unless ($#fields>=0) { return ''; }   unless ($#fields>=0) { return ''; }
     }      }
     return '<a href="/adm/preferences?action=set_wysiwyg&wysiwyg=on&returnurl='.&Apache::lonnet::escape($ENV{'REQUEST_URI'}).'">'.&mt('Enable WYSIWYG Editor').'</a>';      return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=on&returnurl=','<>&"').&Apache::lonnet::escape($ENV{'REQUEST_URI'}).'">'.&mt('Enable WYSIWYG Editor').'</a>';
 }  }
   
 # ----------------------------------------- Script to activate only some fields  # ----------------------------------------- Script to activate only some fields

Removed from v.1.90  
changed lines
  Added in v.1.94


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