Diff for /loncom/interface/lonfeedback.pm between versions 1.145 and 1.155

version 1.145, 2004/12/09 21:58:29 version 1.155, 2005/03/01 03:21:04
Line 68  sub discussion_visible { Line 68  sub discussion_visible {
 }  }
   
 sub list_discussion {  sub list_discussion {
     my ($mode,$status,$ressymb)=@_;      my ($mode,$status,$ressymb,$imsextras)=@_;
     my $outputtarget=$ENV{'form.grade_target'};      my $outputtarget=$ENV{'form.grade_target'};
     if (defined($ENV{'form.export'})) {      if (defined($ENV{'form.export'})) {
  if($ENV{'form.export'}) {   if($ENV{'form.export'}) {
             $outputtarget = 'export';              $outputtarget = 'export';
         }          }
     }      }
       if (defined($imsextras)) {
           if ($$imsextras{'caller'} eq 'imsexport') {
               $outputtarget = 'export';
           }
       }
     if (not &discussion_visible($status)) { return ''; }      if (not &discussion_visible($status)) { return ''; }
     my @bgcols = ("#cccccc","#eeeeee");      my @bgcols = ("#cccccc","#eeeeee");
     my $discussiononly=0;      my $discussiononly=0;
Line 325  sub list_discussion { Line 330  sub list_discussion {
         } elsif ($outputtarget eq 'export') {          } elsif ($outputtarget eq 'export') {
 # Create temporary directory if this is an export  # Create temporary directory if this is an export
             my $now = time;              my $now = time;
             $tempexport = $Apache::lonnet::perlvar{'lonDaemons'}.'/tmp/ims_exports';              if ((defined($imsextras)) && ($$imsextras{'caller'} eq 'imsexport')) {
             if (!-e $tempexport) {                  $tempexport = $$imsextras{'tempexport'};
                 mkdir($tempexport,0700);                  if (!-e $tempexport) {
             }                      mkdir($tempexport,0700);
             $tempexport .= '/'.$now;                  }
             if (!-e $tempexport) {                  $tempexport .= '/'.$$imsextras{'count'};
                 mkdir($tempexport,0700);                  if (!-e $tempexport) {
                       mkdir($tempexport,0700);
                   }
               } else {
                   $tempexport = $Apache::lonnet::perlvar{'lonDaemons'}.'/tmp/ims_exports';
                   if (!-e $tempexport) {
                       mkdir($tempexport,0700);
                   }
                   $tempexport .= '/'.$now;
                   if (!-e $tempexport) {
                       mkdir($tempexport,0700);
                   }
                   $tempexport .= '/'.$ENV{'user.domain'}.'_'.$ENV{'user.name'};
             }              }
             $tempexport .= '/'.$ENV{'user.domain'}.'_'.$ENV{'user.name'};  
             if (!-e $tempexport) {              if (!-e $tempexport) {
                 mkdir($tempexport,0700);                  mkdir($tempexport,0700);
             }              }
Line 496  imscp_v1p1.xsd http://www.imsglobal.org/ Line 512  imscp_v1p1.xsd http://www.imsglobal.org/
         $imsitems{$alldiscussion{$_}}{'isvisible'}.'" identifieref="RES-'.$ressymb.'-'.$alldiscussion{$_}.'">'.          $imsitems{$alldiscussion{$_}}{'isvisible'}.'" identifieref="RES-'.$ressymb.'-'.$alldiscussion{$_}.'">'.
         '<title>'.$imsitems{$alldiscussion{$_}}{'title'}.'</title>';          '<title>'.$imsitems{$alldiscussion{$_}}{'title'}.'</title>';
                         $imsresources .= "\n".                          $imsresources .= "\n".
     '<resource identifier="RES-'.$ressymb.'-'.$alldiscussion{$_}.'" type="webcontent" href="'.$postfilename.'">'.      '<resource identifier="RES-'.$ressymb.'-'.$alldiscussion{$_}.'" type="webcontent" href="'.$postfilename.'">'."\n".
       '<file href="'.$alldiscussion{$_}.'.html">'."\n".        '<file href="'.$postfilename.'">'."\n".
       $imsfiles{$alldiscussion{$_}}{$imsitems{$alldiscussion{$_}}{'currversion'}}."\n".        $imsfiles{$alldiscussion{$_}}{$imsitems{$alldiscussion{$_}}{'currversion'}}."\n".
     '</resource>';      '</resource>';
                     }                      }
Line 634  END Line 650  END
 </manifest>  </manifest>
                 |;                  |;
                 close($manifestfile);                  close($manifestfile);
                   if ((defined($imsextras)) && ($$imsextras{'caller'} eq 'imsexport')) {
                       $discussion = $copyresult;
                   } else {
   
 #Create zip file in prtspool  #Create zip file in prtspool
   
                 my $imszipfile = '/prtspool/'.                      my $imszipfile = '/prtspool/'.
                 $ENV{'user.name'}.'_'.$ENV{'user.domain'}.'_'.                      $ENV{'user.name'}.'_'.$ENV{'user.domain'}.'_'.
                      time.'_'.rand(1000000000).'.zip';                           time.'_'.rand(1000000000).'.zip';
     # zip can cause an sh launch which can pass along all of %ENV      # zip can cause an sh launch which can pass along all of %ENV
     # which can be too large for /bin/sh to handle      # which can be too large for /bin/sh to handle
                 my %oldENV=%ENV;                      my %oldENV=%ENV;
                 undef(%ENV);                      undef(%ENV);
                 my $cwd = &getcwd();                       my $cwd = &getcwd(); 
                 my $imszip = '/home/httpd/'.$imszipfile;                      my $imszip = '/home/httpd/'.$imszipfile;
                 chdir $tempexport;                      chdir $tempexport;
                 open(OUTPUT, "zip -r $imszip *  2> /dev/null |");                      open(OUTPUT, "zip -r $imszip *  2> /dev/null |");
                 close(OUTPUT);                      close(OUTPUT);
                 chdir $cwd;                      chdir $cwd;
                 %ENV=%oldENV;                      %ENV=%oldENV;
                 undef(%oldENV);                      undef(%oldENV);
                 $discussion .= 'Download the zip file from <a href="'.$imszipfile.'">Discussion Posting Archive</a><br />';                      $discussion .= 'Download the zip file from <a href="'.$imszipfile.'">Discussion Posting Archive</a><br />';
                 if ($copyresult) {                      if ($copyresult) {
                     $discussion .= 'The following errors occurred during export - <br />'.$copyresult;                          $discussion .= 'The following errors occurred during export - <br />'.$copyresult;
                       }
                 }                  }
             } else {              } else {
                 $discussion .= '<br />Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.<br />';                  $discussion .= '<br />Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.<br />';
Line 729  ENDDISCUSS Line 749  ENDDISCUSS
     if ($outputtarget ne 'tex') {      if ($outputtarget ne 'tex') {
  $discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='.   $discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='.
     $ressymb.':::" '.$target.'>'.      $ressymb.':::" '.$target.'>'.
     '<img src="/adm/lonMisc/chat.gif" border="0" />'.      '<img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" border="0" />'.
     &mt('Post Discussion').'</a></td></tr></table>';      &mt('Post Discussion').'</a></td></tr></table>';
     }      }
  }   }
Line 954  sub build_posting_display { Line 974  sub build_posting_display {
                             $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb);                              $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb);
         }          }
                         if ($$dischash{$readkey}=~/\.$idx\./) {                           if ($$dischash{$readkey}=~/\.$idx\./) { 
                             $ctlink = '<b>'.&mt('Mark unread').'?</b>&nbsp;<input type="checkbox" name="postunread_'.$idx.'" />';                              $ctlink = '<label><b>'.&mt('Mark unread').'?</b>&nbsp;<input type="checkbox" name="postunread_'.$idx.'" /></label>';
                         } else {                          } else {
                             $ctlink = '<b>'.&mt('Mark read').'?</b>&nbsp;<input type="checkbox" name="postread_'.$idx.'" />';                              $ctlink = '<label><b>'.&mt('Mark read').'?</b>&nbsp;<input type="checkbox" name="postread_'.$idx.'" /></label>';
                         }                          }
                     }                      }
 #figure out at what position this needs to print  #figure out at what position this needs to print
Line 1416  END Line 1436  END
   my $latexHelp=&Apache::loncommon::helpLatexCheatsheet();    my $latexHelp=&Apache::loncommon::helpLatexCheatsheet();
   my $htmlheader=&Apache::lonhtmlcommon::htmlareaheaders();    my $htmlheader=&Apache::lonhtmlcommon::htmlareaheaders();
   my $send=&mt('Send');    my $send=&mt('Send');
     my $html=&Apache::lonxml::xmlbegin();
   $r->print(<<END);    $r->print(<<END);
 <html>  $html
 <head>  <head>
 <title>The LearningOnline Network with CAPA</title>  <title>The LearningOnline Network with CAPA</title>
 <meta http-equiv="pragma" content="no-cache"></meta>  <meta http-equiv="pragma" content="no-cache"></meta>
Line 1641  sub print_display_options { Line 1662  sub print_display_options {
         $currtogg = $lt{'toggon'};          $currtogg = $lt{'toggon'};
         $disctogg = 'toggon';          $disctogg = 'toggon';
     }      }
       my $html=&Apache::lonxml::xmlbegin();
     $r->print(<<END);      $r->print(<<END);
 <html>  $html
 <head>  <head>
 <title>$lt{'dido'}</title>  <title>$lt{'dido'}</title>
 <meta http-equiv="pragma" content="no-cache" />  <meta http-equiv="pragma" content="no-cache" />
Line 1733  $lt{'sdpf'}<br/> $lt{'prca'}  <ol><li>$l Line 1755  $lt{'sdpf'}<br/> $lt{'prca'}  <ol><li>$l
        <tr bgcolor="#dddddd">         <tr bgcolor="#dddddd">
        <td>$lt{'disa'}</td>         <td>$lt{'disa'}</td>
        <td>$lt{$discdisp}</td>         <td>$lt{$discdisp}</td>
        <td><input type="checkbox" name="discdisp" onClick="discdispChk('0')" />&nbsp;$lt{'chgt'} "$dispchangeA"         <td><label><input type="checkbox" name="discdisp" onClick="discdispChk('0')" />&nbsp;$lt{'chgt'} "$dispchangeA"</label>
            <br />             <br />
            <input type="checkbox" name="discdisp" onClick="discdispChk('1')" />&nbsp;$lt{'chgt'} "$dispchangeB"             <label><input type="checkbox" name="discdisp" onClick="discdispChk('1')" />&nbsp;$lt{'chgt'} "$dispchangeB"</label>
        </td>         </td>
       </tr><tr bgcolor="#eeeeee">        </tr><tr bgcolor="#eeeeee">
        <td>$lt{'npmr'}</td>         <td>$lt{'npmr'}</td>
        <td>$lt{$discmark}</td>         <td>$lt{$discmark}</td>
        <td><input type="checkbox" name="discmark" />$lt{'chgt'} "$markchange"</td>         <td><label><input type="checkbox" name="discmark" />$lt{'chgt'} "$markchange"</label></td>
       </tr><tr bgcolor="#dddddd">        </tr><tr bgcolor="#dddddd">
        <td>$lt{'dotm'}</td>         <td>$lt{'dotm'}</td>
        <td>$lt{$disctogg}</td>         <td>$lt{$disctogg}</td>
        <td><input type="checkbox" name="disctogg" onClick="discdispChk('2')" />$lt{'chgt'} "$toggchange"</td>         <td><label><input type="checkbox" name="disctogg" onClick="discdispChk('2')" />$lt{'chgt'} "$toggchange"</label></td>
       </tr>        </tr>
      </table>       </table>
     </td>      </td>
Line 1823  sub print_sortfilter_options { Line 1845  sub print_sortfilter_options {
     my %role_types = ();      my %role_types = ();
     my %status_types = ();      my %status_types = ();
     &sort_filter_names(\%sort_types,\%role_types,\%status_types);      &sort_filter_names(\%sort_types,\%role_types,\%status_types);
       my $html=&Apache::lonxml::xmlbegin();
     $r->print(<<END);      $r->print(<<END);
 <html>  $html
 <head>  <head>
 <title>$lt{'diso'}</title>  <title>$lt{'diso'}</title>
 <meta http-equiv="pragma" content="no-cache" />  <meta http-equiv="pragma" content="no-cache" />
Line 1909  $bodytag Line 1931  $bodytag
    </select>     </select>
   </td>    </td>
   <td>&nbsp;</td>    <td>&nbsp;</td>
   <td><input type="checkbox" name="posterlist" value="$symb" />$lt{'shal'}</td>    <td><label><input type="checkbox" name="posterlist" value="$symb" />$lt{'shal'}</label></td>
  </tr>   </tr>
 </table>  </table>
 <br />  <br />
Line 1928  END Line 1950  END
 sub print_showposters {  sub print_showposters {
     my ($r,$symb,$previous,$feedurl,$sortposts) = @_;      my ($r,$symb,$previous,$feedurl,$sortposts) = @_;
   
       &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;
   
     &Apache::lonenc::check_encrypt(\$symb);      &Apache::lonenc::check_encrypt(\$symb);
     my $crs='/'.$ENV{'request.course.id'};      my $crs='/'.$ENV{'request.course.id'};
     if ($ENV{'request.course.sec'}) {      if ($ENV{'request.course.sec'}) {
Line 1976  sub print_showposters { Line 2001  sub print_showposters {
             }              }
         }          }
     }      }
       my $html=&Apache::lonxml::xmlbegin();
     $r->print(<<END);      $r->print(<<END);
 <html>  $html
 <head>  <head>
 <title>$lt{'diso'}</title>  <title>$lt{'diso'}</title>
 <meta http-equiv="pragma" content="no-cache" />  <meta http-equiv="pragma" content="no-cache" />
Line 2004  END Line 2030  END
                     next;                      next;
                 } else {                  } else {
                     $count ++;                      $count ++;
                     $r->print('<tr bgcolor="#ffffe6"><td align="right">'.$count.'</td><td align="center"><input name="stuinfo" type="checkbox" value="'.$_.'" /></td><td>'.$last.', '.$first.' ('.$uname.','.$udom.')</td><td>'.$postcounts{$_}.'</td></tr>');                      $r->print('<tr bgcolor="#ffffe6"><td align="right">'.$count.'</td><td align="center"><label><input name="stuinfo" type="checkbox" value="'.$_.'" /></td><td>'.$last.', '.$first.' ('.$uname.','.$udom.')</label></td><td>'.$postcounts{$_}.'</td></tr>');
                 }                  }
             }              }
         }          }
Line 2085  sub get_post_attachments { Line 2111  sub get_post_attachments {
     return;      return;
 }  }
   
 sub fail_redirect {;  sub fail_redirect {
   my ($r,$feedurl) = @_;    my ($r,$feedurl) = @_;
   if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' };    if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' };
     my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
     my $html=&Apache::lonxml::xmlbegin();
   $r->print (<<ENDFAILREDIR);    $r->print (<<ENDFAILREDIR);
 <html>  $html
 <head><title>Feedback not sent</title>  <head>
   <title>Feedback not sent</title>
 <meta http-equiv="pragma" content="no-cache" />  <meta http-equiv="pragma" content="no-cache" />
 <meta HTTP-EQUIV="Refresh" CONTENT="2; url=$feedurl" />  <meta HTTP-EQUIV="Refresh" CONTENT="2; url=$feedurl" />
 </head>  </head>
 <body bgcolor="#FFFFFF">  <body bgcolor="#FFFFFF">
 <img align="right" src="/adm/lonIcons/lonlogos.gif" />  <img align="right" src="$logo" />
 <b>Sorry, no recipients  ...</b>  <b>Sorry, no recipients  ...</b>
 <br /><a href="$feedurl">Continue</a>  <br /><a href="$feedurl">Continue</a>
 </body>  </body>
Line 2173  sub redirect_back { Line 2202  sub redirect_back {
       }        }
   }    }
   $feedurl=&Apache::lonenc::check_encrypt($feedurl);    $feedurl=&Apache::lonenc::check_encrypt($feedurl);
     my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
     my $html=&Apache::lonxml::xmlbegin();
   $r->print (<<ENDREDIR);    $r->print (<<ENDREDIR);
 <html>  $html
 <head>  <head>
 <title>Feedback sent</title>  <title>Feedback sent</title>
 <meta http-equiv="pragma" content="no-cache" />  <meta http-equiv="pragma" content="no-cache" />
 <meta HTTP-EQUIV="Refresh" CONTENT="2; url=$feedurl" />  <meta HTTP-EQUIV="Refresh" CONTENT="2; url=$feedurl" />
 </head>  </head>
 <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { this.document.reldt.submit(); self.close(); }'>  <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { this.document.reldt.submit(); self.close(); }'>
 <img align="right" src="/adm/lonIcons/lonlogos.gif" />  <img align="right" src="$logo" />
 $typestyle  $typestyle
 <b>Sent $sendsomething message(s), and $sendposts post(s).</b>  <b>Sent $sendsomething message(s), and $sendposts post(s).</b>
 <font color="red">$status</font>  <font color="red">$status</font>
Line 2203  sub no_redirect_back { Line 2234  sub no_redirect_back {
   my ($r,$feedurl) = @_;    my ($r,$feedurl) = @_;
   my $nofeed=&mt('Sorry, no feedback possible on this resource  ...');    my $nofeed=&mt('Sorry, no feedback possible on this resource  ...');
   my $continue=&mt('Continue');    my $continue=&mt('Continue');
     my $html=&Apache::lonxml::xmlbegin();
   $r->print (<<ENDNOREDIR);    $r->print (<<ENDNOREDIR);
 <html>  $html
 <head><title>Feedback not sent</title>  <head>
   <title>Feedback not sent</title>
 <meta http-equiv="pragma" content="no-cache" />  <meta http-equiv="pragma" content="no-cache" />
 ENDNOREDIR  ENDNOREDIR
   
Line 2214  ENDNOREDIR Line 2247  ENDNOREDIR
  &Apache::lonenc::check_encrypt($feedurl).'">');   &Apache::lonenc::check_encrypt($feedurl).'">');
   }    }
   $feedurl=&Apache::lonenc::check_encrypt($feedurl);    $feedurl=&Apache::lonenc::check_encrypt($feedurl);
     my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
   $r->print (<<ENDNOREDIRTWO);    $r->print (<<ENDNOREDIRTWO);
 </head>  </head>
 <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { self.close(); }'>  <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { self.close(); }'>
 <img align="right" src="/adm/lonIcons/lonlogos.gif" />  <img align="right" src="$logo" />
 <b>$nofeed</b>  <b>$nofeed</b>
 <br /><a href="$feedurl">$continue</a>  <br /><a href="$feedurl">$continue</a>
 </body>  </body>
Line 2232  sub screen_header { Line 2266  sub screen_header {
     unless (($ENV{'form.replydisc'}) || ($ENV{'form.editdisc'})) {      unless (($ENV{'form.replydisc'}) || ($ENV{'form.editdisc'})) {
  if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) {   if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) {
     $msgoptions=       $msgoptions= 
  '<p><input type="checkbox" name="author" /> '.   '<p><label><input type="checkbox" name="author" /> '.
  &mt('Feedback to resource author').'</p>';   &mt('Feedback to resource author').'</label></p>';
  }   }
  if (&feedback_available(1)) {   if (&feedback_available(1)) {
     $msgoptions.=      $msgoptions.=
  '<br /><input type="checkbox" name="question" /> '.   '<p><label><input type="checkbox" name="question" /> '.
  &mt('Question about resource content');   &mt('Question about resource content').'</label></p>';
  }   }
  if (&feedback_available(0,1)) {   if (&feedback_available(0,1)) {
     $msgoptions.=      $msgoptions.=
  '<br /><input type="checkbox" name="course" /> '.   '<p><label><input type="checkbox" name="course" /> '.
  &mt('Question/Comment/Feedback about course content');   &mt('Question/Comment/Feedback about course content').
    '</label></p>';
  }   }
  if (&feedback_available(0,0,1)) {   if (&feedback_available(0,0,1)) {
     $msgoptions.=      $msgoptions.=
  '<br /><input type="checkbox" name="policy" /> '.   '<p><label><input type="checkbox" name="policy" /> '.
  &mt('Question/Comment/Feedback about course policy');   &mt('Question/Comment/Feedback about course policy').
    '</label></p>';
  }   }
     }      }
     if ($ENV{'request.course.id'}) {      if ($ENV{'request.course.id'}) {
Line 2256  sub screen_header { Line 2292  sub screen_header {
     &Apache::lonnet::allowed('pch',      &Apache::lonnet::allowed('pch',
      $ENV{'request.course.id'}.       $ENV{'request.course.id'}.
      ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {       ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
     $discussoptions='<input type="checkbox" name="discuss" onClick="this.form.anondiscuss.checked=false;" '.      $discussoptions='<label><input type="checkbox" name="discuss" onClick="this.form.anondiscuss.checked=false;" '.
  ($ENV{'form.replydisc'}?' checked="1"':'').' /> '.   ($ENV{'form.replydisc'}?' checked="1"':'').' /> '.
  &mt('Contribution to course discussion of resource');   &mt('Contribution to course discussion of resource');
     $discussoptions.='<br /><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '.      $discussoptions.='</label><br /><label><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '.
  &mt('Anonymous contribution to course discussion of resource').   &mt('Anonymous contribution to course discussion of resource').
  ' <i>('.&mt('name only visible to course faculty').')</i>';   ' <i>('.&mt('name only visible to course faculty').')</i></label>';
         }          }
     }      }
     if ($msgoptions) { $msgoptions='<h2><img src="/adm/lonMisc/feedback.gif" />'.&mt('Sending Messages').'</h2>'.$msgoptions; }      if ($msgoptions) { $msgoptions='<h2><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" />'.&mt('Sending Messages').'</h2>'.$msgoptions; }
     if ($discussoptions) {       if ($discussoptions) { 
  $discussoptions='<h2><img src="/adm/lonMisc/chat.gif" />'.&mt('Discussion Contributions').'</h2>'.$discussoptions; }   $discussoptions='<h2><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" />'.&mt('Discussion Contributions').'</h2>'.$discussoptions; }
     return $msgoptions.$discussoptions;      return $msgoptions.$discussoptions;
 }  }
   
Line 2297  sub clear_out_html { Line 2333  sub clear_out_html {
       # <SUP>        # <SUP>
       %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1,        %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1,
      BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1,       BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1,
      M=>1, SUB=>1, SUP=>1, SPAN=>1,        M=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1, 
      H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);       H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);
   }    }
 # Do the substitution of everything that is not explicitly allowed  # Do the substitution of everything that is not explicitly allowed
Line 2547  sub show_preview { Line 2583  sub show_preview {
     my $subject=&clear_out_html($ENV{'form.subject'});      my $subject=&clear_out_html($ENV{'form.subject'});
     $subject=~s/\n/\<br \/\>/g;      $subject=~s/\n/\<br \/\>/g;
     $subject=&Apache::lontexconvert::msgtexconverted($subject);      $subject=&Apache::lontexconvert::msgtexconverted($subject);
     $r->print('<table border="2"><tr><td>'.      my $html=&Apache::lonxml::xmlbegin();
        '<b>Subject:</b> '.$subject.'<br /><br />'.      $r->print($html.'<head>'.
        $message.'</td></tr></table>');        '</head><body><table border="2"><tr><td>'.
         '<b>Subject:</b> '.$subject.'<br /><br />'.
         $message.'</td></tr></table></body></html>');
 }  }
   
 sub generate_preview_button {  sub generate_preview_button {
Line 2581  sub modify_attachments { Line 2619  sub modify_attachments {
         &extract_attachments($attachmenturls,$idx,$numoldver,\$msg,\%attachments,\%currattach,$currdelold);          &extract_attachments($attachmenturls,$idx,$numoldver,\$msg,\%attachments,\%currattach,$currdelold);
     }      }
     &Apache::lonenc::check_encrypt(\$symb);      &Apache::lonenc::check_encrypt(\$symb);
       my $html=&Apache::lonxml::xmlbegin();
     $r->print(<<END);      $r->print(<<END);
 <html>  $html
 <head>  <head>
 <title>Managing Attachments</title>  <title>Managing Attachments</title>
 <script>  <script>
Line 2607  END Line 2646  END
                 foreach my $id (@currold) {                  foreach my $id (@currold) {
                     my $attachurl = &HTML::Entities::decode($attachments{$id}{'filename'});                       my $attachurl = &HTML::Entities::decode($attachments{$id}{'filename'}); 
                     $attachurl =~ m#/([^/]+)$#;                      $attachurl =~ m#/([^/]+)$#;
                     $r->print('<input type="checkbox" name="deloldattach" value="'.$id.'" />&nbsp;'.$1.'<br />'."\n");                      $r->print('<label><input type="checkbox" name="deloldattach" value="'.$id.'" />&nbsp;'.$1.'</label><br />'."\n");
                 }                  }
                 $r->print("<br />");                  $r->print("<br />");
             }              }
Line 2617  END Line 2656  END
         $r->print("The following attachments have been uploaded for inclusion with this posting.<br />Check the checkboxes for any you wish to remove<br />\n");          $r->print("The following attachments have been uploaded for inclusion with this posting.<br />Check the checkboxes for any you wish to remove<br />\n");
         foreach (@{$currnewattach}) {          foreach (@{$currnewattach}) {
             $_ =~ m#/([^/]+)$#;              $_ =~ m#/([^/]+)$#;
             $r->print('<input type="checkbox" name="delnewattach" value="'.$_.'" />&nbsp;'.$1.'<br />'."\n");              $r->print('<label><input type="checkbox" name="delnewattach" value="'.$_.'" />&nbsp;'.$1.'</label><br />'."\n");
         }          }
         $r->print("<br />");           $r->print("<br />"); 
     }      }
Line 2932  sub handler { Line 2971  sub handler {
   if ($ENV{'form.allversions'}) {    if ($ENV{'form.allversions'}) {
       &Apache::loncommon::content_type($r,'text/html');        &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;        $r->send_http_header;
         my $html=&Apache::lonxml::xmlbegin();
       my $bodytag=&Apache::loncommon::bodytag('Discussion Post Versions');        my $bodytag=&Apache::loncommon::bodytag('Discussion Post Versions');
       $r->print(<<END);        $r->print(<<END);
 <html>  $html
 <head>  <head>
 <title>Post Versions</title>  <title>Post Versions</title>
 <meta http-equiv="pragma" content="no-cache" />  <meta http-equiv="pragma" content="no-cache" />
Line 3034  END Line 3074  END
       }        }
       &Apache::loncommon::content_type($r,'text/html');        &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;        $r->send_http_header;
         my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
         my $html=&Apache::lonxml::xmlbegin();
       $r->print (<<ENDREDIR);        $r->print (<<ENDREDIR);
 <html>  $html
 <head>  <head>
 <title>New posts marked as read</title>  <title>New posts marked as read</title>
 <meta http-equiv="pragma" content="no-cache" />  <meta http-equiv="pragma" content="no-cache" />
 <meta HTTP-EQUIV="Refresh" CONTENT="2; url=$feedurl" />  <meta HTTP-EQUIV="Refresh" CONTENT="2; url=$feedurl" />
 </head>  </head>
 <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { this.document.reldt.submit(); self.close(); }'>  <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { this.document.reldt.submit(); self.close(); }'>
 <img align="right" src="/adm/lonIcons/lonlogos.gif" />  <img align="right" src="$logo" />
 $textline  $textline
 <form name="reldt" action="$feedurl" target="loncapaclient">  <form name="reldt" action="$feedurl" target="loncapaclient">
 </form>  </form>

Removed from v.1.145  
changed lines
  Added in v.1.155


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