--- loncom/interface/lonpreferences.pm 2004/01/14 15:51:07 1.34 +++ loncom/interface/lonpreferences.pm 2004/07/09 21:05:14 1.46 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.34 2004/01/14 15:51:07 www Exp $ +# $Id: lonpreferences.pm,v 1.46 2004/07/09 21:05:14 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. @@ -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,8 +135,6 @@ 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()) { @@ -125,14 +146,11 @@ sub languagechanger { my $selectionbox=&Apache::loncommon::select_form($language,'language', %langchoices); $r->print(< -$bodytag -

$pref: $selectionbox ENDLSCREEN - $r->print('
'); + $r->print('
'); } @@ -153,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 } @@ -176,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): @@ -190,8 +198,6 @@ $bodytag
- - ENDSCREEN } @@ -226,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 } @@ -249,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 ". @@ -259,8 +258,6 @@ sub msgforwardchanger { "What are critical messages"); $r->print(< -$bodytag $forwardingHelp
@@ -272,8 +269,6 @@ New Critical Message Notification Email $criticalMessageHelp
- - ENDMSG } @@ -327,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 } @@ -344,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)/) { @@ -379,7 +366,6 @@ sub colorschanger { } my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); $r->print(< -$bodytag
@@ -420,8 +405,6 @@ $chtable
- - ENDCOL } @@ -462,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 } @@ -519,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 -