Diff for /loncom/interface/lonaboutme.pm between versions 1.26 and 1.34

version 1.26, 2004/05/12 19:00:20 version 1.34, 2004/12/15 20:00:44
Line 105  ENDDOCUMENT Line 105  ENDDOCUMENT
   
 # does this user have privileges to post, etc?  # does this user have privileges to post, etc?
   
        $allowed=(($ENV{'user.name'} eq $cnum) &&          my $privleged=$allowed=(($ENV{'user.name'} eq $cnum) && 
  ($ENV{'user.domain'} eq $cdom));         ($ENV{'user.domain'} eq $cdom));
        if ($forcestudent or $target eq 'tex') { $allowed=0; }         if ($forcestudent or $target eq 'tex') { $allowed=0; }
     
        if ($allowed) {         if ($allowed) {
    if ($target ne 'tex') {     $r->print('<p><b>'.&mt('Privacy Note').':</b> '.
        $r->print('<p><b>'.&mt('Privacy Note').':</b> '.       &mt('The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publicly.').
                          &mt('The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publicly.').       '</p>'.
                          '</p>'.       &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'</p><p><a href="'.$r->uri.'?forcestudent=1">Show Public View</a>'.
                          &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'</p><p><a href="'.$r->uri.'?forcestudent=1">Show Public View</a>'.       &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');
                          &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');         } elsif ($privleged && $target ne 'tex') {
    } else {     $r->print('<p><a href="'.$r->uri.'?forceedit=1"><font size="+1">'.
        $r->print(' \textbf{'.&mt('Privacy Note').'}: '.       &mt('Edit').'</font></a></p>');
                          &mt('The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publicly.').'\\\\\\\\');         }
    }  
       }  
       if (($ENV{'form.uploaddoc.filename'}) &&        if (($ENV{'form.uploaddoc.filename'}) &&
           ($ENV{'form.storeupl'}) && ($allowed)) {            ($ENV{'form.storeupl'}) && ($allowed)) {
    if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {     if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {
Line 133  ENDDOCUMENT Line 131  ENDDOCUMENT
           $syllabus{'uploaded.lastmodified'}=time;            $syllabus{'uploaded.lastmodified'}=time;
           &Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum);            &Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum);
        }         }
       if ($allowed && $ENV{'form.delupl'}) {
    if ($syllabus{'uploaded.photourl'}) {
       &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'});
       delete($syllabus{'uploaded.photourl'});
       &Apache::lonnet::del('aboutme',['uploaded.photourl'],$cdom,$cnum);
    }
       }
        if (($allowed) && ($ENV{'form.storesyl'})) {         if (($allowed) && ($ENV{'form.storesyl'})) {
    foreach (keys %syllabusfields) {     foreach (keys %syllabusfields) {
                my $field=$ENV{'form.'.$_};                 my $field=$ENV{'form.'.$_};
Line 153  ENDDOCUMENT Line 158  ENDDOCUMENT
        if ($syllabus{'uploaded.photourl'}) {         if ($syllabus{'uploaded.photourl'}) {
    &Apache::lonnet::allowuploaded('/adm/aboutme',     &Apache::lonnet::allowuploaded('/adm/aboutme',
   $syllabus{'uploaded.photourl'});    $syllabus{'uploaded.photourl'});
    if ($target ne 'tex') {     my $image=
        $r->print('<img src="'.$syllabus{'uploaded.photourl'}.                 qq{<img src="$syllabus{'uploaded.photourl'}" align="right" />};
  '" align="right" />');     if ($target eq 'tex') {
    } else {         $image=&Apache::lonxml::xmlparse($r,'tex',$image);
        $r->print(&Apache::lonxml::xmlparse($r,'tex','<img src="'.$syllabus{'uploaded.photourl'}.  
  '" align="right" />'));  
    }     }
      $r->print($image);
        }         }
        if ($allowed) {         if ($allowed) {
            $r->print(             $r->print(
    '<form method="post">
                  <input type="submit" name="delupl" value="Delete Photo" />
             </form>'.
  '<form method="post" enctype="multipart/form-data">'.   '<form method="post" enctype="multipart/form-data">'.
          '<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="Upload">'.           '<input type="submit" name="storeupl" value="Upload">'.
  '</form><form method="post">');   '</form><form method="post">');
   
        }         }
        foreach (sort keys %syllabusfields) {         foreach (sort keys %syllabusfields) {
           if (($syllabus{$_}) || ($allowed)) {            if (($syllabus{$_}) || ($allowed)) {
Line 175  ENDDOCUMENT Line 183  ENDDOCUMENT
               $message=~s/\n/\<br \/\>/g;                $message=~s/\n/\<br \/\>/g;
               $message                $message
              =~s/(http\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;               =~s/(http\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;
         if ($allowed) {
     $message=&Apache::lonspeller::markeduptext($message);
         }
       $message=&Apache::lontexconvert::msgtexconverted($message);        $message=&Apache::lontexconvert::msgtexconverted($message);
       if ($target ne 'tex') {        if ($target ne 'tex') {
   $r->print('<h3>'.$syllabusfields{$_}.'</h3><blockquote>'.    $r->print('<h3>'.$syllabusfields{$_}.'</h3><blockquote>'.
Line 201  ENDDOCUMENT Line 212  ENDDOCUMENT
     if ($ENV{'request.course.id'}) {      if ($ENV{'request.course.id'}) {
  if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {   if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
     if ($target ne 'tex') {      if ($target ne 'tex') {
    $r->print('<a name="coursecomment" />');
  $r->print('<hr /><h3>'.   $r->print('<hr /><h3>'.
                           &mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'</h3>'.                            &mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'</h3>'.
                           &mt('Shared by course faculty and staff').                            &mt('Shared by course faculty and staff').
                           &Apache::loncommon::help_open_topic("Course_Face_To_Face_Records,Course_Critical_Message").                            &Apache::loncommon::help_open_topic("Course_Face_To_Face_Records,Course_Critical_Message").
 '<br />');  '<br />');
     &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);                  &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);
             $r->print(&Apache::loncommon::noteswrapper('Add Records',$cnum,$cdom));                  $r->print('<hr />');
                   if (&Apache::lonnet::allowed('vsa',
                                                $ENV{'request.course.id'}) ||
                       &Apache::lonnet::allowed('vsa',
                                                $ENV{'request.course.id'}.'/'.
                                                $ENV{'request.course.sec'})) {
   #                    $r->print(&Apache::loncommon::track_student_link
   #                              ('View recent activity by this student',
   #                               $cnum,$cdom).('&nbsp;'x2));
                   }
                   $r->print(&Apache::loncommon::noteswrapper('Add Records',$cnum,$cdom));
     } else {      } else {
  $r->print('\\\\\textbf{'.&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'}\\\\'.&mt('Shared by course faculty and staff').'\\\\\\\\');   $r->print('\\\\\textbf{'.&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'}\\\\'.&mt('Shared by course faculty and staff').'\\\\\\\\');
  &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);   &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);

Removed from v.1.26  
changed lines
  Added in v.1.34


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