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

neumanie neumanie@source.lon-capa.org
Fri, 20 Feb 2009 17:45:40 -0000


This is a MIME encoded message

--neumanie1235151940
Content-Type: text/plain

neumanie		Fri Feb 20 17:45:40 2009 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm lonsyllabus.pm lontemplate.pm 
                     	lonsimplepage.pm 
  Log:
  Add new design syllabus.Add the"Add Record" and "View recent activity.." links in the function fieldset in aboutme. Design fixes in aboutme,simplepage,template.  
  
  
--neumanie1235151940
Content-Type: text/plain
Content-Disposition: attachment; filename="neumanie-20090220174540.txt"

Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.100 loncom/interface/lonaboutme.pm:1.101
--- loncom/interface/lonaboutme.pm:1.100	Thu Feb 19 18:55:53 2009
+++ loncom/interface/lonaboutme.pm	Fri Feb 20 17:45:40 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Personal Information Page
 #
-# $Id: lonaboutme.pm,v 1.100 2009/02/19 18:55:53 neumanie Exp $
+# $Id: lonaboutme.pm,v 1.101 2009/02/20 17:45:40 neumanie Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -221,7 +221,7 @@
     }
     if ($target ne 'tex') {
         $r->print('<blockquote>');
-	$r->print('<h3>'.&Apache::lonnet::domain($cdom,'description').'</h3>');#OLD SendMessage POS
+	$r->print('<h3>'.&Apache::lonnet::domain($cdom,'description').'</h3>');
     } else {
 	$r->print('\textbf{'.&Apache::lonnet::domain($cdom,'description').'}\\\\');
     }
@@ -297,6 +297,7 @@
 	   }
 	
        }
+	#---Print Functions
 	if( $target ne 'tex'){
 		 &Apache::lontemplate::print_start_page_functions($r);
       		if($allowed){
@@ -307,7 +308,16 @@
 			 &Apache::lontemplate::print_functions_content($r,'<a href="'.$r->uri.$query_string.'">'. &mt('Edit').'</a>');
 		}
 		&Apache::lontemplate::print_functions_content($r,&Apache::lontemplate::send_message($r,$cnum,$cdom));
-		 &Apache::lontemplate::print_end_page_functions($r);
+
+		if ($env{'request.course.id'} && &Apache::lonnet::allowed('srm',$env{'request.course.id'})	&& &in_course($cdom,$cnum)) {
+			if (&Apache::lonnet::allowed('vsa', $env{'request.course.id'}) || &Apache::lonnet::allowed('vsa', $env{'request.course.id'}.'/'.
+					 $env{'request.course.sec'})) {
+				&Apache::lontemplate::print_functions_content($r,&Apache::loncommon::track_student_link('View recent activity by this student',
+			  	 	$cnum,$cdom).('&nbsp;'x2));
+	    		}
+	    		&Apache::lontemplate::print_functions_content($r,&Apache::loncommon::noteswrapper(&mt('Add Records'),$cnum,$cdom));
+		}
+	&Apache::lontemplate::print_end_page_functions($r);
 	}
        if ($allowed) {
            $r->print(
@@ -327,8 +337,7 @@
 
 	 if($target ne 'tex') #print Image
      	 {	
-		&Apache::lontemplate::start_ContentBox($r);		
-		#&Apache::lontemplate::send_message($r,$cnum,$cdom);
+		&Apache::lontemplate::start_ContentBox($r);			
 		&Apache::lontemplate::end_ContentBox($r);
 		$r->print($image);		
 		
@@ -339,17 +348,15 @@
         #End Print Content
 
        if($target ne 'tex')#Begin Print RSS and portfiles
-       {	
-				
+       {			
 		&print_portfiles_link($r,$is_course);
 		if(&Apache::lonrss::advertisefeeds($cnum,$cdom) ne ''){			
 			&Apache::lontemplate::print_template($r,'RSS Feeds and Blogs',&Apache::lonrss::advertisefeeds($cnum,$cdom),1,'LC_ContentBoxSpecial');
-		}	
+		}		
 		
-       }#End  Print RSS and portfiles
+       } #End  Print RSS and portfiles
 
-       $r->print('</blockquote>');
-       $r->print('</div>');
+       
        if ($allowed) {
            if ($env{'form.popup'}) {
                $r->print('<input type="hidden" name="popup" value="'.
@@ -362,7 +369,10 @@
 	# &Apache::lontemplate::send_message($r,$cnum,$cdom);
        $r->print('<p>'.&mt('No personal information provided').'.</p>');
     }
-    
+    if($target ne 'tex'){
+		$r->print('</blockquote>');
+    		$r->print('</div>');	
+	}
 
     if ($env{'request.course.id'}
 	&& &Apache::lonnet::allowed('srm',$env{'request.course.id'})
@@ -374,18 +384,8 @@
 		      &mt('Shared by course faculty and staff').
 		      &Apache::loncommon::help_open_topic("Course_Face_To_Face_Records,Course_Critical_Message").
 		      '<br />');
-	    &Apache::lonmsgdisplay::disfacetoface($r,$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(&mt('Add Records'),$cnum,$cdom));
+	    &Apache::lonmsgdisplay::disfacetoface($r,$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').'\\\\\\\\');
 	    &Apache::lonmsgdisplay::disfacetoface($r,$cnum,$cdom);
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.78 loncom/interface/lonsyllabus.pm:1.79
--- loncom/interface/lonsyllabus.pm:1.78	Thu Feb 19 18:55:53 2009
+++ loncom/interface/lonsyllabus.pm	Fri Feb 20 17:45:40 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.78 2009/02/19 18:55:53 neumanie Exp $
+# $Id: lonsyllabus.pm,v 1.79 2009/02/20 17:45:40 neumanie Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -162,12 +162,15 @@
                text=>"Course syllabus"});
             $r->print(&Apache::lonhtmlcommon::breadcrumbs());
         }
-        $r->print('<h1>'.$courseenv{'description'}.'</h1><h3>'.
-		  &Apache::lonnet::domain($cdom,'description').'</h3>');
+	 $r->print('<div class="LC_ContentBoxSpecial">');
+	$r->print('<h2 class="LC_hcell">'.$courseenv{'description'}.'</h2>'); 
+	$r->print('<blockquote>');       
+	$r->print('<h3>'.  &Apache::lonnet::domain($cdom,'description').'</h3>');
     } else {
 	$r->print('\noindent{\large\textbf{'.$courseenv{'description'}.'}}\\\\\\\\\textbf{'.
 		  &Apache::lonnet::domain($cdom,'description').'}\\\\');
     }
+
 # -------------------------------------------------------- Get course personnel
     my %coursepersonnel=&Apache::lonnet::get_course_adv_roles($cdom.'/'.$cnum);
     if ($target ne 'tex') {
@@ -211,14 +214,6 @@
     } else {
 	$r->print('\end{tabular}\\\\');
     }
-# -------------------------------------------------------------- Announcements?
-    my $day = &Apache::lonannounce::showday(time,2,
-			 &Apache::lonannounce::readcalendar($cdom.'_'.$cnum));
-    if ($target ne 'tex') {	
-	&Apache::lontemplate::print_template($r,'RSS Feeds and Blogs',&Apache::lonrss::advertisefeeds($cnum,$cdom,$forceedit),1,'LC_ContentBoxSpecial');
-    } else {
-	$r->print(&Apache::lonxml::xmlparse($r,'tex',$day));
-    }
 # ---------------------------------------------------------- Load syllabus info
     my %syllabus=&Apache::lonnet::dump('syllabus',$cdom,$cnum);
     my $allowed=0;
@@ -293,39 +288,48 @@
            &Apache::lonnet::put('syllabus',\%syllabus,$cdom,$cnum);
        }
     }
-# ---------------------------------------------------------------- Get syllabus
-    if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {
-       my $lastmod=$syllabus{'uploaded.lastmodified'};
+#----------Print last update
+ my $lastmod=$syllabus{'uploaded.lastmodified'};
        $lastmod=($lastmod?&Apache::lonlocal::locallocaltime($lastmod):&mt('never'));
        my $who = &Apache::loncommon::aboutmewrapper(
                     &Apache::loncommon::plainname($syllabus{'uploaded.name'},
                      $syllabus{'uploaded.domain'}),$syllabus{'uploaded.name'},
-                     $syllabus{'uploaded.domain'});
-       if ($target ne 'tex') {
+                     $syllabus{'uploaded.domain'});      
+ if ($target ne 'tex') {
 	   $r->print('<table><tr><td>'.&mt('Last updated').':</td><td>'.
 		     $lastmod.'</td><td>'.
 		     ($who ? &mt('by').' '.$who
                            : '' ).
-		     '</td></tr></table><p>');
+		     '</td></tr></table>');
        } else {
 	   $r->print('\\\\ '.&mt('Last updated').': '.$lastmod.' '.
 		     ($who? &mt('by').'\\\\ '.
 		            &Apache::loncommon::plainname($syllabus{'uploaded.name'},$syllabus{'uploaded.domain'})
 		          :'')
 		     .'\\\\');
-       }
-     
-	if ($target ne 'tex') {
+       }	
+#--------Functions
+if ($target ne 'tex') {
+		if($allowed || $privileged){		
 		&Apache::lontemplate::print_start_page_functions($r);
-		if($allowed){
-			&Apache::lontemplate::print_functions_content($r,'<a href="'.$r->uri.'?forcestudent=1">'.&mt('Show Public View').'</a>'.
-          											&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView'));	      		
+		if($allowed){ 		
+		&Apache::lontemplate::print_functions_content($r,'<a href="'.$r->uri.'?forcestudent=1">'.&mt('Show Public View').'</a>'.				&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView'));	      		
 		}elsif($privileged){
 			&Apache::lontemplate::print_functions_content($r,'<a href="'.$r->uri.'?forceedit=1">'.&mt('Edit').'</a>'); 
 		}
 		&Apache::lontemplate::print_end_page_functions($r);
-	  }	
-      
+		}
+ }
+# -------------------------------------------------------------- Announcements?
+    my $day = &Apache::lonannounce::showday(time,2,
+			 &Apache::lonannounce::readcalendar($cdom.'_'.$cnum));
+    if ($target ne 'tex') {	
+	&Apache::lontemplate::print_template($r,'RSS Feeds and Blogs',&Apache::lonrss::advertisefeeds($cnum,$cdom,$forceedit),1,'LC_ContentBoxSpecial');
+    } else {
+	$r->print(&Apache::lonxml::xmlparse($r,'tex',$day));
+    }	
+# ---------------------------------------------------------------- Get syllabus
+    if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {     
        if ($allowed) {
 	   $r->print('<form method="post">'.
 		     '<input type="hidden" name="forceedit" value="edit" />');
@@ -336,25 +340,25 @@
 	   if (($syllabus{$field}=~/\w/) || ($allowed)) {
 	       my $message=$syllabus{$field};
 	       if ($field eq 'lll_includeurl') { # this is the "included" field
-		   my $urls=$message;
-		   $message='';
-		   foreach my $filelink (split(/\n/,$urls)) {
+		   my $urls=$message;		
+		   $message='';		  
+		   foreach my $filelink (split(/\n/,$urls)) {			
 		       my $output='';
-# embed style?
-		       my ($curfext)=($filelink=~/\.([^\.]+)$/);
-		       my $embstyle=&Apache::loncommon::fileembstyle($curfext);
-		       if (($embstyle eq 'ssi') || ($curfext=~/\/$/)) {
-# make ssi call and remove everything but the body contents
+			# embed style?
+		       my ($curfext)=($filelink=~/\.([^\.]+)$/);		
+		       my $embstyle=&Apache::loncommon::fileembstyle($curfext);			
+		       if (($embstyle eq 'ssi') || ($curfext=~/\/$/)) {# make ssi call and remove everything but the body contents
 			   $output=&Apache::lonnet::ssi_body($filelink);
-		       } elsif ($embstyle eq 'img') {
-# embed as an image
+		       } elsif ($embstyle eq 'img') {# embed as an image
 			   $output='<img src="'.$filelink.'" />';
 		       }
-		       if ($target ne 'tex') {
-			   $message.='<p>'.$output.'</p>';
-		       } else {
-			   $message.=' '.&Apache::lonxml::xmlparse($r,'tex','<p>'.$output.'</p>').' ';
-		       }      
+		       if($output ne ''){
+		       		if ($target ne 'tex') {				
+			  	 	$message.='<p>'.$output.'</p>';
+		       		} else {
+			   		$message.=' '.&Apache::lonxml::xmlparse($r,'tex','<p>'.$output.'</p>').' ';
+		       		}
+			}     
 		   }
 		   if ($allowed) {
 		       $r->print('<h3>'.$syllabusfields{$field}.
@@ -383,8 +387,9 @@
 	       if ($allowed) {
 			if($target ne 'tex'){
 				$r->print('</p>');
+				&Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field);
 			}
-			&Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field);
+			
 	       }
 	   }
        }    
@@ -393,13 +398,15 @@
 	   $r->print('</form>'.
 		     &Apache::lonhtmlcommon::htmlareaselectactive(@htmlids));
        }
-       if ($target ne 'tex') {$r->print('</p>');} else {$r->print('\\\\');}
+      # if ($target ne 'tex') {$r->print('</p>');} else {$r->print('\\\\');}
     } else {
 	if ($target ne 'tex') {$r->print('<p>');} else {$r->print('\par ');} 
 	$r->print(&mt('No syllabus information provided.'));
 	if ($target ne 'tex') {$r->print('</p>');}
     }
-    if ($target ne 'tex') {
+    if ($target ne 'tex') {	
+	$r->print('</blockquote>');
+    	$r->print('</div>');		
         if ($env{'form.backto'} eq 'coursecatalog') {
             $r->print('<form name="backtocat" method="post" action="/adm/coursecatalog">'.
                       &Apache::lonhtmlcommon::echo_form_input(['backto','courseid']).
Index: loncom/interface/lontemplate.pm
diff -u loncom/interface/lontemplate.pm:1.18 loncom/interface/lontemplate.pm:1.19
--- loncom/interface/lontemplate.pm:1.18	Fri Feb 20 15:09:28 2009
+++ loncom/interface/lontemplate.pm	Fri Feb 20 17:45:40 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "Template" Functions to generate html output
 #
-# $Id: lontemplate.pm,v 1.18 2009/02/20 15:09:28 amueller Exp $
+# $Id: lontemplate.pm,v 1.19 2009/02/20 17:45:40 neumanie Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -58,7 +58,7 @@
 	my ($r,$allowed,$target,$syllabusfields_ref,$syllabus_ref) = @_;
 	my %syllabusfields = %{$syllabusfields_ref};
 	my %syllabus = %{$syllabus_ref};
-	#&start_ContentBox($r,$allowed);
+	
        foreach my $field (sort(keys(%syllabusfields))) {
           if (($syllabus{$field}) || ($allowed)) {
               my $message=$syllabus{$field};
@@ -97,7 +97,7 @@
               }
           }
        }
-	#&end_ContentBox($r);
+	
 }
 
 sub start_ContentBox{
@@ -114,10 +114,8 @@
 sub send_message{
 	my ($r,$cnum,$cdom) = @_;
 	my $s;
-	my $image = qq{<img name="Send message" src="/res/adm/pages/com.png" border="none" />};
-	#$r->print('<div>');
-	$s=&Apache::loncommon::messagewrapper($image,$cnum,$cdom).' '.&Apache::loncommon::messagewrapper(&mt('Send me a message'),$cnum,$cdom);
-	#$r->print('</div>');
+	my $image = qq{<img name="Send message" src="/res/adm/pages/com.png" border="none" />};	
+	$s=&Apache::loncommon::messagewrapper($image,$cnum,$cdom).' '.&Apache::loncommon::messagewrapper(&mt('Send me a message'),$cnum,$cdom);	
 	return $s;
 }
 
@@ -126,7 +124,6 @@
 	my ($r,$topic,$content, $allowed,$boxclass) = @_;	
 	$r->print('<div class="'.$boxclass.'">');	
 	$r->print('<h4 class="LC_hcell">'.$topic.'</h4>');
-#	$r->print('<blockquote>'.$content.'</blockquote>');
 	$r->print('<p>' .$content . '</p>');
 	$r->print('</div>');
 }
@@ -141,14 +138,13 @@
 }
 sub print_start_page_functions
 {
-	my($r)=@_;
-	#TODO add translation for Functions
+	my($r)=@_;	
 	$r->print('<fieldset><legend>'. &mt('Functions') . '</legend>');
 }
 sub print_functions_content
 {
 	my($r,$content) = @_;
-	$r->print($content.'&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp');
+	$r->print('&nbsp'.$content.'&nbsp');
 	
 }
 sub print_end_page_functions
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.68 loncom/interface/lonsimplepage.pm:1.69
--- loncom/interface/lonsimplepage.pm:1.68	Fri Feb 20 15:09:28 2009
+++ loncom/interface/lonsimplepage.pm	Fri Feb 20 17:45:40 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.68 2009/02/20 15:09:28 amueller Exp $
+# $Id: lonsimplepage.pm,v 1.69 2009/02/20 17:45:40 neumanie Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -272,26 +272,28 @@
             }
         }
 	if ($target ne 'tex') {
-		&Apache::lontemplate::print_start_page_functions($r);
-		if($allowed){
-			&Apache::lontemplate::print_functions_content($r,'<a href="'.$r->uri.'?forcestudent=1">'.&mt('Show Student View').'</a>'.
+		if($allowed || $privileged){
+			&Apache::lontemplate::print_start_page_functions($r);
+			if($allowed){
+				&Apache::lontemplate::print_functions_content($r,'<a href="'.$r->uri.'?forcestudent=1">'.&mt('Show Student View').'</a>'.
           											&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView'));	      		
-		}elsif($privileged){
-			my $edittext = &mt('Edit');
-       		 	if ($group ne '') {
-            			$edittext = &mt('Edit Group Homepage');
-        		}
-			&Apache::lontemplate::print_functions_content($r,'<a href="'.$r->uri.'?forceedit=edit'.$refarg.'"><font size="+1">'.$edittext.'</font></a>');
-        		if ($group ne '') {
-            			if ($group_edit_perm) {
-               				 &Apache::lontemplate::print_functions_content($r,'&nbsp;&nbsp;&nbsp;<font size="+1">'.
-               				'<a href="/adm/coursegroups?action=modify&amp;refpage=grouplist'.
-               				'&amp;state=pick_task&amp;groupname='.$group.'">'.
-               				&mt('Edit Group Settings').'</a></font>');
-           			}
-      	 	 	}		    
+			}elsif($privileged){
+				my $edittext = &mt('Edit');
+       		 		if ($group ne '') {
+            				$edittext = &mt('Edit Group Homepage');
+        			}
+				&Apache::lontemplate::print_functions_content($r,'<a href="'.$r->uri.'?forceedit=edit'.$refarg.'">'.$edittext.'</a>');
+        			if ($group ne '') {
+            				if ($group_edit_perm) {
+               				 	&Apache::lontemplate::print_functions_content($r,'&nbsp;&nbsp;&nbsp;'.
+               					'<a href="/adm/coursegroups?action=modify&amp;refpage=grouplist'.
+               					'&amp;state=pick_task&amp;groupname='.$group.'">'.
+               					&mt('Edit Group Settings').'</a>');
+           				}
+      	 	 		}		    
+			}
+			&Apache::lontemplate::print_end_page_functions($r);
 		}
-		&Apache::lontemplate::print_end_page_functions($r);
 	  }	
 	if ($allowed) {
 	    $r->print(
@@ -307,9 +309,6 @@
 	if($allowed){
                $r->print($image.'<div class="clear">&nbsp;</div>');
        }
-#	if(!$allowed){
-#		$r-print($image);
-#	}
 	
 	foreach my $field (sort(keys(%syllabusfields))) {
 	    if (($syllabus{$field}) || ($allowed) || 
@@ -341,8 +340,7 @@
                         $r->print(&Apache::lonxml::xmlparse($r,'tex','<h1>'.$message.'</h1>'));
                     }
                     if ($allowed) {
-                        if ($env{'form.grade_target'} ne 'tex') {
-                            #$r->print('<br /><h3>'.&mt('Title').'</h3>');
+                        if ($env{'form.grade_target'} ne 'tex') {                         
 			    &Apache::lontemplate::print_template($r, &mt('Title'), $message, $allowed, 'LC_ContentBoxSpecial'); 
 			    &Apache::lontemplate::print_editbox_template($r,$syllabus{$field},$field);				
 			    $r->print('</p>');
@@ -351,7 +349,6 @@
                             $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$field},$safeinit));
                         }
                     } 
-#		    if ($allowed) { $r->print($image . '<div class="clear">&nbsp; </div>'); }
 		    if(!$allowed) {$r->print($image); } 
                 } else {
 		    if ($target ne 'tex') {
@@ -376,10 +373,6 @@
 		}
 	    }
 	}
-	#MUEA: Stand hier if???
-#	if(!$allowed){ 
-#		$r->print($image);
-#	}	
 	if ($allowed && ($env{'form.grade_target'} ne 'tex')) {
 	    $r->print(&Apache::lonhtmlcommon::htmlareaselectactive
 		      ('bbb_content').'</form>');

--neumanie1235151940--