--- loncom/interface/lonpreferences.pm 2003/11/07 23:22:21 1.32 +++ loncom/interface/lonpreferences.pm 2004/07/26 21:57:27 1.48 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.32 2003/11/07 23:22:21 www Exp $ +# $Id: lonpreferences.pm,v 1.48 2004/07/26 21:57:27 albertel 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. @@ -104,6 +92,41 @@ sub des_decrypt { ################################################################ # Language Change Subroutines # ################################################################ + +sub wysiwygchanger { + my $r = shift; + my %userenv = &Apache::lonnet::get + ('environment',['wysiwygeditor']); + my $offselect=''; + my $onselect='checked="1"'; + if ($userenv{'wysiwygeditor'}) { + $onselect=''; + $offselect='checked="1"'; + } + my $switchoff=&mt('Disable WYSIWYG editor'); + my $switchon=&mt('Enable WYSIWYG editor'); + $r->print(< + +
+ $switchoff
+ $switchon +ENDLSCREEN + $r->print('
'); +} + + +sub verify_and_change_wysiwyg { + my $r = shift; + my $newsetting=$ENV{'form.wysiwyg'}; + &Apache::lonnet::put('environment',{'wysiwygeditor' => $newsetting}); + &Apache::lonnet::appenv('environment.wysiwygeditor' => $newsetting); + $r->print('

'.&mt('Setting WYSIWYG editor to:').' '.&mt($newsetting).'

'); +} + +################################################################ +# Language Change Subroutines # +################################################################ sub languagechanger { my $r = shift; my $user = $ENV{'user.name'}; @@ -112,18 +135,22 @@ sub languagechanger { ('environment',['languages']); my $language=$userenv{'languages'}; - my $bodytag=&Apache::loncommon::bodytag( - 'Change Your Language Preferences'); + my $pref=&mt('Preferred language'); + my %langchoices=('' => 'No language preference'); + foreach (&Apache::loncommon::languageids()) { + if (&Apache::loncommon::supportedlanguagecode($_)) { + $langchoices{&Apache::loncommon::supportedlanguagecode($_)} + = &Apache::loncommon::plainlanguagedescription($_); + } + } + my $selectionbox=&Apache::loncommon::select_form($language,'language', + %langchoices); $r->print(< -$bodytag -
-
Preferred language: - +
$pref: $selectionbox ENDLSCREEN - $r->print('
'); + $r->print('
'); } @@ -144,14 +171,9 @@ sub verify_and_change_languages { &Apache::lonnet::delenv('environment\.languages'); $message='Reset preferred language'; } - my $bodytag=&Apache::loncommon::bodytag( - 'Change Your Language Preferences'); $r->print(< -$bodytag

$message - ENDVCSCREEN } @@ -167,12 +189,7 @@ sub screennamechanger { ('environment',['screenname','nickname']); my $screenname=$userenv{'screenname'}; my $nickname=$userenv{'nickname'}; - my $bodytag=&Apache::loncommon::bodytag( - 'Change Your Nickname and Anonymous Screen Name'); $r->print(< -$bodytag -

New screenname (shown if you post anonymously): @@ -181,8 +198,6 @@ $bodytag
- - ENDSCREEN } @@ -217,14 +232,9 @@ sub verify_and_change_screenname { $message.='Reset nickname'; } - my $bodytag=&Apache::loncommon::bodytag( - 'Change Your Nickname and Anonymous Screen Name'); $r->print(< -$bodytag

$message - ENDVCSCREEN } @@ -240,8 +250,6 @@ sub msgforwardchanger { my $msgforward=$userenv{'msgforward'}; my $notification=$userenv{'notification'}; my $critnotification=$userenv{'critnotification'}; - my $bodytag=&Apache::loncommon::bodytag( - 'Change Your Message Forwarding and Notification'); my $forwardingHelp = Apache::loncommon::help_open_topic("Prefs_Forwarding", "What are forwarding ". "and notification ". @@ -250,8 +258,6 @@ sub msgforwardchanger { "What are critical messages"); $r->print(< -$bodytag $forwardingHelp
@@ -263,8 +269,6 @@ New Critical Message Notification Email $criticalMessageHelp
- - ENDMSG } @@ -318,14 +322,9 @@ sub verify_and_change_msgforward { &Apache::lonnet::delenv('environment\.critnotification'); $message.='Reset critical message notification
'; } - my $bodytag=&Apache::loncommon::bodytag( - 'Change Your Message Forwarding and Notifications'); $r->print(< -$bodytag

$message - ENDVCMSG } @@ -335,9 +334,6 @@ ENDVCMSG sub colorschanger { my $r = shift; - my $bodytag=&Apache::loncommon::bodytag( - 'Change Color Scheme for Current Role Type','', - 'onUnload="pclose();"'); # figure out colors my $function='student'; if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) { @@ -370,7 +366,6 @@ sub colorschanger { } my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); $r->print(< -$bodytag
@@ -411,8 +405,6 @@ $chtable
- - ENDCOL } @@ -453,18 +445,12 @@ sub verify_and_change_colors { $message.='Reset '.$colortypes{$item}.'
'; } } - my $bodytag=&Apache::loncommon::bodytag( - 'Change Color Scheme for Current Role Type'); $r->print(< -$bodytag

$message
-
- ENDVCCOL } @@ -510,12 +496,7 @@ sub passwordchanger { my $jsh=Apache::File->new($include."/londes.js"); $r->print(<$jsh>); } - my $bodytag=&Apache::loncommon::bodytag('Change Password','', - 'onLoad="init();"'); $r->print(< -$bodytag -