Diff for /loncom/interface/lonsimplepage.pm between versions 1.46 and 1.50

version 1.46, 2006/07/20 15:03:01 version 1.50, 2007/05/02 01:33:49
Line 38  use Apache::lonlocal; Line 38  use Apache::lonlocal;
 use Apache::lonprintout;  use Apache::lonprintout;
 use Apache::lonxml;  use Apache::lonxml;
 use Apache::longroup;  use Apache::longroup;
   use HTML::Entities();
 use LONCAPA;  use LONCAPA;
   
 sub handler {  sub handler {
Line 149  sub handler { Line 150  sub handler {
                 $r->print(&grouppage_breadcrumbs($dom,$crs,$group,$group_desc));                  $r->print(&grouppage_breadcrumbs($dom,$crs,$group,$group_desc));
             }              }
             if ((!$group_home_edit) && (!$group_home_view) &&               if ((!$group_home_edit) && (!$group_home_view) && 
                 (!$group_view_perm) && (!$group_edit_perm)) {                    (!$group_view_perm) && (!$group_edit_perm)) {
                 &display_group_links($r,$target,$group,'view',$refarg,%groupinfo);                  &display_group_links($r,$target,$group,'view',$refarg,%groupinfo);
                   if ($env{'form.grade_target'} ne 'tex') {
                       $r->print(&Apache::loncommon::end_page());
                   } else {
                       $r->print('\end{document}');
                   }
                 return OK;                  return OK;
             }              }
         } else {          } else {
Line 164  sub handler { Line 170  sub handler {
             }              }
     return OK;      return OK;
         }          }
           my ($blocked,$blocktext) = 
                &Apache::loncommon::blocking_status('groups');
           if ($blocked) {
               $r->print($blocktext);
               $r->print(&Apache::loncommon::end_page());
               return OK;
           }
     }      }
   
     my $allowed;      my $allowed;
Line 220  sub handler { Line 233  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 253  sub handler { Line 266  sub handler {
       '<form method="post" enctype="multipart/form-data">'.        '<form method="post" enctype="multipart/form-data">'.
       '<input type="hidden" name="forceedit" value="edit" />'.        '<input type="hidden" name="forceedit" value="edit" />'.
       '<h3>Upload a Photo</h3>'.        '<h3>Upload a Photo</h3>'.
       '<input type="file" name="uploaddoc" size="50">'.        '<input type="file" name="uploaddoc" size="50" />'.
       '<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 268  sub handler { Line 281  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 284  sub handler { Line 297  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.'">'.
                                       $syllabus{$_}.                                        &HTML::Entities::encode($syllabus{$field},'"&<>').
                                       '</textarea><input type="submit" name="storesyl" value="Store" />');                                        '</textarea><input type="submit" name="storesyl" value="Save" />');
                         } 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 310  sub handler { Line 323  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.'">'.
       $syllabus{$_}.                                        &HTML::Entities::encode($syllabus{$field},'"&<>').
       '</textarea><input type="submit" name="storesyl" value="Store" />');        '</textarea><input type="submit" name="storesyl" value="Save" />');
  } 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.46  
changed lines
  Added in v.1.50


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