Diff for /loncom/interface/lonaboutme.pm between versions 1.27 and 1.36

version 1.27, 2004/05/12 19:25:15 version 1.36, 2005/02/17 08:29:42
Line 44  sub handler { Line 44  sub handler {
     my $target=$ENV{'form.grade_target'};      my $target=$ENV{'form.grade_target'};
 # ------------------------------------------------------------ Print the screen  # ------------------------------------------------------------ Print the screen
     if ($target ne 'tex') {      if ($target ne 'tex') {
    my $html=&Apache::lonxml::xmlbegin();
  $r->print(<<ENDDOCUMENT);   $r->print(<<ENDDOCUMENT);
 <html>  $html
 <head>  <head>
 <title>The LearningOnline Network with CAPA</title>  <title>The LearningOnline Network with CAPA</title>
 ENDDOCUMENT  ENDDOCUMENT
Line 105  ENDDOCUMENT Line 106  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 132  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 159  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'});
    my $image='<img src="'.$syllabus{'uploaded.photourl'}.'"     my $image=
                            align="right" />';                 qq{<img src="$syllabus{'uploaded.photourl'}" align="right" />};
    if ($target eq 'tex') {     if ($target eq 'tex') {
        $image=&Apache::lonxml::xmlparse($r,'tex',$image);         $image=&Apache::lonxml::xmlparse($r,'tex',$image);
    }     }
Line 162  ENDDOCUMENT Line 168  ENDDOCUMENT
        }         }
        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 174  ENDDOCUMENT Line 184  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 200  ENDDOCUMENT Line 213  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.27  
changed lines
  Added in v.1.36


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