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

ehlerst ehlerst@source.lon-capa.org
Wed, 17 Dec 2008 00:44:53 -0000


This is a MIME encoded message

--ehlerst1229474693
Content-Type: text/plain

ehlerst		Wed Dec 17 00:44:53 2008 EDT

  Modified files:              
    /loncom/interface	lontemplate.pm lonaboutme.pm lonsimplepage.pm 
                     	lonsyllabus.pm 
  Log:
  minor layout changes in the edit view of the listed files.
  added an additional "Show Public View" link at the bottom of lonaboutme.pm.
  
  
--ehlerst1229474693
Content-Type: text/plain
Content-Disposition: attachment; filename="ehlerst-20081217004453.txt"

Index: loncom/interface/lontemplate.pm
diff -u loncom/interface/lontemplate.pm:1.9 loncom/interface/lontemplate.pm:1.10
--- loncom/interface/lontemplate.pm:1.9	Tue Dec 16 10:41:02 2008
+++ loncom/interface/lontemplate.pm	Wed Dec 17 00:44:53 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "Template" Functions to generate html output
 #
-# $Id: lontemplate.pm,v 1.9 2008/12/16 10:41:02 ehlerst Exp $
+# $Id: lontemplate.pm,v 1.10 2008/12/17 00:44:53 ehlerst 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};
-	$r->print('<div class="ContentBox">');
+	&start_ContentBox($r,$allowed);
        foreach my $field (sort(keys(%syllabusfields))) {
           if (($syllabus{$field}) || ($allowed)) {
               my $message=$syllabus{$field};
@@ -70,21 +70,23 @@
               }
               $message=&Apache::lontexconvert::msgtexconverted($message);
               if ($target ne 'tex') {
-                                
-               &print_template($r,$syllabusfields{$field},$message);
-                                
-                                
-                                
+		     if($allowed){
+			$r->print('<p>');
+		     }
+		     &print_template($r,$syllabusfields{$field},$message,$allowed);
               } 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>');
+		}
               }
           }
        }
-		$r->print('</div>');
+	&end_ContentBox($r);
 }
 
 sub start_ContentBox{
@@ -125,7 +127,7 @@
 sub print_editbox_template
 {
 	my ($r,$content,$field) = @_;
-	$r->print('<br /><textarea cols="80" rows="6" name="'.$field.'">'.
+	$r->print('<textarea cols="81" rows="6" name="'.$field.'">'.
                            &HTML::Entities::encode($content,'"&<>').
            '</textarea><input type="submit" name="storesyl" value="'.
                            &mt('Save All').'" />');
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.86 loncom/interface/lonaboutme.pm:1.87
--- loncom/interface/lonaboutme.pm:1.86	Tue Dec 16 09:22:14 2008
+++ loncom/interface/lonaboutme.pm	Wed Dec 17 00:44:53 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "About Me" Personal Information
 #
-# $Id: lonaboutme.pm,v 1.86 2008/12/16 09:22:14 schualex Exp $
+# $Id: lonaboutme.pm,v 1.87 2008/12/17 00:44:53 ehlerst Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -230,16 +230,16 @@
        my $privleged=$allowed=(($env{'user.name'} eq $cnum) && 
 			       ($env{'user.domain'} eq $cdom));
        if ($forcestudent or $target eq 'tex') { $allowed=0; }
- 
+	my $query_string; 
        if ($allowed) {
-           my $query_string = &build_query_string({'forcestudent' => '1','popup' => $env{'form.popup'}});
+           $query_string = &build_query_string({'forcestudent' => '1','popup' => $env{'form.popup'}});
 	   $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',&mt('Help with filling in text boxes')).'</p><p><a href="'.$r->uri.$query_string.'">'.&mt('Show Public View').'</a>'.
-		     &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');
+		     '</p><p><a href="'.$r->uri.$query_string.'">'.&mt('Show Public View').'</a>'.
+                     &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>'.
+		     &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).'</p>');
        } elsif ($privleged && $target ne 'tex') {
-           my $query_string = &build_query_string({'forceedit' => '1','popup' => $env{'form.popup'}});
+           $query_string = &build_query_string({'forceedit' => '1','popup' => $env{'form.popup'}});
 	   $r->print('<p><a href="'.$r->uri.$query_string.'">'.
 		     &mt('Edit').'</a></p>');
        }
@@ -280,7 +280,7 @@
     if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {
        $lastmod=$syllabus{'uploaded.lastmodified'};
        $lastmod=($lastmod?&Apache::lonlocal::locallocaltime($lastmod):&mt('never'));
-       # $r->print(&mt('Last updated').': '.$lastmod); #Old Last Modifi Pos
+	 $r->print('<br />'.&mt('Last updated').': '.$lastmod);
        if ($syllabus{'uploaded.photourl'}) {
 	   &Apache::lonnet::allowuploaded('/adm/aboutme',
 					  $syllabus{'uploaded.photourl'});
@@ -316,6 +316,7 @@
 		&Apache::lontemplate::send_message($r,$cnum,$cdom);
 		&Apache::lontemplate::end_ContentBox($r);
 		&Apache::lontemplate::end_columnSection($r);
+
 		&Apache::lontemplate::start_columnSection($r);
 		&Apache::lontemplate::start_ContentBox($r);
 		&print_portfiles_link($r,$is_course);
@@ -327,8 +328,11 @@
 		}
 		&Apache::lontemplate::end_ContentBox($r);
 		&Apache::lontemplate::end_columnSection($r);
+		if($allowed){
+			$r->print('<p><a href="'.$r->uri.$query_string.'">'.&mt('Show Public View').'</a>'.
+                        	&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');
+		}
        }
-
        if ($allowed) {
            if ($env{'form.popup'}) {
                $r->print('<input type="hidden" name="popup" value="'.
@@ -377,7 +381,6 @@
         if ($env{'form.popup'}) {
             $r->print('<p><a href="javascript:window.close()">'.&mt('Close window').'</a>');
         }
-	$r->print('<br />'.&mt('Last updated').': '.$lastmod);
 	$r->print(&Apache::loncommon::end_page());
     } else {
 	$r->print('\end{document}');
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.60 loncom/interface/lonsimplepage.pm:1.61
--- loncom/interface/lonsimplepage.pm:1.60	Tue Dec 16 19:01:45 2008
+++ loncom/interface/lonsimplepage.pm	Wed Dec 17 00:44:53 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.60 2008/12/16 19:01:45 ehlerst Exp $
+# $Id: lonsimplepage.pm,v 1.61 2008/12/17 00:44:53 ehlerst Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -221,9 +221,6 @@
                   &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').
 		  &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes'))
  		 .'</p>');                
-#		 .'<br /><a href="'.$r->uri.'?forcestudent=1'.$refarg.'">'
- #                .'<font size="+1">'.&mt('Show Student View').'</font></a>'.
-#		  &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');
     } elsif ($privileged and $target ne 'tex') {
         my $edittext = &mt('Edit');
         if ($group ne '') {
@@ -298,7 +295,6 @@
 	&Apache::lontemplate::start_columnSection($r);
 	if($allowed){
                 $r->print($image.'<div class="clear">&nbsp;</div>');
-#'<br style="clear: both;" />');
         }
 	&Apache::lontemplate::start_ContentBox($r,$allowed);
 	foreach my $field (sort(keys(%syllabusfields))) {
@@ -322,6 +318,9 @@
                     $r->print('<br />');
                 } elsif ($field eq 'aaa_title') {
                     if ($target ne 'tex') {
+			if($allowed){
+				$r->print('<p>');
+			}
                         $r->print('<h1>'.$message.'</h1>');
                     } else {
                         my $safeinit;
@@ -331,6 +330,7 @@
                         if ($env{'form.grade_target'} ne 'tex') {
                             $r->print('<br /><h3>'.&mt('Title').'</h3>');
 			    &Apache::lontemplate::print_editbox_template($r,$syllabus{$field},$field);				
+			    $r->print('</p>');
                         } else {
                             my $safeinit;
                             $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$field},$safeinit));
@@ -338,6 +338,9 @@
                     }
                 } else {
 		    if ($target ne 'tex') {
+			if($allowed){
+				$r->print('<p>');
+			}	
 			&Apache::lontemplate::print_template($r,$syllabusfields{$field},$message,$allowed);
 		    } else {
 			my $safeinit;
@@ -347,6 +350,7 @@
 		    if ($allowed) {
 			if ($target ne 'tex') {
 			    &Apache::lontemplate::print_editbox_template($r,$syllabus{$field},$field);
+			    $r->print('</p>');
 			} else {
 			    my $safeinit;
 			    $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$field},$safeinit));
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.73 loncom/interface/lonsyllabus.pm:1.74
--- loncom/interface/lonsyllabus.pm:1.73	Tue Dec 16 20:00:11 2008
+++ loncom/interface/lonsyllabus.pm	Wed Dec 17 00:44:53 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.73 2008/12/16 20:00:11 ehlerst Exp $
+# $Id: lonsyllabus.pm,v 1.74 2008/12/17 00:44:53 ehlerst Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -367,8 +367,10 @@
 		   }
 		   $message=&Apache::lontexconvert::msgtexconverted($message);
 		   if ($target ne 'tex') {
+			if($allowed){
+				$r->print('<p>');
+			}
 			&Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message);
-
 		   } else {
 		       $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'.
 				 &Apache::lonxml::xmlparse($r,'tex',$message).'\\\\');
@@ -376,7 +378,10 @@
 		   push(@htmlids,$field);
 	       }
 	       if ($allowed) {
-		&Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field);
+			if($target ne 'tex'){
+				$r->print('</p>');
+			}
+			&Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field);
 	       }
 	   }
        }

--ehlerst1229474693--