--- loncom/interface/lonpreferences.pm 2004/01/14 15:51:07 1.34 +++ loncom/interface/lonpreferences.pm 2013/08/29 12:36:15 1.210 @@ -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.210 2013/08/29 12:36:15 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,6 +33,7 @@ package Apache::lonpreferences; use strict; +use LONCAPA; use Apache::Constants qw(:common); use Apache::File; use Crypt::DES; @@ -52,6 +41,9 @@ 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. @@ -63,7 +55,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,238 +96,1090 @@ sub des_decrypt { ################################################################ # Language Change Subroutines # ################################################################ -sub languagechanger { + +sub wysiwygchanger { my $r = shift; - my $user = $ENV{'user.name'}; - my $domain = $ENV{'user.domain'}; - my %userenv = &Apache::lonnet::get - ('environment',['languages']); - my $language=$userenv{'languages'}; + 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 $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 %userenv = &Apache::lonnet::get + ('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.")."
"; } - my $selectionbox=&Apache::loncommon::select_form($language,'language', - %langchoices); $r->print(<