--- loncom/interface/lonpreferences.pm 2003/09/16 22:40:25 1.28 +++ loncom/interface/lonpreferences.pm 2012/12/18 14:25:59 1.201 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.28 2003/09/16 22:40:25 www Exp $ +# $Id: lonpreferences.pm,v 1.201 2012/12/18 14:25:59 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: @@ -45,12 +33,17 @@ package Apache::lonpreferences; use strict; +use LONCAPA; use Apache::Constants qw(:common); use Apache::File; use Crypt::DES; use DynaLoader; # for Crypt::DES version use Apache::loncommon(); use Apache::lonhtmlcommon(); +use Apache::lonlocal; +use Apache::lonnet; +use LONCAPA::lonauthcgi(); +use LONCAPA(); # # Write lonnet::passwd to do the call below. @@ -62,7 +55,7 @@ use Apache::lonhtmlcommon(); ################################################## 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. @@ -103,250 +96,1106 @@ sub des_decrypt { ################################################################ # Language Change Subroutines # ################################################################ -sub languagechanger { + +sub wysiwygchanger { my $r = shift; - my $user = $ENV{'user.name'}; - my $domain = $ENV{'user.domain'}; + Apache::lonhtmlcommon::add_breadcrumb( + { href => '/adm/preferences?action=changewysiwyg', + text => 'Change WYSIWYG Preferences'}); + $r->print(Apache::loncommon::start_page('Content Display Settings')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Change WYSIWYG Preferences')); + my %userenv = &Apache::lonnet::get - ('environment',['language','translator']); - my $language=$userenv{'language'}; - my $translator=$userenv{'translator'}; - my $bodytag=&Apache::loncommon::bodytag( - 'Change Your Language Preferences'); + ('environment',['wysiwygeditor']); + my $onselect='checked="checked"'; + my $offselect=''; + if ($userenv{'wysiwygeditor'} eq 'on') { + $onselect=''; + $offselect='checked="checked"'; + } + my $switchoff=&mt('Disable WYSIWYG editor'); + my $switchon=&mt('Enable WYSIWYG editor'); + my $warning=''; + if ($env{'user.adv'}) { + $warning.='
'.&mt("The WYSIWYG editor only supports simple HTML and is in many cases unsuited for advanced authoring. In a number of cases, it may destroy advanced authoring involving LaTeX and script function calls.")."
"; + } $r->print(<