--- loncom/interface/lonpreferences.pm 2003/09/29 19:33:51 1.31 +++ loncom/interface/lonpreferences.pm 2009/04/05 17:18:29 1.150 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.31 2003/09/29 19:33:51 www Exp $ +# $Id: lonpreferences.pm,v 1.150 2009/04/05 17:18:29 droeschl 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,16 @@ 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(); # # Write lonnet::passwd to do the call below. @@ -62,7 +54,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 +95,989 @@ sub des_decrypt { ################################################################ # Language Change Subroutines # ################################################################ + +sub wysiwygchanger { + my $r = shift; + 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',['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(<'.&mt('Setting WYSIWYG editor to:').' '.&mt($newsetting).'
'); + print_main_menu($r,''.&mt('Setting WYSIWYG editor to:').' ' + .&mt($newsetting).'
'); +} + +################################################################ +# Language Change Subroutines # +################################################################ sub languagechanger { my $r = shift; - my $user = $ENV{'user.name'}; - my $domain = $ENV{'user.domain'}; + + Apache::lonhtmlcommon::add_breadcrumb( + { href => '/adm/preferences?action=changelanguages', + text => 'Change Language'}); + $r->print(Apache::loncommon::start_page('Content Display Settings')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Language')); + my $user = $env{'user.name'}; + my $domain = $env{'user.domain'}; my %userenv = &Apache::lonnet::get - ('environment',['languages','translator']); + ('environment',['languages']); my $language=$userenv{'languages'}; - my $translator=$userenv{'translator'}; - my $bodytag=&Apache::loncommon::bodytag( - 'Change Your Language Preferences'); - $r->print(<