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

neumanie neumanie@source.lon-capa.org
Thu, 19 Feb 2009 17:32:39 -0000


This is a MIME encoded message

--neumanie1235064759
Content-Type: text/plain

neumanie		Thu Feb 19 17:32:39 2009 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm lontemplate.pm lonsyllabus.pm 
                     	lonsimplepage.pm 
  Log:
  Add a html fildset for site functions in lonaboutme,sylabus,simplepage.The functions are eg. show public view, edit,send message,.. . 
  
  
--neumanie1235064759
Content-Type: text/plain
Content-Disposition: attachment; filename="neumanie-20090219173239.txt"

Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.98 loncom/interface/lonaboutme.pm:1.99
--- loncom/interface/lonaboutme.pm:1.98	Thu Feb 19 12:10:44 2009
+++ loncom/interface/lonaboutme.pm	Thu Feb 19 17:32:39 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Personal Information Page
 #
-# $Id: lonaboutme.pm,v 1.98 2009/02/19 12:10:44 weissno Exp $
+# $Id: lonaboutme.pm,v 1.99 2009/02/19 17:32:39 neumanie Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -234,18 +234,14 @@
 			       ($env{'user.domain'} eq $cdom));
        if ($forcestudent or $target eq 'tex') { $allowed=0; }
 	my $query_string; 
+	
        if ($allowed) {
-           $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><p><a href="'.$r->uri.$query_string.'">'.&mt('Show Public View').'</a>'.
-                     &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</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.'). '</p><p>'.              
 		     &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).'</p>');
-       } elsif ($privleged && $target ne 'tex') {
-           $query_string = &build_query_string({'forceedit' => '1','popup' => $env{'form.popup'}});
-	   $r->print('<p><a href="'.$r->uri.$query_string.'">'.
-		     &mt('Edit').'</a></p>');
-       }
+       }     
+	
       if (($env{'form.uploaddoc.filename'}) &&
           ($env{'form.storeupl'}) && ($allowed)) {
  	  if ($env{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {
@@ -284,6 +280,8 @@
        $lastmod=$syllabus{'uploaded.lastmodified'};
        $lastmod=($lastmod?&Apache::lonlocal::locallocaltime($lastmod):&mt('never'));
  	$r->print('<br />'.&mt('Last updated').': '.$lastmod);
+
+
        if ($syllabus{'uploaded.photourl'}) {
 	   &Apache::lonnet::allowuploaded('/adm/aboutme',
 					  $syllabus{'uploaded.photourl'});
@@ -299,6 +297,18 @@
 	   }
 	
        }
+	if( $target ne 'tex'){
+		 &Apache::lontemplate::print_start_page_functions($r);
+      		if($allowed){
+			 $query_string = &build_query_string({'forcestudent' => '1','popup' => $env{'form.popup'}});		
+			&Apache::lontemplate::print_functions_content($r,'<a href="'.$r->uri.$query_string.'">'.&mt('Show Public View').'</a>'.&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView'));
+    		 }elsif($privleged){
+			$query_string = &build_query_string({'forceedit' => '1','popup' => $env{'form.popup'}});
+			 &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 ($allowed) {
            $r->print(
 	 '<form method="post" enctype="multipart/form-data">'.
@@ -318,7 +328,7 @@
 	 if($target ne 'tex') #print Image
      	 {	
 		&Apache::lontemplate::start_ContentBox($r);		
-		&Apache::lontemplate::send_message($r,$cnum,$cdom);
+		#&Apache::lontemplate::send_message($r,$cnum,$cdom);
 		&Apache::lontemplate::end_ContentBox($r);
 		$r->print($image);		
 		
@@ -337,12 +347,8 @@
 			$r->print('<h4 class="LC_hcell">'.'RSS Feeds and Blogs'.'</h4>');
 			$r->print(&Apache::lonrss::advertisefeeds($cnum,$cdom));
 			$r->print('</div>');
-		}		
+		}	
 		
-		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>');
-		}
        }#End  Print RSS and portfiles
 
        $r->print('</blockquote>');
@@ -356,7 +362,7 @@
        }
        if ($target ne 'tex') {$r->print('<br />');} else {$r->print('\\\\');}
     } else {
-	 &Apache::lontemplate::send_message($r,$cnum,$cdom);
+	# &Apache::lontemplate::send_message($r,$cnum,$cdom);
        $r->print('<p>'.&mt('No personal information provided').'.</p>');
     }
     
Index: loncom/interface/lontemplate.pm
diff -u loncom/interface/lontemplate.pm:1.16 loncom/interface/lontemplate.pm:1.17
--- loncom/interface/lontemplate.pm:1.16	Fri Feb 13 18:56:13 2009
+++ loncom/interface/lontemplate.pm	Thu Feb 19 17:32:39 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "Template" Functions to generate html output
 #
-# $Id: lontemplate.pm,v 1.16 2009/02/13 18:56:13 neumanie Exp $
+# $Id: lontemplate.pm,v 1.17 2009/02/19 17:32:39 neumanie Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -113,10 +113,12 @@
 
 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>');
-	$r->print(&Apache::loncommon::messagewrapper($image,$cnum,$cdom).' '.&Apache::loncommon::messagewrapper(&mt('Send me a message'),$cnum,$cdom));
-	$r->print('</div>');
+	#$r->print('<div>');
+	$s=&Apache::loncommon::messagewrapper($image,$cnum,$cdom).' '.&Apache::loncommon::messagewrapper(&mt('Send me a message'),$cnum,$cdom);
+	#$r->print('</div>');
+	return $s;
 }
 
 sub print_template
@@ -136,5 +138,20 @@
            '</textarea><br /><input type="submit" name="storesyl" value="'.
                            &mt('Save All').'" />');
 }
-
+sub print_start_page_functions
+{
+	my($r)=@_;
+	#TODO add translation for Functions
+	$r->print('<fieldset><legend>Functions</legend>');
+}
+sub print_functions_content
+{
+	my($r,$content) = @_;
+	$r->print($content.'&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp');
+}
+sub print_end_page_functions
+{
+	my($r)=@_;
+	$r->print('</fieldset>');
+}
 1;
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.76 loncom/interface/lonsyllabus.pm:1.77
--- loncom/interface/lonsyllabus.pm:1.76	Fri Feb 13 17:26:55 2009
+++ loncom/interface/lonsyllabus.pm	Thu Feb 19 17:32:39 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.76 2009/02/13 17:26:55 neumanie Exp $
+# $Id: lonsyllabus.pm,v 1.77 2009/02/19 17:32:39 neumanie Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -242,21 +242,12 @@
        if ($allowed) {
           my $protocol = $Apache::lonnet::protocol{$homeserver};
           $protocol = 'http' if ($protocol ne 'https');
-          $r->print('<p><a href="'.$r->uri.'?forcestudent=1"><font size="+1">'.
-&mt('Show Public View').'</font></a>'.
-          &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').
-          '</p><p>'.
-&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).'</p><p>'.&mt('This syllabus can be publicly viewed at')
+          $r->print('<p>'.&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).'</p><p>'.&mt('This syllabus can be publicly viewed at')
 		    .' <tt>'.$protocol.'://'.
 		    &Apache::lonnet::hostname($homeserver).$r->uri.'</tt>'.
                &Apache::loncommon::help_open_topic('Syllabus_ExtLink').'</p>'.
           '<p>'.&mt('You can specify an external URL as Syllabus in the [_1].','<a href="/adm/parmset?action=crsenv">'.&mt('Course Parameters').'</a>').'</p>');
-      } elsif ($privileged) {
-	  if ($target ne 'tex') {
-	      $r->print('<p><a href="'.$r->uri.'?forceedit=1"><font size="+1">'.
-			&mt('Edit').'</font></a>'); 
-	  }
-      }
+      } 
        if (($allowed) && ($env{'form.storesyl'})) {
 	   foreach my $syl_field (keys(%syllabusfields)) {
                my $field=$env{'form.'.$syl_field};
@@ -324,13 +315,24 @@
 		          :'')
 		     .'\\\\');
        }
+     
+	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 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);
+	  }	
+      
        if ($allowed) {
 	   $r->print('<form method="post">'.
 		     '<input type="hidden" name="forceedit" value="edit" />');
        }
        my @htmlids=();
-	#&Apache::lontemplate::start_columnSection($r);
-	#&Apache::lontemplate::start_ContentBox($r, $allowed);
+	
 	foreach my $field (sort(keys(%syllabusfields))) {
 	   if (($syllabus{$field}=~/\w/) || ($allowed)) {
 	       my $message=$syllabus{$field};
@@ -386,13 +388,8 @@
 			&Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field);
 	       }
 	   }
-       }
-        if ($allowed) {
-                $r->print('<p><a href="'.$r->uri.'?forcestudent=1"><font size="+1">'.&mt('Show Public View').'</font></a>'.
-                                 &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');
-        }
-	#&Apache::lontemplate::end_ContentBox($r);
-	#&Apache::lontemplate::end_columnSection($r);
+       }    
+	
        if ($allowed) {
 	   $r->print('</form>'.
 		     &Apache::lonhtmlcommon::htmlareaselectactive(@htmlids));
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.66 loncom/interface/lonsimplepage.pm:1.67
--- loncom/interface/lonsimplepage.pm:1.66	Mon Feb 16 10:33:32 2009
+++ loncom/interface/lonsimplepage.pm	Thu Feb 19 17:32:39 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.66 2009/02/16 10:33:32 biermanm Exp $
+# $Id: lonsimplepage.pm,v 1.67 2009/02/19 17:32:39 neumanie Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -216,25 +216,7 @@
     if ($forcestudent or $target eq 'tex') { $allowed=0; }
 
     if ($allowed) {
-	$r->print('<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').
-		  &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes'))
- 		 .'</p>');                
-    } elsif ($privileged and $target ne 'tex') {
-        my $edittext = &mt('Edit');
-        if ($group ne '') {
-            $edittext = &mt('Edit Group Homepage');
-        }
-	$r->print('<a href="'.$r->uri.'?forceedit=edit'.$refarg.'"><font size="+1">'.$edittext.'</font></a>');
-        if ($group ne '') {
-            if ($group_edit_perm) {
-                $r->print('&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>');
-            }
-        }    
+	$r->print('<p>'.&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')) .'</p>');             
     } 
     if (($env{'form.uploaddoc.filename'} and $target ne 'tex') &&
 	($env{'form.storeupl'}) && ($allowed)) {
@@ -289,6 +271,28 @@
 		$image=&Apache::lonxml::xmlparse($r,'tex',$image);
             }
         }
+	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>'.
+          											&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>');
+           			}
+      	 	 	}		    
+		}
+		&Apache::lontemplate::print_end_page_functions($r);
+	  }	
 	if ($allowed) {
 	    $r->print(
 		      '<form method="post" enctype="multipart/form-data">'.
@@ -369,13 +373,7 @@
 	
 	if(!$allowed){
 		$r->print($image);
-	}
-	
-	if ($allowed) {
-                $r->print('<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>');
-        }
+	}	
 	if ($allowed && ($env{'form.grade_target'} ne 'tex')) {
 	    $r->print(&Apache::lonhtmlcommon::htmlareaselectactive
 		      ('bbb_content').'</form>');

--neumanie1235064759--