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

amueller amueller@source.lon-capa.org
Mon, 12 Oct 2009 08:01:09 -0000


This is a MIME encoded message

--amueller1255334469
Content-Type: text/plain

amueller		Mon Oct 12 08:01:09 2009 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm lontemplate.pm lonmsgdisplay.pm 
                     	loncommon.pm 
  Log:
  -lonaboutme, lontemplate, loncommon, lonmsgdisplay: HTML Validation 
  -lonaboutme: new delimiter fro quoting the image tag, because from this line I lost the correct
     syntax highlighting for my favorite vim-editor.
  -lonmsgdisplay: put target in the argument list of disfacetoface function, to force that I'm interested in a 
   tex target. When printing lonaboutme page with facetoface discussion env{form.grade_target} has an empty value.  
  
  
--amueller1255334469
Content-Type: text/plain
Content-Disposition: attachment; filename="amueller-20091012080109.txt"

Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.138 loncom/interface/lonaboutme.pm:1.139
--- loncom/interface/lonaboutme.pm:1.138	Thu Jun 11 16:48:33 2009
+++ loncom/interface/lonaboutme.pm	Mon Oct 12 08:01:08 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Personal Information Page
 #
-# $Id: lonaboutme.pm,v 1.138 2009/06/11 16:48:33 bisitz Exp $
+# $Id: lonaboutme.pm,v 1.139 2009/10/12 08:01:08 amueller Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -207,11 +207,18 @@
 
     if ($target ne 'tex') {
         my $rss_link = &Apache::lonrss::rss_link($cnum,$cdom);
-        my $args = {'function' => $forcestudent,
+        my $args = {'function' => undef,
                     'domain'   => $cdom,
-                    'force_register' => $forceregister};
+# if this page is part of course content it looses the menu line when switching from Edit Mode to Public Mode. To avoid
+#this, I take take the value of the environment Variable $env{form.register}
+#                    'force_register' => $forceregister};
+                    'force_register' => $env{'form.register'}};
+
         if ($env{'form.popup'}) {
             $args->{'no_nav_bar'} = 1;
+		#Don't show breadcrumbs twice, when this page is part of course content and you call it  
+		} elsif ($env{'form.register'}) {
+			#do nothing
         } else { # Don't show breadcrumbs in popup window
             $args->{'bread_crumbs'} = [{href=>"/adm/$cdom/$cnum/aboutme",text=>"Personal Information Page"}];
         }
@@ -353,7 +360,7 @@
             &Apache::lonnet::resizeImage(&Apache::lonnet::filelocation('',$syllabus{'uploaded.photourl'}));
            #---End Resize---
 
-            $image=qq{<img name="userPhoto" src="$syllabus{'uploaded.photourl'} " class="LC_AboutMe_Image" />};
+            $image=qq|<img name="userPhoto" src="$syllabus{'uploaded.photourl'} " class="LC_AboutMe_Image" alt="Photo of the user" />|;
 
             if ($target eq 'tex') {
                 $image=&Apache::lonxml::xmlparse($r,'tex',$image);
@@ -363,20 +370,20 @@
 
         if ($allowed) {
             $r->print(
-                '<form method="post" enctype="multipart/form-data">'.
+                '<form name="UploadPhoto" method="post" enctype="multipart/form-data" action="">'.
                 '<h3>'.&mt('Upload a Photo').'</h3>'.
                 '<input type="file" name="uploaddoc" size="50" />'.
                 '<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'.
                 '<input type="hidden" name="popup" value="'.$env{'form.popup'}.'" />'.
                 '</form>');
             if ($syllabus{'uploaded.photourl'}) {
-                $r->print('<form method="post"><input type="submit" name="delupl" value="'.&mt('Delete Photo').'" /> </form>')
+                $r->print('<form name="delPhoto" method="post" action="" ><input type="submit" name="delupl" value="'.&mt('Delete Photo').'" /> </form>')
             }
-            $r->print('<p>');
+            $r->print('<p></p>');
         }
 
         if($allowed) {
-            $r->print('<form method="post">');
+            $r->print('<form name="lonaboutmeFields" method="post" action="" >');
         }
 
         if ($target ne 'tex') { #print Image
@@ -419,9 +426,8 @@
             &Apache::lontemplate::print_start_template($r,&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course'),'LC_Box');
             $r->print('<span class="LC_info">');
             $r->print(&mt('Shared by course faculty and staff').&Apache::loncommon::help_open_topic("Course_Face_To_Face_Records,Course_Critical_Message"));
-            $r->print('</span> <p>');
-            &Apache::lonmsgdisplay::disfacetoface($r,$cnum,$cdom);
-            $r->print('</p>');
+            $r->print('</span>');
+            &Apache::lonmsgdisplay::disfacetoface($r,$cnum,$cdom,'tex');
             &Apache::lontemplate::print_end_template($r);
 
         } else {
Index: loncom/interface/lontemplate.pm
diff -u loncom/interface/lontemplate.pm:1.37 loncom/interface/lontemplate.pm:1.38
--- loncom/interface/lontemplate.pm:1.37	Thu Jun 11 16:48:33 2009
+++ loncom/interface/lontemplate.pm	Mon Oct 12 08:01:08 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "Template" Functions to generate html output
 #
-# $Id: lontemplate.pm,v 1.37 2009/06/11 16:48:33 bisitz Exp $
+# $Id: lontemplate.pm,v 1.38 2009/10/12 08:01:08 amueller Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -70,27 +70,20 @@
               }
               $message=&Apache::lontexconvert::msgtexconverted($message);
               if ($target ne 'tex') {
-		     if ($allowed) {
-			$r->print('<p>');
-		     }
-
 		    if($field eq 'aaa_contactinfo') {
 				$r->print('<div class="LC_Clear_AboutMe_Image" >&nbsp;</div>');
 				&print_template($r,$syllabusfields{$field},$message,$allowed,'LC_Box');
 		    } else {
 			  &print_template($r,$syllabusfields{$field},$message,$allowed,'LC_Box');
 		    }
+			if($allowed) {
+               &print_editbox_template($r,$syllabus{$field},$field);
+			}
 
               } else {
                      $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'.
                                &Apache::lonxml::xmlparse($r,'tex',$message).'\\\\');
               }
-              if ($allowed) {
-               &print_editbox_template($r,$syllabus{$field},$field);
-		if ($target ne 'tex') {
-			$r->print('</p>');
-		}
-              }
           }
        }
 
@@ -99,7 +92,7 @@
 sub send_message {
 	my ($r,$cnum,$cdom) = @_;
 	my $s;
-	my $image = qq{<img name="Send message" src="/res/adm/pages/mail-message-new.png" border="none" align="middle" />};
+	my $image = qq{<img name="Send_message" alt="Send message symbol" src="/res/adm/pages/mail-message-new.png" border="none" align="middle" />};
 	$s=&Apache::loncommon::messagewrapper($image,$cnum,$cdom).' '.&Apache::loncommon::messagewrapper(&mt('Send me a message'),$cnum,$cdom);
 	return $s;
 }
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.135 loncom/interface/lonmsgdisplay.pm:1.136
--- loncom/interface/lonmsgdisplay.pm:1.135	Fri Sep 25 16:35:29 2009
+++ loncom/interface/lonmsgdisplay.pm	Mon Oct 12 08:01:08 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.135 2009/09/25 16:35:29 bisitz Exp $
+# $Id: lonmsgdisplay.pm,v 1.136 2009/10/12 08:01:08 amueller Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1786,8 +1786,10 @@
 }
 
 sub disfacetoface {
-    my ($r,$user,$domain)=@_;
-    my $target=$env{'form.grade_target'};
+    my ($r,$user,$domain,$target)=@_;
+	if ($target eq '') {
+    	my $target=$env{'form.grade_target'};
+	}
     unless ($env{'request.course.id'}) { return; }
     if  (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})
 	 && ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
@@ -1799,7 +1801,7 @@
 			 $env{'course.'.$env{'request.course.id'}.'.domain'},
 			 $env{'course.'.$env{'request.course.id'}.'.num'},
                          '%255b'.$user.'%253a'.$domain.'%255d');
-    my $result='';
+    my $result='<div>';
     foreach my $key (sort(keys(%records))) {
         my %content=&Apache::lonmsg::unpackagemsg($records{$key});
         next if ($content{'senderdomain'} eq '');
@@ -1856,6 +1858,7 @@
 	      '</pre>';
      }
     # Check to see if there were any messages.
+	&Apache::lonnet::logthis("lonmsgdisplay ..later ... target -- $target");
     if ($result eq '') {
         my $lctype = &mt(lc(&Apache::loncommon::course_type()));
 	if ($target ne 'tex') { 
@@ -1863,9 +1866,11 @@
 	} else {
 	    $r->print('\textbf{'.&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this [_1].',$lctype).'}\\\\');
 	}
+    } elsif ($target ne 'tex') {
+       $r->print($result.'</div>');
     } else {
-       $r->print($result);
-    }
+		$r->print(&Apache::lonxml::xmlparse($r, 'tex', $result));
+	}
 }
 
 sub general_message {
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.895 loncom/interface/loncommon.pm:1.896
--- loncom/interface/loncommon.pm:1.895	Sat Oct 10 03:32:46 2009
+++ loncom/interface/loncommon.pm	Mon Oct 12 08:01:08 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.895 2009/10/10 03:32:46 raeburn Exp $
+# $Id: loncommon.pm,v 1.896 2009/10/12 08:01:08 amueller Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2955,7 +2955,7 @@
 sub noteswrapper {
     my ($link,$un,$do)=@_;
     return 
-"<a href='/adm/email?recordftf=retrieve&recname=$un&recdom=$do'>$link</a>";
+"<a href='/adm/email?recordftf=retrieve&amp;recname=$un&amp;recdom=$do'>$link</a>";
 }
 
 # ------------------------------------------------------------- Aboutme Wrapper

--amueller1255334469--