Diff for /loncom/interface/lonbulletin.pm between versions 1.52 and 1.53

version 1.52, 2009/12/03 02:13:28 version 1.53, 2009/12/07 14:23:43
Line 177  sub handler { Line 177  sub handler {
     if (($syllabus{'uploaded.lastmodified'}) && (!$forceedit)) {      if (($syllabus{'uploaded.lastmodified'}) && (!$forceedit)) {
         $forcestudent='student';          $forcestudent='student';
     }      }
     if ($target ne 'tex') { $r->print('<table><tr><td>'); }  
     if ($forcestudent or $target eq 'tex') { $allowed=0; }      if ($forcestudent or $target eq 'tex') { $allowed=0; }
   
     if ($allowed) {      if ($allowed) {
Line 185  sub handler { Line 184  sub handler {
         if (($group ne '') && ($env{'form.group'} eq $group)) {          if (($group ne '') && ($env{'form.group'} eq $group)) {
             $query_str.='&amp;group='.$group.'&amp;'.$refarg;              $query_str.='&amp;group='.$group.'&amp;'.$refarg;
         }          }
         $r->print(          #Function Box for Edit Mode.
             '<p>'.          my $functionbox = &Apache::lonhtmlcommon::start_funclist();
             &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).'<br /><a href="'.$r->uri.'?'.$query_str.'"><font size="+1">'.&mt('Show Student View').'</font></a>'.          $functionbox .=  &Apache::lonhtmlcommon::add_item_funclist(
              &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');                               '<a href="'.$r->uri.'?'.$query_str.'">'.&mt('Show Student View').'</a>'.
     }  elsif ($privileged and $target ne 'tex') {                                &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView'));
           $functionbox.=&Apache::lonhtmlcommon::end_funclist();
           $r->print(&Apache::loncommon::head_subbox($functionbox).&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')));
       } elsif ($privileged and $target ne 'tex') {
         my $query_str = 'forceedit=edit';          my $query_str = 'forceedit=edit';
         if (($group ne '') && ($env{'form.group'} eq $group)) {          if (($group ne '') && ($env{'form.group'} eq $group)) {
             $query_str.='&amp;group='.$group.'&amp;'.$refarg;              $query_str.='&amp;group='.$group.'&amp;'.$refarg;
         }          }
         $r->print('<a href="'.$r->uri.'?'.$query_str.'"><font size="+1">'          #Functionbox for Student view.
                      .&mt('Edit').'</font></a>');          my $functionbox = &Apache::lonhtmlcommon::start_funclist();
           $functionbox .=  &Apache::lonhtmlcommon::add_item_funclist(
                                "<a href='".$r->uri.'?'.$query_str."'>".&mt('Edit')."</a>");
           $functionbox.=&Apache::lonhtmlcommon::end_funclist();
           $r->print(&Apache::loncommon::head_subbox($functionbox));
     }      }
   
     if (($env{'form.uploaddoc.filename'}) &&      if (($env{'form.uploaddoc.filename'}) &&
Line 233  sub handler { Line 239  sub handler {
         if ($syllabus{'uploaded.photourl'}) {          if ($syllabus{'uploaded.photourl'}) {
             &Apache::lonnet::allowuploaded('/adm/syllabus',              &Apache::lonnet::allowuploaded('/adm/syllabus',
                                            $syllabus{'uploaded.photourl'});                                             $syllabus{'uploaded.photourl'});
             $r->print('<img src="'.$syllabus{'uploaded.photourl'}.  
             '" align="right" />');  
         }          }
           #Outputbox and Inputbox for Image upload
         if ($allowed) {          if ($allowed) {
               &Apache::lontemplate::print_template($r, &mt('Upload a Photo'), '<img src="'.$syllabus{'uploaded.photourl'}.'"/>',$allowed,'LC_Box');
             $r->print(              $r->print(
                 '<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>'.&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">'.
                 '<input type="hidden" name="forceedit" value="edit" />');                  '<input type="hidden" name="forceedit" value="edit" />');
         }          }
           #Image in Student view.
           elsif($syllabus{'uploaded.photourl'} && $target ne 'tex'){
               $r->print('<img src="'.$syllabus{'uploaded.photourl'}.'"/>');
           }
         foreach my $field (sort(keys(%syllabusfields))) {          foreach my $field (sort(keys(%syllabusfields))) {
             if (($syllabus{$field}) || ($allowed)) {              if (($syllabus{$field}) || ($allowed)) {
                 my $message=$syllabus{$field};                  my $message=$syllabus{$field};
Line 258  sub handler { Line 267  sub handler {
                 }                  }
                 $message=&Apache::lontexconvert::msgtexconverted($message);                  $message=&Apache::lontexconvert::msgtexconverted($message);
                 unless ($field eq 'aaa_title') {                  unless ($field eq 'aaa_title') {
                     if (($field ne 'bbb_content') || ($allowed)) {                      #Outputbox
                         if ($target ne 'tex') {  
                             $r->print('<h3>'.$syllabusfields{$field}.'</h3>');  
                         } else {  
                             $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\');  
                         }  
                     }  
                     if ($target ne 'tex') {                      if ($target ne 'tex') {
                         $r->print('<blockquote>'.                          &Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message,$allowed,'LC_Box');
                                   $message.'</blockquote>');  
                     } else {                      } else {
                         $r->print(' '.&Apache::lonxml::xmlparse($r,'tex',$message).' ');                          $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'.&Apache::lonxml::xmlparse($r,'tex',$message));
                     }                      }
                       #Inputbox
                     if ($allowed) {                      if ($allowed) {
                         $r->print('<br /><textarea cols="80" rows="10" name="'.$field.'">'.                           &Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field);
                                   &HTML::Entities::encode($syllabus{$field},'&"<>').  
                                   '</textarea><input type="submit" name="storesyl" value="'.&mt('Save').'" />');  
                     }                      }
                 } else {                  } else {
                       #Print Topic as Heading
                     if ($target ne 'tex') {                      if ($target ne 'tex') {
                         $r->print('<h1>'.$message.'</h1>');                          $r->print('<h1>'.$message.'</h1>');
                     } else {                      } else {
                         $r->print('\\\\\textbf{'.&Apache::lonxml::xmlparse($r,'tex',$message).'}\\\\');                          $r->print('\\\\\textbf{'.&Apache::lonxml::xmlparse($r,'tex',$message).'}\\\\');
                     }                      }
                       #Outputbox and Inputbox for Topic
                     if ($allowed) {                      if ($allowed) {
                         $r->print(                               &Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message,$allowed,'LC_Box');
                             '<br />'.&mt('Topic').'<br /><textarea cols="80" rows="2" name="'.$field.'">'.                               &Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field);
                             &HTML::Entities::encode($syllabus{$field},'&"<>').  
                             '</textarea><input type="submit" name="storesyl" value="'.&mt('Save').'" />');  
                     }                      }
                 }                  }
             }              }
Line 294  sub handler { Line 295  sub handler {
         if ($allowed) {          if ($allowed) {
             $r->print('</form>');              $r->print('</form>');
         }          }
         if ($target ne 'tex') {$r->print('</p>');} else {$r->print('\\\\');}  
     } else {      } else {
         $r->print('<p>'.&mt('No page information provided.').'</p>');          $r->print('<p>'.&mt('No page information provided.').'</p>');
     }      }
     if ($target ne 'tex') { $r->print('</td></tr></table>'); }      #Lists discussion posts and box for a new discussion post.
     if ($target ne 'tex') {      if ($target ne 'tex') {
         $r->print(&Apache::lonfeedback::list_discussion          $r->print(&Apache::lonfeedback::list_discussion
                       ('board','OPEN','bulletin___'.$marker.'___'.                        ('board','OPEN','bulletin___'.$marker.'___'.

Removed from v.1.52  
changed lines
  Added in v.1.53


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