Diff for /loncom/interface/lonsimplepage.pm between versions 1.84 and 1.87

version 1.84, 2009/06/11 16:48:33 version 1.87, 2009/12/07 19:47:56
Line 232  sub handler { Line 232  sub handler {
         $syllabus{'uploaded.lastmodified'}=time;          $syllabus{'uploaded.lastmodified'}=time;
         &Apache::lonnet::put($db_name,\%syllabus,$dom,$crs);          &Apache::lonnet::put($db_name,\%syllabus,$dom,$crs);
     }      }
     if ($allowed && $env{'form.delupl'}) {  #    if ($allowed && $env{'form.delupl'}) {
         if ($syllabus{'uploaded.photourl'}) {  #        if ($syllabus{'uploaded.photourl'}) {
             &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'});  #            &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'});
             delete($syllabus{'uploaded.photourl'});  #            delete($syllabus{'uploaded.photourl'});
             &Apache::lonnet::del('simplepage',['uploaded.photourl']);  #            &Apache::lonnet::del('simplepage',['uploaded.photourl']);
         }  #        }
     }  #    }
     if (($allowed) && ($env{'form.storesyl'})) {      if (($allowed) && ($env{'form.storesyl'})) {
         foreach my $syl_field (keys(%syllabusfields)) {          foreach my $syl_field (keys(%syllabusfields)) {
             my $field=$env{'form.'.$syl_field};              my $field=$env{'form.'.$syl_field};
Line 304  sub handler { Line 304  sub handler {
             &Apache::lonnet::allowuploaded('/adm/smppg',              &Apache::lonnet::allowuploaded('/adm/smppg',
                     $syllabus{'uploaded.photourl'});                      $syllabus{'uploaded.photourl'});
   
             $image='<img src="'.$syllabus{'uploaded.photourl'}.'"              $image='<img src="'.$syllabus{'uploaded.photourl'}
                             />';                    .'" alt="'.&mt('Image').'" />';
             if ($target eq 'tex') {              if ($target eq 'tex') {
                 $image=&Apache::lonxml::xmlparse($r,'tex',$image);                  $image=&Apache::lonxml::xmlparse($r,'tex',$image);
             }              }
Line 313  sub handler { Line 313  sub handler {
   
         if ($allowed) {          if ($allowed) {
             $r->print(              $r->print(
                   '<form method="post" enctype="multipart/form-data">'.                    '<form method="post" action="" enctype="multipart/form-data">'.
                   '<input type="hidden" name="forceedit" value="edit" />'.                    '<input type="hidden" name="forceedit" value="edit" />'.
                   '<h3>'.&mt('Upload a Photo').'</h3>'.                    '<h3>'.&mt('Upload a Photo').'</h3>'.
                   '<input type="file" name="uploaddoc" size="50" />'.                    '<input type="file" name="uploaddoc" size="50" />'.
                   '<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'.                    '<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'.
                   '</form><form method="post">'.                    '</form><form method="post" action="">'.
                   '<input type="hidden" name="forceedit" value="edit" />');                    '<input type="hidden" name="forceedit" value="edit" />');
             if ($syllabus{'uploaded.photourl'}) {  #            if ($syllabus{'uploaded.photourl'}) {
                 $r->print('<form method="post"><input type="submit" name="delupl" value="'.&mt('Delete Photo').'" />' );  #                $r->print('<input type="submit" name="delupl"'
             }  #                         .' value="'.&mt('Delete Photo').'" />');
   #            }
         }          }
         if ($allowed) {          if ($allowed) {
             $r->print($image.'<div class="clear">&nbsp;</div>');              $r->print($image.'<div class="LC_footer_clear">&nbsp;</div>');
         }          }
   
         foreach my $field (sort(keys(%syllabusfields))) {          foreach my $field (sort(keys(%syllabusfields))) {
             if (($syllabus{$field}) || ($allowed) ||              if (($syllabus{$field}) || ($allowed) ||
                 ($field eq 'abb_links' && $group ne '')) {                  ($field eq 'abb_links' && $group ne '')) {
                 my $message=$syllabus{$field};                  my $message=$syllabus{$field};
                 &Apache::lonfeedback::newline_to_br(\$message);                  if (!&Apache::lonfeedback::contains_block_html($message)) {
                   &Apache::lonfeedback::newline_to_br(\$message);
                   }
                 $message=~s/(https*\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;                  $message=~s/(https*\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;
                 if ($allowed) {                  if ($allowed) {
                     $message=&Apache::lonspeller::markeduptext($message);                      $message=&Apache::lonspeller::markeduptext($message);

Removed from v.1.84  
changed lines
  Added in v.1.87


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