Diff for /loncom/interface/lonsimplepage.pm between versions 1.47 and 1.48

version 1.47, 2006/08/16 19:40:46 version 1.48, 2006/10/23 18:48:47
Line 221  sub handler { Line 221  sub handler {
  &Apache::lonnet::put($namespace,\%syllabus,$dom,$crs);   &Apache::lonnet::put($namespace,\%syllabus,$dom,$crs);
     }      }
     if (($allowed) && ($env{'form.storesyl'})) {      if (($allowed) && ($env{'form.storesyl'})) {
  foreach (keys %syllabusfields) {   foreach my $syl_field (keys(%syllabusfields)) {
     my $field=$env{'form.'.$_};      my $field=$env{'form.'.$syl_field};
     chomp($field);      chomp($field);
     $field=~s/\s+$//s;      $field=~s/\s+$//s;
     $field=~s/^\s+//s;      $field=~s/^\s+//s;
     $field=~s/\<br\s*\/*\>$//s;      $field=~s/\<br\s*\/*\>$//s;
     $field=&Apache::lonfeedback::clear_out_html($field,1);      $field=&Apache::lonfeedback::clear_out_html($field,1);
     $syllabus{$_}=$field;      $syllabus{$syl_field}=$field;
  }   }
  $syllabus{'uploaded.lastmodified'}=time;   $syllabus{'uploaded.lastmodified'}=time;
  &Apache::lonnet::put($namespace,\%syllabus,$dom,$crs);   &Apache::lonnet::put($namespace,\%syllabus,$dom,$crs);
Line 258  sub handler { Line 258  sub handler {
       '<input type="submit" name="storeupl" value="Upload">'.        '<input type="submit" name="storeupl" value="Upload">'.
       '</form><form method="post">');        '</form><form method="post">');
  }   }
  foreach (sort keys %syllabusfields) {   foreach my $field (sort(keys(%syllabusfields))) {
     if (($syllabus{$_}) || ($allowed) ||       if (($syllabus{$field}) || ($allowed) || 
                 ($_ eq 'abb_links' && $group ne '')) {                  ($field eq 'abb_links' && $group ne '')) {
  my $message=$syllabus{$_};   my $message=$syllabus{$field};
  &Apache::lonfeedback::newline_to_br(\$message);   &Apache::lonfeedback::newline_to_br(\$message);
  $message   $message
     =~s/(https*\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;      =~s/(https*\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;
Line 269  sub handler { Line 269  sub handler {
     $message=&Apache::lonspeller::markeduptext($message);      $message=&Apache::lonspeller::markeduptext($message);
  }   }
  $message=&Apache::lontexconvert::msgtexconverted($message);   $message=&Apache::lontexconvert::msgtexconverted($message);
                 if ($_ eq 'abb_links' && $group ne '') {                  if ($field eq 'abb_links' && $group ne '') {
                     $r->print('<br /><input type="hidden" name="'.$_.                      $r->print('<br /><input type="hidden" name="'.$field.
                                           '" value="'.$syllabus{$_}.'" />');                                            '" value="'.$syllabus{$field}.'" />');
                     &display_group_links($r,$target,$group,'edit',$refarg,                      &display_group_links($r,$target,$group,'edit',$refarg,
                                          %groupinfo);                                           %groupinfo);
                     $r->print('<br />');                      $r->print('<br />');
                 } elsif ($_ eq 'aaa_title') {                  } elsif ($field eq 'aaa_title') {
                     if ($target ne 'tex') {                      if ($target ne 'tex') {
                         $r->print('<h1>'.$message.'</h1>');                          $r->print('<h1>'.$message.'</h1>');
                     } else {                      } else {
Line 285  sub handler { Line 285  sub handler {
                     if ($allowed) {                      if ($allowed) {
                         if ($env{'form.grade_target'} ne 'tex') {                          if ($env{'form.grade_target'} ne 'tex') {
                             $r->print(                              $r->print(
                                       '<br />Title<br /><textarea cols="80" rows="2" name="'.$_.'">'.                                        '<br />Title<br /><textarea cols="80" rows="2" name="'.$field.'">'.
                                       &HTML::Entities::encode($syllabus{$_},'"&<>').                                        &HTML::Entities::encode($syllabus{$field},'"&<>').
                                       '</textarea><input type="submit" name="storesyl" value="Store" />');                                        '</textarea><input type="submit" name="storesyl" value="Store" />');
                         } else {                          } else {
                             my $safeinit;                              my $safeinit;
                             $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$_},$safeinit));                              $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$field},$safeinit));
                         }                          }
                     }                      }
                 } else {                  } else {
     if (($_ ne 'bbb_content') || ($allowed)) {      if (($field ne 'bbb_content') || ($allowed)) {
  if ($target ne 'tex') {   if ($target ne 'tex') {
     $r->print('<h3>'.$syllabusfields{$_}.'</h3>');      $r->print('<h3>'.$syllabusfields{$field}.'</h3>');
  } else {   } else {
     my $safeinit;      my $safeinit;
     $r->print(&Apache::lonxml::xmlparse($r,'tex','<h3>'.$syllabusfields{$_}.'</h3>'));      $r->print(&Apache::lonxml::xmlparse($r,'tex','<h3>'.$syllabusfields{$field}.'</h3>'));
  }   }
     }      }
     if ($target ne 'tex') {      if ($target ne 'tex') {
Line 311  sub handler { Line 311  sub handler {
     }      }
     if ($allowed) {      if ($allowed) {
  if ($target ne 'tex') {   if ($target ne 'tex') {
     $r->print('<br /><textarea cols="80" rows="24" name="'.$_.'" id="'.$_.'">'.      $r->print('<br /><textarea cols="80" rows="24" name="'.$field.'" id="'.$field.'">'.
                                       &HTML::Entities::encode($syllabus{$_},'"&<>').                                        &HTML::Entities::encode($syllabus{$field},'"&<>').
       '</textarea><input type="submit" name="storesyl" value="Store" />');        '</textarea><input type="submit" name="storesyl" value="Store" />');
  } else {   } else {
     my $safeinit;      my $safeinit;
     $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$_},$safeinit));      $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$field},$safeinit));
  }   }
     }      }
  }   }

Removed from v.1.47  
changed lines
  Added in v.1.48


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