[LON-CAPA-cvs] cvs: loncom(GCI_2) /interface lonpreferences.pm

gci gci@source.lon-capa.org
Wed, 23 Sep 2009 15:12:54 -0000


This is a MIME encoded message

--gci1253718774
Content-Type: text/plain

gci		Wed Sep 23 15:12:54 2009 EDT

  Modified files:              (Branch: GCI_2)
    /loncom/interface	lonpreferences.pm 
  Log:
  - lonpreferences.pm for GCI_2 updated to 2.9.X
  - Backport 1.129, 1.130, 1.131, 1.132, 1.134, 1.135, 1.136, 1.137, 1.139, 1.140, 1.141, 1.142, 1.143, 1.146, 1.149, 1.151, 1.152, 1.153, 1.154, 1.155, 1.157, 1.158 1.159, 1.160, 1.162, 1.163, 1.164, 1.168, 1.170, 1.171
  
  
--gci1253718774
Content-Type: text/plain
Content-Disposition: attachment; filename="gci-20090923151254.txt"

Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.125 loncom/interface/lonpreferences.pm:1.125.8.1
--- loncom/interface/lonpreferences.pm:1.125	Fri Jul 18 12:36:11 2008
+++ loncom/interface/lonpreferences.pm	Wed Sep 23 15:12:54 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.125 2008/07/18 12:36:11 raeburn Exp $
+# $Id: lonpreferences.pm,v 1.125.8.1 2009/09/23 15:12:54 gci Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -120,7 +120,7 @@
 <label><input type="radio" name="wysiwyg" value="off" $onselect /> $switchoff</label><br />
 <label><input type="radio" name="wysiwyg" value="on" $offselect /> $switchon</label>
 ENDLSCREEN
-    $r->print('<br /><input type="submit" value="'.&mt('Change').'" />');
+    $r->print('<br /><input type="submit" value="'.&mt('Save').'" />');
 }
 
 
@@ -129,7 +129,11 @@
     my $newsetting=$env{'form.wysiwyg'};
     &Apache::lonnet::put('environment',{'wysiwygeditor' => $newsetting});
     &Apache::lonnet::appenv({'environment.wysiwygeditor' => $newsetting});
-    $r->print('<p>'.&mt('Setting WYSIWYG editor to:').' '.&mt($newsetting).'</p>');
+    my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('WYSIWYG Editor').'</i>','<tt>'.&mt($newsetting).'</tt>'));
+    $message=&Apache::loncommon::confirmwrapper($message);
+    $r->print(<<ENDVCSCREEN);
+$message
+ENDVCSCREEN
 }
 
 ################################################################
@@ -158,7 +162,7 @@
 <input type="hidden" name="action" value="verify_and_change_languages" />
 <br />$pref: $selectionbox
 ENDLSCREEN
-    $r->print('<br /><input type="submit" value="'.&mt('Change').'" />');
+    $r->print('<br /><input type="submit" value="'.&mt('Save').'" />');
 }
 
 
@@ -173,12 +177,14 @@
     if ($newlanguage) {
         &Apache::lonnet::put('environment',{'languages' => $newlanguage});
         &Apache::lonnet::appenv({'environment.languages' => $newlanguage});
-        $message=&mt('Set new preferred languages to ').'<tt>"'.$newlanguage.'"</tt>.';
+        $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Preferred language').'</i>','<tt>"'.$newlanguage.'"</tt>.'));
     } else {
         &Apache::lonnet::del('environment',['languages']);
-        &Apache::lonnet::delenv('environment\.languages');
-        $message=&mt('Reset preferred language.');
+        &Apache::lonnet::delenv('environment.languages');
+        $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]','<i>'.&mt('Preferred language').'</i>'));
     }
+    $message=&Apache::loncommon::confirmwrapper($message);
+    &Apache::loncommon::flush_langs_cache($user,$domain);
     $r->print(<<ENDVCSCREEN);
 $message
 ENDVCSCREEN
@@ -198,7 +204,8 @@
 		     'tth' => 'tth (TeX to HTML)',
 		     #'ttm' => 'TeX to MathML',
 		     'jsMath' => 'jsMath',
-		     'mimetex' => 'mimetex (Convert to Images)'
+		     'mimetex' => 'mimetex (Convert to Images)',
+                     'raw' => 'Raw (Screen Reader)'
                      );
     my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine',
 						     %mathchoices);
@@ -206,20 +213,36 @@
     my %lt=&Apache::lonlocal::texthash(
       'headline' => 'Change Math Preferences',
       'preftxt'  => 'Preferred method to display Math',
-      'change'   => 'Change',
+      'change'   => 'Save',
       'exmpl'    => 'Examples',
       'jsmath'   => 'jsMath:',
       'tth'      => 'tth (TeX to HTML):',
       'mimetex'  => 'mimetex (Convert to Images):',
     );
 
+    my $jsMathWarning='<p>'
+                     .'<div class="LC_warning">'
+                     .&mt("It looks like you don't have the TeX math fonts installed.")
+                     .'</div>'
+                     .'<div>'
+                     .&mt('The jsMath example on this page may not look right without them. '
+                         .'The [_1]jsMath Home Page[_2] has information on how to download the '
+                         .'needed fonts. In the meantime, jsMath will do the best it can '
+                         .'with the fonts you have, but it may not be pretty and some equations '
+                         .'may not be rendered correctly.'
+                         ,'<a href="http://www.math.union.edu/locate/jsMath/" target="_blank">'
+                         ,'</a>')
+                     .'</div>'
+                     .'</p>';
+
     $r->print(<<ENDLSCREEN);
 <h2>$lt{'headline'}</h2>
 <form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_texengine" />
 <p>
-$lt{'preftxt'}:<br />
-$selectionbox <input type="submit" value="$lt{'change'}" />
+$lt{'preftxt'}: $selectionbox
+<br />
+<input type="submit" value="$lt{'change'}" />
 </p>
 </form>
 <br />
@@ -231,18 +254,7 @@
 $jsMath_start
 <script type="text/javascript">
 if (jsMath.nofonts == 1) {
-    document.writeln
-        ('<div style="padding: 10; border-style: solid; border-width:3;'
-	 +' border-color: #DD0000; background-color: #FFF8F8; width: 75%; text-align: left">'
-	 +'<small><font color="#AA0000"><b>Warning:</b> '
-	 +'It looks like you don\\\'t have the TeX math fonts installed. '
-	 +'The jsMath example on this page may not look right without them. '
-	 +'The <a href="http://www.math.union.edu/locate/jsMath/" target="_blank"> '
-	 +'jsMath Home Page</a> has information on how to download the '
-	 +'needed fonts.  In the meantime, jsMath will do the best it can '
-	 +'with the fonts you have, but it may not be pretty and some equations '
-	 +'may not be rendered correctly. '
-	 +'</font></small></div>');
+    document.writeln($jsMathWarning);
 }
 </script>
 <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=jsMath" width="400" height="120"></iframe>
@@ -282,14 +294,13 @@
     if ($newtexengine) {
         &Apache::lonnet::put('environment',{'texengine' => $newtexengine});
         &Apache::lonnet::appenv({'environment.texengine' => $newtexengine});
-        $message=&mt('Set new preferred math display to ').'<tt>"'.$newtexengine.'"</tt>.';
+        $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Preferred method to display Math').'</i>','<tt>"'.$newtexengine.'"</tt>'));
     } else {
         &Apache::lonnet::del('environment',['texengine']);
-        &Apache::lonnet::delenv('environment\.texengine');
-        $message=&mt('Reset preferred math display.');
+        &Apache::lonnet::delenv('environment.texengine');
+        $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]','<i>'.&mt('Preferred method to display Math').'</i>'));
     }
-
-
+    $message=&Apache::loncommon::confirmwrapper($message);
     $r->print(<<ENDVCSCREEN);
 $message
 ENDVCSCREEN
@@ -310,7 +321,7 @@
     my $hotlist_n=$userenv{'recentrolesn'};
     my $checked;
     if ($hotlist_flag) {
-	$checked = 'checked="checked"';
+	$checked = ' checked="checked"';
     }
     
     if (!$hotlist_n) { $hotlist_n=3; }
@@ -345,13 +356,13 @@
             my $checked = "";
             my $value = $recent_roles{$role_key};
             if ($frozen_roles{$role_key}) {
-                $checked = "checked=\"checked\"";
+                $checked = ' checked="checked"';
             }
 	    $count++;
             $roles_check_list .=
 		&Apache::loncommon::start_data_table_row().
 		'<td class="LC_table_cell_checkbox">'.
-		"<input type=\"checkbox\" $checked name=\"freezeroles\"".
+		"<input type=\"checkbox\"$checked name=\"freezeroles\"".
 		" id=\"freezeroles$count\" value=\"$role_key\" /></td>".
 		"<td><label for=\"freezeroles$count\">".
 		"$role_text{$role_key}</label></td>".
@@ -363,10 +374,10 @@
     $r->print('
 <p>'.&mt('Some LON-CAPA users have a long list of '.$lc_role.'s. The Recent '.$role.'s Hotlist feature keeps track of the last N '.$lc_role.'s which have been visited and places a table of these at the top of the '.$lc_role.'s page. People with very few '.$lc_role.'s should leave this feature disabled.').'
 </p>
-<form name="prefs" action="/adm/preferences" method="POST">
+<form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_rolespref" />
 <br /><label>'.&mt('Enable Recent '.$role.'s Hotlist:').'
-<input type="checkbox" '.$checked.' name="recentroles" value="true" /></label>
+<input type="checkbox"'.$checked.' name="recentroles" value="true" /></label>
 <br />'.&mt('Number of '.$role.'s in Hotlist:').'
 <select name="recentrolesn" size="1">
 '.$options.'
@@ -375,7 +386,7 @@
 </p>
 '.$roles_check_list.'
 <br />
-<input type="submit" value="'.&mt('Change').'" />
+<input type="submit" value="'.&mt('Save').'" />
 </form>');
 }
 
@@ -424,7 +435,7 @@
         $message=&mt('Recent '.$role.'s Hotlist is Enabled');
     } else {
         &Apache::lonnet::del('environment',['recentroles']);
-        &Apache::lonnet::delenv('environment\.recentroles');
+        &Apache::lonnet::delenv('environment.recentroles');
         $message=&mt('Recent '.$role.'s Hotlist is Disabled');
     }
     if ($hotlist_n) {
@@ -454,7 +465,7 @@
 # Unset any roles that were previously frozen but aren't in list
     foreach my $role_key (sort(keys(%recent_roles))) {
         if (($frozen_roles{$role_key}) && (!exists($freeze{$role_key}))) {
-	    $message .= "<br />".&mt('Unfreezing '.$role.': [_1]',$role_text{$role_key})."\n";
+            $message .= "<br />".&Apache::lonhtmlcommon::confirm_success(&mt('Unfreezing '.$role.': [_1]','<i>'.$role_text{$role_key}.'</i>'));
 	    &Apache::lonhtmlcommon::store_recent('roles',$role_key,' ',0);
         }
     }
@@ -462,13 +473,13 @@
 # Freeze selected roles
     foreach my $role_key (@freeze_list) {
         if (!$frozen_roles{$role_key}) {
-             $message .= "<br />".&mt('Freezing '.$role.': [_1]',$role_text{$role_key})."\n";
+             $message .= "<br />".
+             &Apache::lonhtmlcommon::confirm_success(&mt('Freezing '.$role.': [_1]','<i>'.$role_text{$role_key}.'</i>'));
              &Apache::lonhtmlcommon::store_recent('roles',
                                           $role_key,' ',1);
         }
     }
-    $message .= "<hr /><br />\n";
-
+    $message=&Apache::loncommon::confirmwrapper($message);
     $r->print(<<ENDRPSCREEN);
 $message
 ENDRPSCREEN
@@ -487,22 +498,25 @@
         ('environment',['screenname','nickname']);
     my $screenname=$userenv{'screenname'};
     my $nickname=$userenv{'nickname'};
-    my %lt = &Apache::lonlocal::texthash(
-                                          text_screenname  => 'New screenname (shown if you post anonymously):',
-                                          text_nickname  => 'New nickname (shown if you post non-anonymously):',
-                                          text_submit => 'Change',
-                                        );
-    $r->print(<<ENDSCREEN);
-<form name="prefs" action="/adm/preferences" method="post">
-<input type="hidden" name="action" value="verify_and_change_screenname" />
-<br />$lt{'text_screenname'}
-<input type="text" size="20" value="$screenname" name="screenname" />
-<br />$lt{'text_nickname'}
-<input type="text" size="20" value="$nickname" name="nickname" />
-<br />
-<input type="submit" value="$lt{'text_submit'}" />
-</form>
-ENDSCREEN
+    $r->print('<p>'
+             .&mt('Change the name that is displayed in your posts.')
+             .'</p>'
+    );
+    $r->print('<form name="prefs" action="/adm/preferences" method="post">'
+             .'<input type="hidden" name="action" value="verify_and_change_screenname" />'
+             .&Apache::lonhtmlcommon::start_pick_box()
+             .&Apache::lonhtmlcommon::row_title(&mt('New screenname (shown if you post anonymously)'))
+             .'<input type="text" size="20" value="'.$screenname.'" name="screenname" />'
+             .&Apache::lonhtmlcommon::row_closure()
+             .&Apache::lonhtmlcommon::row_title(&mt('New nickname (shown if you post non-anonymously)'))
+             .'<input type="text" size="20" value="'.$nickname.'" name="nickname" />'
+             .&Apache::lonhtmlcommon::row_closure()
+             .&Apache::lonhtmlcommon::row_title()
+             .'<input type="submit" value="'.&mt('Save').'" />'
+             .&Apache::lonhtmlcommon::row_closure(1)
+             .&Apache::lonhtmlcommon::end_pick_box()
+             .'</form>'
+    );
 }
 
 sub verify_and_change_screenname {
@@ -516,11 +530,11 @@
     if ($newscreen) {
         &Apache::lonnet::put('environment',{'screenname' => $newscreen});
         &Apache::lonnet::appenv({'environment.screenname' => $newscreen});
-        $message=&mt('Set new screenname to ').'<tt>"'.$newscreen.'."</tt>.';
+        $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Screenname').'</i>','<tt>"'.$newscreen.'"</tt>'));
     } else {
         &Apache::lonnet::del('environment',['screenname']);
-        &Apache::lonnet::delenv('environment\.screenname');
-        $message=&mt('Reset screenname.');
+        &Apache::lonnet::delenv('environment.screenname');
+        $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]','<i>'.&mt('Screenname').'</i>'));
     }
 # Nickname
     $message.='<br />';
@@ -529,13 +543,14 @@
     if ($newscreen) {
         &Apache::lonnet::put('environment',{'nickname' => $newscreen});
         &Apache::lonnet::appenv({'environment.nickname' => $newscreen});
-        $message.=&mt('Set new nickname to ').'<tt>"'.$newscreen.'"</tt>.';
+        $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Nickname').'</i>','<tt>"'.$newscreen.'"</tt>'));
     } else {
         &Apache::lonnet::del('environment',['nickname']);
-        &Apache::lonnet::delenv('environment\.nickname');
-        $message.=&mt('Reset nickname.');
+        &Apache::lonnet::delenv('environment.nickname');
+        $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]','<i>'.&mt('Nickname').'</i>'));
     }
     &Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain);
+    $message=&Apache::loncommon::confirmwrapper($message);
     $r->print(<<ENDVCSCREEN);
 $message
 ENDVCSCREEN
@@ -564,7 +579,7 @@
     my $useicons=&mt('Use icons and text');
     my $usebuttons=&mt('Use buttons and text');
     my $useicononly=&mt('Use icons only');
-    my $change=&mt('Change');
+    my $change=&mt('Save');
     $r->print(<<ENDSCREEN);
 <form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_icons" />
@@ -584,7 +599,11 @@
 
     &Apache::lonnet::put('environment',{'icons' => $newicons});
     &Apache::lonnet::appenv({'environment.icons' => $newicons});
-    $r->print(&mt('Set menu mode to [_1].',$newicons));
+    my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Menu Display').'</i>','<tt>'.$newicons.'</tt>'));
+    $message=&Apache::loncommon::confirmwrapper($message);
+    $r->print(<<ENDVCSCREEN);
+$message
+ENDVCSCREEN
 }
 
 ################################################################
@@ -605,9 +624,10 @@
     $r->print(<<ENDSCREEN);
 <form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_clicker" />
-<label>$text $helplink<br />
+<label>$helplink<br /><br />$text<br />
 <textarea name="clickers" rows="5" cols="20">$clickers</textarea>
 </label>
+<br />
 <input type="submit" value="$change" />
 </form>
 ENDSCREEN
@@ -626,7 +646,11 @@
     $newclickers=~s/\,$//;
     &Apache::lonnet::put('environment',{'clickers' => $newclickers});
     &Apache::lonnet::appenv({'environment.clickers' => $newclickers});
-    $r->print(&mt('Registering clickers: [_1]',$newclickers));
+    my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Registering clickers: [_1]',$newclickers));
+    $message=&Apache::loncommon::confirmwrapper($message);
+    $r->print(<<ENDVCSCREEN);
+$message
+ENDVCSCREEN
 }
 
 ################################################################
@@ -641,16 +665,16 @@
         ('environment',['domcoord.author']);
     my $constchecked='';
     if ($userenv{'domcoord.author'} eq 'blocked') {
-       $constchecked='checked="checked"';
+       $constchecked=' checked="checked"';
     }
     my $text=&mt('By default, the Domain Coordinator can enter your construction space.');
     my $construction=&mt('Block access to construction space');
-    my $change=&mt('Change');
+    my $change=&mt('Save');
     $r->print(<<ENDSCREEN);
 <form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_domcoord" />
 $text<br />
-<label><input type="checkbox" name="construction" $constchecked />$construction</label><br />
+<label><input type="checkbox" name="construction"$constchecked />$construction</label><br />
 <input type="submit" value="$change" />
 </form>
 ENDSCREEN
@@ -664,7 +688,17 @@
     if ($env{'form.construction'}) { $domcoord{'domcoord.author'}='blocked'; }
     &Apache::lonnet::put('environment',\%domcoord);
     &Apache::lonnet::appenv({'environment.domcoord.author' => $domcoord{'domcoord.author'}});
-    $r->print(&mt('Registering Domain Coordinator access restrictions.'));
+    my $status='';
+    if ($domcoord{'domcoord.author'} eq 'blocked') {
+        $status=&mt('on');
+    } else {
+        $status=&mt('off');
+    }
+    my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Block access to construction space').'</i>','<tt>'.$status.'</tt>'));
+    $message=&Apache::loncommon::confirmwrapper($message);
+    $r->print(<<ENDVCSCREEN);
+$message
+ENDVCSCREEN
 }
 
 #################################################################
@@ -720,13 +754,13 @@
                                           foad  => 'Forwarding Address(es)',
                                           noti  => 'Notification E-mail Address(es)', 
                                           foad_exmpl => 'e.g. <tt>userA:domain1,userB:domain2,...</tt>',
-                                          mnot  => 'Email Address(es) which should be notified about new LON-CAPA messages', # old: 'Message Notification Email Address(es)',
+                                          mnot  => 'E-mail Address(es) which should be notified about new LON-CAPA messages',
                                           mnot_exmpl => 'e.g. <tt>joe@doe.com</tt>',
-                                          chg   => 'Change',
+                                          chg   => 'Save',
                                           email => 'The e-mail address entered in row ',
                                           notv => 'is not a valid e-mail address',
-                                          toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one", 
-                                          prme => 'Back to preferences menu',
+                                          toen => "To enter multiple addresses, enter one address at a time, click 'Save' and then add the next one", 
+                                          prme => 'Back',
                                         );
     my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding");
     my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification");
@@ -893,8 +927,8 @@
     $r->print(qq|
 <br /><hr />
 <input type="hidden" name="numnotify" value="$num" />
-<input type="button" value="$lt{'chg'}" onclick="javascript:validate()" />
 <input type="button" value="$lt{'prme'}" onclick="location.href='/adm/preferences'" />
+<input type="button" value="$lt{'chg'}" onclick="javascript:validate()" />
 </form>
 |);
 
@@ -928,7 +962,7 @@
 	    if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') {
                $newscreen.=$msuser.':'.$msdomain.',';
 	   } else {
-               $message.= &mt('No such user: ').'<tt>'.$msuser.':'.$msdomain.'</tt><br>';
+               $message.= &mt('No such user: ').'<tt>'.$msuser.':'.$msdomain.'</tt><br />';
            }
         }
     }
@@ -940,7 +974,7 @@
                     .'<br />';
     } else {
         &Apache::lonnet::del('environment',['msgforward']);
-        &Apache::lonnet::delenv('environment\.msgforward');
+        &Apache::lonnet::delenv('environment.msgforward');
         $message.= &mt("Set message forwarding to 'off'.").'<br />';
     }
     my $critnotification;
@@ -980,7 +1014,7 @@
         $message.=&mt('Set non-critical message notification address(es) to ').'<tt>"'.$notification.'"</tt>.<br />';
     } else {
         &Apache::lonnet::del('environment',['notification']);
-        &Apache::lonnet::delenv('environment\.notification');
+        &Apache::lonnet::delenv('environment.notification');
         $message.=&mt("Set non-critical message notification to 'off'.").'<br />';
     }
     if ($critnotification) {
@@ -989,7 +1023,7 @@
         $message.=&mt('Set critical message notification address(es) to ').'<tt>"'.$critnotification.'"</tt>.<br />';
     } else {
         &Apache::lonnet::del('environment',['critnotification']);
-        &Apache::lonnet::delenv('environment\.critnotification');
+        &Apache::lonnet::delenv('environment.critnotification');
         $message.=&mt("Set critical message notification to 'off'.").'<br />';
     }
     if ($critnotification || $notification) {
@@ -999,7 +1033,7 @@
             $message.=&mt('Set address(es) to receive excerpts with html retained ').'<tt>"'.$notify_with_html.'"</tt>.';
         } else {
             &Apache::lonnet::del('environment',['notifywithhtml']);
-            &Apache::lonnet::delenv('environment\.notifywithhtml');
+            &Apache::lonnet::delenv('environment.notifywithhtml');
             if ($totaladdresses == 1) {
                 $message.=&mt("Set notification address to receive excerpts with html stripped.");
             } else {
@@ -1008,7 +1042,7 @@
         }
     } else {
         &Apache::lonnet::del('environment',['notifywithhtml']);
-        &Apache::lonnet::delenv('environment\.notifywithhtml');
+        &Apache::lonnet::delenv('environment.notifywithhtml');
     }
     if ($message) {
         $message .= '<br /><hr />';
@@ -1026,13 +1060,13 @@
 # figure out colors
     my $function=&Apache::loncommon::get_users_function();
     my $domain=&Apache::loncommon::determinedomain();
-    my %colortypes=('pgbg'  => 'Page Background',
-                    'tabbg' => 'Header Background',
-                    'sidebg'=> 'Header Border',
-                    'font'  => 'Font',
-                    'link'  => 'Un-Visited Link',
-                    'vlink' => 'Visited Link',
-                    'alink' => 'Active Link');
+    my %colortypes=('pgbg'  => 'Page Background Color',
+                    'tabbg' => 'Header Background Color',
+                    'sidebg'=> 'Header Border Color',
+                    'font'  => 'Font Color',
+                    'link'  => 'Un-Visited Link Color',
+                    'vlink' => 'Visited Link Color',
+                    'alink' => 'Active Link Color');
     my $start_data_table = &Apache::loncommon::start_data_table();
     my $chtable='';
     foreach my $item (sort(keys(%colortypes))) {
@@ -1043,11 +1077,14 @@
         '" size="10" value="'.$curcol.
 '" /></td><td><a href="javascript:pjump('."'color_custom','".$colortypes{$item}.
 "','".$curcol."','"
-	    .$item."','parmform.pres','psub'".');">Select</a></td>'.
+	    .$item."','parmform.pres','psub'".');">'.&mt('Select').'</a></td>'.
 	    &Apache::loncommon::end_data_table_row()."\n";
     }
     my $end_data_table = &Apache::loncommon::end_data_table();
     my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();
+    my $savebutton = &mt('Save');
+    my $resetbutton = &mt('Reset All');
+    my $resetbuttondesc = &mt('Reset All Colors to Default');
     $r->print(<<ENDCOL);
 <script type="text/javascript">
 
@@ -1086,8 +1123,8 @@
 $chtable
 $end_data_table
 </table>
-<input type="submit" value="Change Custom Colors" />
-<input type="submit" name="resetall" value="Reset All Colors to Default" />
+<input type="submit" value="$savebutton" />
+<input type="submit" name="resetall" value="$resetbutton" title="$resetbuttondesc" />
 </form>
 ENDCOL
 }
@@ -1097,13 +1134,13 @@
 # figure out colors
     my $function=&Apache::loncommon::get_users_function();
     my $domain=&Apache::loncommon::determinedomain();
-    my %colortypes=('pgbg'  => 'Page Background',
-                    'tabbg' => 'Header Background',
-                    'sidebg'=> 'Header Border',
-                    'font'  => 'Font',
-                    'link'  => 'Un-Visited Link',
-                    'vlink' => 'Visited Link',
-                    'alink' => 'Active Link');
+    my %colortypes=('pgbg'  => 'Page Background Color',
+                    'tabbg' => 'Header Background Color',
+                    'sidebg'=> 'Header Border Color',
+                    'font'  => 'Font Color',
+                    'link'  => 'Un-Visited Link Color',
+                    'vlink' => 'Visited Link Color',
+                    'alink' => 'Active Link Color');
 
     my $message='';
     foreach my $item (keys %colortypes) {
@@ -1112,13 +1149,17 @@
 	if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$env{'form.resetall'})) {
 	    &Apache::lonnet::put('environment',{$entry => $color});
 	    &Apache::lonnet::appenv({'environment.'.$entry => $color});
-	    $message.=&mt('Set '.$colortypes{$item}.' to ').'<tt>"'.$color.'"</tt>.<br />';
+            $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.$colortypes{$item}.'</i>','<tt>"'.$color.'"</tt>'))
+                    .'<br />';
 	} else {
 	    &Apache::lonnet::del('environment',[$entry]);
-	    &Apache::lonnet::delenv('environment\.'.$entry);
-	    $message.=&mt('Reset '.$colortypes{$item}.'.').'<br />';
+	    &Apache::lonnet::delenv('environment.'.$entry);
+            $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]','<i>'.$colortypes{$item}.'</i>'))
+                     .'<br />';
 	}
     }
+    $message=&Apache::loncommon::confirmwrapper($message);
+
     my $now = time;
     &Apache::lonnet::put('environment',{'color.timestamp' => $now});
     &Apache::lonnet::appenv({'environment.color.timestamp' => $now});
@@ -1150,7 +1191,9 @@
             $defdom = $r->dir_config('lonDefDomain');
             my %data = &Apache::lonnet::tmpget($mailtoken);
             if (keys(%data) == 0) {
-                $r->print(&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a <a href="/adm/resetpw">new request</a> for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.'));
+                $r->print(&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.',
+                          '<a href="/adm/resetpw">','</a>')
+                );
                 return;
             }
             if (defined($data{time})) {
@@ -1265,42 +1308,40 @@
                 'currentpass' => 'Current Password',
                 'newpass' => 'New Password',
                 'confirmpass' => 'Confirm Password',
-                'changepass' => 'Change Password');
-
-    my $output = qq|
-<form name="client" >
-<table>
-|;
+                'changepass' => 'Save');
+    my $output = '<form name="client">'
+                .&Apache::lonhtmlcommon::start_pick_box();
     if ($caller eq 'reset_by_email') {
-        $output .= qq|
-<tr><td class="LC_preferences_labeltext"><label for="email">$lt{'email'}</label>:</td>
-    <td><input type="text" name="email" size="30" /> </td></tr>
-<tr><td class="LC_preferences_labeltext"><label for="uname">$lt{'username'}</label>:</td>
-    <td>
-     <input type="text" name="uname" size="15" />
-     <input type="hidden" name="currentpass" value="$currentpass" />
-    </td></tr>
-<tr><td class="LC_preferences_labeltext"><label for="udom">$lt{'domain'}</label>:</td>
-    <td>
-|;
-        $output .= &Apache::loncommon::select_dom_form($defdom,'udom').'
-   </td>
-</tr>
-';
+        $output .= &Apache::lonhtmlcommon::row_title(
+                       '<label for="email">'.$lt{'email'}.'</label>')
+                  .'<input type="text" name="email" size="30" />'
+                  .&Apache::lonhtmlcommon::row_closure()
+                  .&Apache::lonhtmlcommon::row_title(
+                       '<label for="uname">'.$lt{'username'}.'</label>')
+                  .'<input type="text" name="uname" size="15" />'
+                  .'<input type="hidden" name="currentpass" value="'.$currentpass.'" />'
+                  .&Apache::lonhtmlcommon::row_closure()
+                  .&Apache::lonhtmlcommon::row_title(
+                       '<label for="udom">'.$lt{'domain'}.'</label>')
+                  .&Apache::loncommon::select_dom_form($defdom,'udom')
+                  .&Apache::lonhtmlcommon::row_closure();
     } else {
-        $output .= qq|
-<tr><td class="LC_preferences_labeltext"><label for="currentpass">$lt{'currentpass'}</label></td>
-    <td><input type="password" name="currentpass" size="10"/> </td></tr>
-|;
-    }
-    $output .= <<"ENDFORM";
-<tr><td class="LC_preferences_labeltext"><label for="newpass_1">$lt{'newpass'}</label></td>
-    <td><input type="password" name="newpass_1" size="10"  /> </td></tr>
-<tr><td class="LC_preferences_labeltext"><label for="newpass_2">$lt{'confirmpass'}</label></td>
-    <td><input type="password" name="newpass_2" size="10"  /> </td></tr>
-<tr><td colspan="2" align="center">
-    <input type="button" value="$lt{'changepass'}" onClick="send();">
-</table>
+        $output .= &Apache::lonhtmlcommon::row_title(
+                       '<label for="currentpass">'.$lt{'currentpass'}.'</label>')
+                  .'<input type="password" name="currentpass" size="10"/>'
+                  .&Apache::lonhtmlcommon::row_closure();
+    }
+    $output .= &Apache::lonhtmlcommon::row_title(
+                   '<label for="newpass_1">'.$lt{'newpass'}.'</label>')
+              .'<input type="password" name="newpass_1" size="10" />'
+              .&Apache::lonhtmlcommon::row_closure()
+              .&Apache::lonhtmlcommon::row_title(
+                   '<label for="newpass_2">'.$lt{'confirmpass'}.'</label>')
+              .'<input type="password" name="newpass_2" size="10" />'
+              .&Apache::lonhtmlcommon::row_closure(1)
+              .&Apache::lonhtmlcommon::end_pick_box();
+    $output .= '<p><input type="button" value="'.$lt{'changepass'}.'" onClick="send();" /></p>'
+               .qq|
 <input type="hidden" name="ukey_cpass"  value="$hexkey->{'ukey_cpass'}" />
 <input type="hidden" name="lkey_cpass"  value="$hexkey->{'lkey_cpass'}" />
 <input type="hidden" name="ukey_npass1" value="$hexkey->{'ukey_npass1'}" />
@@ -1309,7 +1350,7 @@
 <input type="hidden" name="lkey_npass2" value="$hexkey->{'lkey_npass2'}" />
 </form>
 </p>
-ENDFORM
+|;
     return $output;
 }
 
@@ -1473,12 +1514,23 @@
     my $result = &Apache::lonnet::changepass
 	($user,$domain,$currentpass,$newpass1,$homeserver,$caller);
     # Inform the user the password has (not?) been changed
+    my $message;
     if ($result =~ /^ok$/) {
-	$r->print("<h3>".&mt('The password for [_1] was successfully changed',$user)."</h3>");
+        $message = &Apache::lonhtmlcommon::confirm_success(&mt('The password for user [_1] was successfully changed.','<i>'.$user.'</i>'));
+        if ($caller eq 'reset_by_email') {
+            $r->print($message.'<br />');
+        } else {
+            $r->print(&Apache::loncommon::confirmwrapper($message));
+        }
     } else {
 	# error error: run in circles, scream and shout
-        $r->print("<h3><span class='LC_error'>".&mt("The password for [_1] was not changed",$user)."</span></h3>".
-                  &mt('Please make sure your old password was entered correctly.'));
+        $message = &Apache::lonhtmlcommon::confirm_success(
+                   &mt("The password for user [_1] was not changed.",'<i>'.$user.'</i>').' '.&mt('Please make sure your old password was entered correctly.'),1);
+        if ($caller eq 'reset_by_email') {
+            $r->print($message.'<br />');
+        } else {
+            $r->print(&Apache::loncommon::confirmwrapper($message));
+        }
         return 1;
     }
     return;
@@ -1502,7 +1554,7 @@
         }
     }
     if (defined($userenv{'discmarkread'})) {
-        unless ($userenv{'discdisplay'} eq '') { 
+        unless ($userenv{'discmarkread'} eq '') { 
             $discmark = $userenv{'discmarkread'};
         }
     }
@@ -1517,9 +1569,9 @@
         'pref' => 'Display Preference',
         'curr' => 'Current setting ',
         'actn' => 'Action',
-        'sdpf' => 'Set display preferences for discussion posts for both bulletin boards and individual resources in all your courses.',
+        'sdpf' => 'Set display preferences for discussion posts for both discussion boards and individual resources in all your courses.',
         'prca' => 'Preferences can be set that determine',
-        'whpo' => 'Which posts are displayed when you display a bulletin board or resource, and',
+        'whpo' => 'Which posts are displayed when you display a discussion board or resource, and',
         'unwh' => 'Under what circumstances posts are identfied as "New"',
         'allposts' => 'All posts',
         'unread' => 'New posts only',
@@ -1528,7 +1580,7 @@
         'disa' => 'Posts displayed?',
         'npmr' => 'New posts cease to be identified as "New"?',
         'thde'  => 'The preferences you set here can be overridden within each individual discussion.',
-        'chgt' => 'Change to '
+        'chgt' => 'Change to ',
     );
     my $dispchange = $lt{'unread'};
     my $markchange = $lt{'ondisp'};
@@ -1552,9 +1604,9 @@
 <input type="hidden" name="action" value="verify_and_change_discussion" />
 <br />
 $lt{'sdpf'}<br /> $lt{'prca'}  <ol><li>$lt{'whpo'}</li><li>$lt{'unwh'}</li></ol> 
-<br />
-<br />
 END
+    $r->print('<p class="LC_info">'.$lt{'thde'}.'</p>');
+
     $r->print(&Apache::loncommon::start_data_table());
     $r->print(<<"END");
        <tr>
@@ -1579,15 +1631,9 @@
 END
     $r->print(&Apache::loncommon::end_data_table_row().
 	      &Apache::loncommon::end_data_table());
-    $r->print(<<"END");
-<br />
-<br />
-<input type="submit" name="sub" value="Save Changes" />
-<br />
-<br />
-Note: $lt{'thde'}
-</form>
-END
+    $r->print('<br />'.
+              '<input type="submit" name="sub" value="'.&mt('Save').'" />'.
+              '</form>');
 }
                                                                                                                 
 sub verify_and_change_discussion {
@@ -1598,27 +1644,28 @@
     if (defined($env{'form.discdisp'}) ) {
         my $newdisp  = $env{'form.newdisp'};
         if ($newdisp eq 'unread') {
-            $message .=&mt('In discussions: only new posts will be displayed.').'<br />';
+            $message .= &Apache::lonhtmlcommon::confirm_success(&mt('In discussions: only new posts will be displayed.')).'<br />';
             &Apache::lonnet::put('environment',{'discdisplay' => $newdisp});
             &Apache::lonnet::appenv({'environment.discdisplay' => $newdisp});
         } else {
-            $message .= &mt('In discussions: all posts will be displayed.').'<br />';
+            $message .= &Apache::lonhtmlcommon::confirm_success(&mt('In discussions: all posts will be displayed.')).'<br />';
             &Apache::lonnet::del('environment',['discdisplay']);
-            &Apache::lonnet::delenv('environment\.discdisplay');
+            &Apache::lonnet::delenv('environment.discdisplay');
         }
     }
     if (defined($env{'form.discmark'}) ) {
         my $newmark = $env{'form.newmark'};
         if ($newmark eq 'ondisp') {
-           $message.=&mt('In discussions: new posts will be cease to be identified as "NEW" after display.').'<br />';
+            $message.=&Apache::lonhtmlcommon::confirm_success(&mt('In discussions: new posts will be cease to be identified as "NEW" after display.')).'<br />';
             &Apache::lonnet::put('environment',{'discmarkread' => $newmark});
             &Apache::lonnet::appenv({'environment.discmarkread' => $newmark});
         } else {
-            $message.=&mt('In discussions: posts will be identified as "NEW" until marked as read by the reader.').'<br />';
+            $message.=&Apache::lonhtmlcommon::confirm_success(&mt('In discussions: posts will be identified as "NEW" until marked as read by the reader.')).'<br />';
             &Apache::lonnet::del('environment',['discmarkread']);
-            &Apache::lonnet::delenv('environment\.discmarkread');
+            &Apache::lonnet::delenv('environment.discmarkread');
         }
     }
+    $message=&Apache::loncommon::confirmwrapper($message);
     $r->print(<<ENDVCSCREEN);
 $message
 ENDVCSCREEN
@@ -1644,12 +1691,17 @@
     }
     my %pagenames = (
                        firstres => 'First resource',
-                       whatsnew => "What's new page",
+                       whatsnew => "What's New Page",
                     );
-    my $whatsnew_off=&mt('Display the [_1] in the course.','<b>first resource</b>');
-    my $whatsnew_on=&mt('Display the "[_1]" page - a summary of items in the course which require attention.',"<b>What's New</b>");
+    my $whatsnew_off=&mt('Display the [_1]first resource[_2] in the course.','<b>','</b>');
+    my $whatsnew_on=&mt("Display the [_1]What's New Page[_2] - a summary of items in the course which require attention.",'<b>','</b>');
 
-    $r->print('<br /><b>'.&mt('Set the default page to be displayed when you select a course role').'</b>&nbsp;'.&mt('(Currently: [_1])',$pagenames{$currvalue}).'<br />'.&mt('The global user preference you set for your courses can be overridden in an individual course by setting a course specific setting via the "[_1]" page in the course',"<i>What's New</i>").'<br /><br />');
+    $r->print('<br /><b>'.
+              &mt('Set the default page to be displayed when you select a course role').
+              '</b>&nbsp;'.
+              &mt('(Currently: [_1])',$pagenames{$currvalue}).'<br />'.
+              &mt("The global user preference you set for your courses can be overridden in an individual course by setting a course specific setting via the [_1]What's New Page[_2] page in the course.",'<i>','</i>').
+              '<br /><br />');
     $r->print(<<ENDLSCREEN);
 <form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_coursepage" />
@@ -1657,7 +1709,7 @@
 <label><input type="radio" name="newdisp" value="firstres" $firstselect /> $whatsnew_off</label><br />
 <label><input type="radio" name="newdisp" value="whatsnew" $whatsnewselect /> $whatsnew_on</label><input type="hidden" name="refpage" value="$env{'form.refpage'}" />
 ENDLSCREEN
-    $r->print('<br /><br /><input type="submit" value="'.&mt('Change').'" />
+    $r->print('<br /><br /><input type="submit" value="'.&mt('Save').'" />
 </form>');
 }
 
@@ -1670,7 +1722,7 @@
         'ywbt' => 'you will be taken to the start of the course.',
         'apwb' => 'a page will be displayed that lists items in the course that may require action from you.',
         'gtts' => 'Go to the start of the course',
-        'dasp' => "Display the What's New page listing course action items", 
+        'dasp' => "Display the What's New Page", 
     );
     my $newdisp  = $env{'form.newdisp'};
     $message = '<b>'.$lt{'defs'}.'</b>: '.$lt{'when'}.', ';
@@ -1681,7 +1733,7 @@
     } else {
         $message .= $lt{'apwb'}.'<br />';
         &Apache::lonnet::del('environment',['course_init_display']);
-        &Apache::lonnet::delenv('environment\.course_init_display');
+        &Apache::lonnet::delenv('environment.course_init_display');
     }
     my $refpage = $env{'form.refpage'};
     if (($env{'request.course.fn'}) && ($env{'request.course.id'})) {
@@ -1696,9 +1748,9 @@
                         $refpage.'">'.$lt{'dasp'}.'</a></font>';
         }
     }
+    $message = &Apache::lonhtmlcommon::confirm_success($message);
     $r->print(<<ENDVCSCREEN);
 $message
-<br /><br />
 ENDVCSCREEN
 }
 
@@ -1767,7 +1819,7 @@
                       }));
 
     push (@Options,({ action   => 'changemsgforward',
-                      linktext => 'Change Message Forwarding and Notification Email Addresses',
+                      linktext => 'Messages &amp; Notifications',
                       href     => '/adm/preferences',
                       help     => 'Prefs_Messages',
                       breadcrumb => 
@@ -1782,13 +1834,13 @@
                             text => 'Change Message Forwarding/Notification'},
                       printmenu => 'no',
                       subroutine => \&verify_and_change_msgforward }));
-    my $aboutmeaction=
-        '/adm/'.$env{'user.domain'}.'/'.$env{'user.name'}.'/aboutme';
-    push (@Options,{ action => 'none', 
-                     linktext =>
-                         q{Edit the 'About Me' Personal Information Screen},
-		     help => 'Prefs_About_Me',
-                     href => $aboutmeaction});
+    if (&Apache::lonnet::usertools_access($user,$domain,'aboutme')) {
+        my $aboutmeaction = '/adm/'.$domain.'/'.$user.'/aboutme';
+        push (@Options,{ action   => 'none', 
+                         linktext =>"Edit the Personal Information Page",
+                         help     => 'Prefs_About_Me',
+                         href => $aboutmeaction});
+    }
     push (@Options,({ action => 'changecolors',
                       linktext => 'Change Color Scheme',
                       href => '/adm/preferences',
@@ -1915,7 +1967,7 @@
                       }));
 
     push (@Options,({ action   => 'changeclicker',
-                      linktext => 'Register Response Devices ("Clickers")',
+                      linktext => 'Register Response Devices (&quot;Clickers&quot;)',
                       href     => '/adm/preferences',
                       subroutine => \&clickerchanger,
                       breadcrumb =>
@@ -2063,7 +2115,7 @@
 
 sub toggle_debug {
     if ($env{'user.debug'}) {
-        &Apache::lonnet::delenv('user\.debug');
+        &Apache::lonnet::delenv('user.debug');
     } else {
         &Apache::lonnet::appenv({'user.debug' => 1});
     }

--gci1253718774--