--- loncom/interface/lonpreferences.pm 2004/02/21 01:31:04 1.35 +++ loncom/interface/lonpreferences.pm 2004/05/11 10:42:41 1.42 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.35 2004/02/21 01:31:04 matthew Exp $ +# $Id: lonpreferences.pm,v 1.42 2004/05/11 10:42:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,18 +25,6 @@ # # http://www.lon-capa.org/ # -# (Internal Server Error Handler -# -# (Login Screen -# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14, -# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer) -# -# 3/1/1 Gerd Kortemeyer) -# -# 3/1 Gerd Kortemeyer -# -# 2/13/02 2/14 2/15 Matthew Hall -# # This package uses the "londes.js" javascript code. # # TODOs that have to be completed: @@ -63,7 +51,7 @@ use Apache::lonlocal; ################################################## sub des_keys { # Make a new key for DES encryption. - # Each key has two parts which are returned seperately. + # Each key has two parts which are returned separately. # Please note: Each key must be passed through the &hex function # before it is output to the web browser. The hex versions cannot # be used to decrypt. @@ -503,7 +491,7 @@ sub passwordchanger { $errormessage
-
@@ -638,6 +626,63 @@ ENDERROR
return;
}
+################################################################
+# discussion display subroutines
+################################################################
+sub discussionchanger {
+ my $r = shift;
+ my $user = $ENV{'user.name'};
+ my $domain = $ENV{'user.domain'};
+ my %userenv = &Apache::lonnet::get
+ ('environment',['discdisplay']);
+ my $discdisplay=$userenv{'discdisplay'};
+ my $discchange = 'unread';
+ my $alllong = &mt('all posts');
+ my $unreadlong = &mt('only unread posts');
+ my $discbutton = $unreadlong;
+ my $currdisc = $alllong;
+ if ($discdisplay eq 'unread') {
+ $discchange = 'allposts';
+ $discbutton = $alllong;
+ $currdisc = $unreadlong;
+ }
+ $r->print(<
+ENDLSCREEN
+ $r->print(
+&mt('You can set a display preference for discussion posts for both bulletin boards and individual resources in all your courses.').'
'.
+&mt('This default preference can be overridden within each individual discussion.').'
'.
+&mt('Your discussion post display preference is currently set to display').' '.$currdisc.
+'.
'
+ );
+}
+
+sub verify_and_change_discussion {
+ my $r = shift;
+ my $user = $ENV{'user.name'};
+ my $domain = $ENV{'user.domain'};
+# Discussion
+ my $discdisplay = $ENV{'form.discdisplay'};
+ my $message='';
+ if ($discdisplay eq 'unread') {
+ &Apache::lonnet::put('environment',{'discdisplay' => $discdisplay});
+ &Apache::lonnet::appenv('environment.discdisplay' => $discdisplay);
+ $message='Discussions set to display only unread posts';
+ } else {
+ &Apache::lonnet::del('environment',['discdisplay']);
+ &Apache::lonnet::delenv('environment\.discdisplay');
+ $message='Discussions set to display all posts';
+ }
+ $r->print(<';
if ($ENV{'user.name'} =~
- /^(albertel|koretemey|korte|hallmat3|turtle)$/
+ /^(albertel|kortemey|korte|hallmat3|turtle)$/
) {
push (@Options,({ action => 'debugtoggle',
linktext => 'Toggle Debug Messages',