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

wenzelju wenzelju@source.lon-capa.org
Tue, 15 Dec 2009 13:15:32 -0000


wenzelju		Tue Dec 15 13:15:32 2009 EDT

  Modified files:              
    /loncom/interface	lonpreferences.pm 
  Log:
  Added confirm_success-boxes where missing and deleted deprecated <font size="+1">-tags. 
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.179 loncom/interface/lonpreferences.pm:1.180
--- loncom/interface/lonpreferences.pm:1.179	Wed Dec  2 18:33:27 2009
+++ loncom/interface/lonpreferences.pm	Tue Dec 15 13:15:32 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.179 2009/12/02 18:33:27 bisitz Exp $
+# $Id: lonpreferences.pm,v 1.180 2009/12/15 13:15:32 wenzelju Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -455,19 +455,15 @@
     if ($hotlist_flag) {
         &Apache::lonnet::put('environment',{'recentroles' => $hotlist_flag});
         &Apache::lonnet::appenv({'environment.recentroles' => $hotlist_flag});
-        $message=&mt('Recent '.$role.'s Hotlist is Enabled');
+        $message=&Apache::lonhtmlcommon::confirm_success(&mt('Recent '.$role.'s Hotlist is Enabled.')." ".&mt('Display [_1] Most Recent '.$role.'s.',$hotlist_n));
     } else {
         &Apache::lonnet::del('environment',['recentroles']);
         &Apache::lonnet::delenv('environment.recentroles');
-        $message=&mt('Recent '.$role.'s Hotlist is Disabled');
+        $message=&Apache::lonhtmlcommon::confirm_success(&mt('Recent '.$role.'s Hotlist is Disabled'));
     }
     if ($hotlist_n) {
         &Apache::lonnet::put('environment',{'recentrolesn' => $hotlist_n});
         &Apache::lonnet::appenv({'environment.recentrolesn' => $hotlist_n});
-        if ($hotlist_flag) {
-            $message.="<br />".
-		&mt('Display [_1] Most Recent '.$role.'s',$hotlist_n)."\n";
-        }
     }
 
 # Get list of froze roles and list of recent roles
@@ -1011,12 +1007,11 @@
     if ($newscreen) {
         &Apache::lonnet::put('environment',{'msgforward' => $newscreen});
         &Apache::lonnet::appenv({'environment.msgforward' => $newscreen});
-        $message .= &mt('Set message forwarding to ').'<tt>"'.$newscreen.'"</tt>.'
-                    .'<br />';
+        $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Set message forwarding to ').'<tt>"'.$newscreen.'"</tt>.<br />');
     } else {
         &Apache::lonnet::del('environment',['msgforward']);
         &Apache::lonnet::delenv('environment.msgforward');
-        $message.= &mt("Set message forwarding to 'off'.").'<br />';
+        $message.= &Apache::lonhtmlcommon::confirm_success(&mt("Set message forwarding to 'off'.").'<br />');
     }
     my $critnotification;
     my $notification;
@@ -1052,43 +1047,41 @@
     if ($notification) {
         &Apache::lonnet::put('environment',{'notification' => $notification});
         &Apache::lonnet::appenv({'environment.notification' => $notification});
-        $message.=&mt('Set non-critical message notification address(es) to ').'<tt>"'.$notification.'"</tt>.<br />';
+        $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set non-critical message notification address(es) to ').'<tt>"'.$notification.'"</tt>.<br />');
     } else {
         &Apache::lonnet::del('environment',['notification']);
         &Apache::lonnet::delenv('environment.notification');
-        $message.=&mt("Set non-critical message notification to 'off'.").'<br />';
+        $message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set non-critical message notification to 'off'.").'<br />');
     }
     if ($critnotification) {
         &Apache::lonnet::put('environment',{'critnotification' => $critnotification});
         &Apache::lonnet::appenv({'environment.critnotification' => $critnotification});
-        $message.=&mt('Set critical message notification address(es) to ').'<tt>"'.$critnotification.'"</tt>.<br />';
+        $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set critical message notification address(es) to ').'<tt>"'.$critnotification.'"</tt>.<br />');
     } else {
         &Apache::lonnet::del('environment',['critnotification']);
         &Apache::lonnet::delenv('environment.critnotification');
-        $message.=&mt("Set critical message notification to 'off'.").'<br />';
+        $message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set critical message notification to 'off'.").'<br />');
     }
     if ($critnotification || $notification) {
         if ($notify_with_html) {
             &Apache::lonnet::put('environment',{'notifywithhtml' => $notify_with_html});
             &Apache::lonnet::appenv({'environment.notifywithhtml' => $notify_with_html});
-            $message.=&mt('Set address(es) to receive excerpts with html retained ').'<tt>"'.$notify_with_html.'"</tt>.';
+            $message.=&Apache::lonhtmlcommon::confirm_success(&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');
             if ($totaladdresses == 1) {
-                $message.=&mt("Set notification address to receive excerpts with html stripped.");
+                $message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set notification address to receive excerpts with html stripped."));
             } else {
-                $message.=&mt("Set all notification addresses to receive excerpts with html stripped.");
+                $message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set all notification addresses to receive excerpts with html stripped."));
             }
         }
     } else {
         &Apache::lonnet::del('environment',['notifywithhtml']);
         &Apache::lonnet::delenv('environment.notifywithhtml');
     }
-    if ($message) {
-        $message .= '<br /><hr />';
-    }
     &Apache::loncommon::flush_email_cache($user,$domain);
+    $message=&Apache::loncommon::confirmwrapper($message);
     &msgforwardchanger($r,$message);
 }
 
@@ -1578,6 +1571,7 @@
     my $message;
     if ($result =~ /^ok$/) {
         $message = &Apache::lonhtmlcommon::confirm_success(&mt('The password for user [_1] was successfully changed.','<i>'.$user.'</i>'));
+        $message = &Apache::loncommon::confirmwrapper($message);
         if ($caller eq 'reset_by_email') {
             $r->print($message.'<br />');
         } else {
@@ -1820,13 +1814,15 @@
             my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; 
             my ($furl,$ferr)=
                 &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
-            $message .= '<br /><font size="+1"><a href="'.$furl.'">'.$lt{'gtts'}.' <i>'.&mt('now').'</i></a></font>';
+            $message .= '<br /><a href="'.$furl.'">'.$lt{'gtts'}.' <i>'.&mt('now').'</i></a>';
         } else {
-            $message .= '<br /><font size="+1"><a href="/adm/whatsnew?refpage='.
-                        $refpage.'">'.$lt{'dasp'}.'</a></font>';
+            $message .= '<br /><a href="/adm/whatsnew?refpage='.
+                        $refpage.'">'.$lt{'dasp'}.'</a>';
         }
     }
-    &print_main_menu($r, &Apache::lonhtmlcommon::confirm_success($message));
+    $message = &Apache::lonhtmlcommon::confirm_success($message);
+    $message = &Apache::loncommon::confirmwrapper($message);
+    &print_main_menu($r,$message);
 }
 
 sub print_main_menu {