[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Mon, 03 May 2004 19:04:49 -0000


sakharuk		Mon May  3 15:04:49 2004 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm 
  Log:
  About me page can be printed with minor html in latex. Continue to work.
  
  
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.21 loncom/interface/lonaboutme.pm:1.22
--- loncom/interface/lonaboutme.pm:1.21	Fri Apr 30 19:13:52 2004
+++ loncom/interface/lonaboutme.pm	Mon May  3 15:04:49 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "About Me" Personal Information
 #
-# $Id: lonaboutme.pm,v 1.21 2004/04/30 23:13:52 albertel Exp $
+# $Id: lonaboutme.pm,v 1.22 2004/05/03 19:04:49 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -41,13 +41,17 @@
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
     return OK if $r->header_only;
-
+    my $target=$ENV{'form.grade_target'};
 # ------------------------------------------------------------ Print the screen
-    $r->print(<<ENDDOCUMENT);
+    if ($target ne 'tex') {
+	$r->print(<<ENDDOCUMENT);
 <html>
 <head>
 <title>The LearningOnline Network with CAPA</title>
 ENDDOCUMENT
+    } else {
+	$r->print(&Apache::lonprintout::print_latex_header($ENV{'form.latex_type'}));
+    }
     my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
 # Is this even a user?
     if (&Apache::lonnet::homeserver($cnum,$cdom) eq 'no_host') {
@@ -77,18 +81,25 @@
        
 # --------------------------------------- There is such a user, get environment
     my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum);
-    $r->print('</head>'.&Apache::loncommon::bodytag
+    if ($target ne 'tex') {
+	$r->print('</head>'.&Apache::loncommon::bodytag
                   ("Personal Information",$forcestudent,$addentries,'',$cdom,
                    $ENV{'form.register'}));
-    $r->print('<h1>'.&Apache::loncommon::plainname($cnum,$cdom).'</h1>');
+	$r->print('<h1>'.&Apache::loncommon::plainname($cnum,$cdom).'</h1>');
+    } else {
+	$r->print('\noindent{\large\textbf{'.&Apache::loncommon::plainname($cnum,$cdom).'}}\\\\\\\\');
+    }
     if ($courseenv{'nickname'}) {
        $r->print(
          '<h2>&quot;'.$courseenv{'nickname'}.
          '&quot;</h2>');
     }
-    $r->print('<h3>'.$Apache::lonnet::domaindescription{$cdom}.'</h3>'.
-    '<p>'.&Apache::loncommon::messagewrapper('Send me a message',$cnum,$cdom).
-    '</p>');
+    if ($target ne 'tex') {
+	$r->print('<h3>'.$Apache::lonnet::domaindescription{$cdom}.'</h3>'.
+		  '<p>'.&Apache::loncommon::messagewrapper('Send me a message',$cnum,$cdom).'</p>');
+    } else {
+	$r->print('\textbf{'.$Apache::lonnet::domaindescription{$cdom}.'}\\\\');
+    }
     my %syllabus=&Apache::lonnet::dump('aboutme',$cdom,$cnum);
     my $allowed=0;
 
@@ -99,11 +110,16 @@
        if ($forcestudent) { $allowed=0; }
  
        if ($allowed) {
-          $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.').
-'</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_PublicView').'</p>');
+	   if ($target ne 'tex') {
+	       $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.').
+                         '</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_PublicView').'</p>');
+	   } else {
+	       $r->print(' \textbf{'.&mt('Privacy Note').'}: '.
+                         &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'}) &&
           ($ENV{'form.storeupl'}) && ($allowed)) {
@@ -140,7 +156,7 @@
 	   $r->print('<img src="'.$syllabus{'uploaded.photourl'}.
              '" align="right" />');
        }
-       if ($allowed) {
+       if ($allowed & $target ne 'tex') {
            $r->print(
 	 '<form method="post" enctype="multipart/form-data">'.
          '<h3>'.&mt('Upload a Photo').'</h3>'.
@@ -155,9 +171,14 @@
               $message
              =~s/(http\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;
 	      $message=&Apache::lontexconvert::msgtexconverted($message);
-              $r->print('<h3>'.$syllabusfields{$_}.'</h3><blockquote>'.
-                        $message.'</blockquote>');
-              if ($allowed) {
+	      if ($target ne 'tex') {
+		  $r->print('<h3>'.$syllabusfields{$_}.'</h3><blockquote>'.
+                            $message.'</blockquote>');
+	      } else {
+		     $r->print('\\\\\textbf{'.$syllabusfields{$_}.'}\\\\'.
+			       &Apache::lonxml::xmlparse($r,' ',$message).'\\\\');
+	      }
+              if ($allowed and $target ne 'tex') {
                  $r->print('<br /><textarea cols="80" rows="6" name="'.$_.'">'.
 			   $syllabus{$_}.
            '</textarea><input type="submit" name="storesyl" value="'.
@@ -165,25 +186,32 @@
 	      }
 	  }
        }
-       if ($allowed) {
+       if ($allowed and $target ne 'tex') {
 	   $r->print('</form>');
        }
-       $r->print('</p>');
+       if ($target ne 'tex') {$r->print('</p>');} else {$r->print('\\\\');}
     } else {
        $r->print('<p>'.&mt('No personal information provided').'.</p>');
     }
     if ($ENV{'request.course.id'}) {
 	if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
-            $r->print('<hr /><h3>'.
-&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'</h3>'.
-&mt('Shared by course faculty and staff').
-&Apache::loncommon::help_open_topic("Course_Face_To_Face_Records,Course_Critical_Message").
+	    if ($target ne 'tex') {
+		$r->print('<hr /><h3>'.
+                          &mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'</h3>'.
+                          &mt('Shared by course faculty and staff').
+                          &Apache::loncommon::help_open_topic("Course_Face_To_Face_Records,Course_Critical_Message").
 '<br />');
 	    &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);
             $r->print(&Apache::loncommon::noteswrapper('Add Records',$cnum,$cdom));
+	    } 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').'\\\\\\\\');
+		my $mess=&Apache::lonmsg::disfacetoface($r,$cnum,$cdom);
+	#    $r->print(' '.&Apache::lonxml::xmlparse($r,' ',$mess).' ');
+		$r->print(' >>>>'.$mess.'<<<< ');
+	    }
         }
     }
-    $r->print('</body></html>');
+    if ($target ne 'tex') {$r->print('</body></html>');} else {$r->print('\end{document}');}
     return OK;
 }