--- loncom/interface/lonpreferences.pm 2012/08/27 16:30:31 1.196.4.5
+++ loncom/interface/lonpreferences.pm 2016/09/12 15:51:08 1.221
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.196.4.5 2012/08/27 16:30:31 raeburn Exp $
+# $Id: lonpreferences.pm,v 1.221 2016/09/12 15:51:08 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,8 +36,6 @@ 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;
@@ -45,50 +43,6 @@ use Apache::lonnet;
use LONCAPA::lonauthcgi();
use LONCAPA();
-#
-# Write lonnet::passwd to do the call below.
-# Use:
-# my $answer=reply("encrypt:passwd:$udom:$uname:$upass",$tryserver);
-#
-##################################################
-# password associated functions #
-##################################################
-sub des_keys {
- # Make a new key for DES encryption.
- # 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.
- my @hexstr=('0','1','2','3','4','5','6','7',
- '8','9','a','b','c','d','e','f');
- my $lkey='';
- for (0..7) {
- $lkey.=$hexstr[rand(15)];
- }
- my $ukey='';
- for (0..7) {
- $ukey.=$hexstr[rand(15)];
- }
- return ($lkey,$ukey);
-}
-
-sub des_decrypt {
- my ($key,$cyphertext) = @_;
- my $keybin=pack("H16",$key);
- my $cypher;
- if ($Crypt::DES::VERSION>=2.03) {
- $cypher=new Crypt::DES $keybin;
- } else {
- $cypher=new DES $keybin;
- }
- my $plaintext=
- $cypher->decrypt(unpack("a8",pack("H16",substr($cyphertext,0,16))));
- $plaintext.=
- $cypher->decrypt(unpack("a8",pack("H16",substr($cyphertext,16,16))));
- $plaintext=substr($plaintext,1,ord(substr($plaintext,0,1)) );
- return $plaintext;
-}
-
################################################################
# Handler subroutines #
################################################################
@@ -152,32 +106,16 @@ sub languagechanger {
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']);
+ my %userenv = &Apache::lonnet::get('environment',['languages']);
my $language=$userenv{'languages'};
- 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($_);
- }
- }
- %langchoices = &Apache::lonlocal::texthash(%langchoices);
- my $selectionbox=
- &Apache::loncommon::select_form(
- $language,
- 'language',
- \%langchoices);
- $r->print(< '
- .'
$pref: $selectionbox
-ENDLSCREEN
- $r->print('
');
+ $r->print(
+ ''
+ );
}
@@ -222,12 +160,14 @@ sub texenginechanger {
my $domain = $env{'user.domain'};
my %userenv = &Apache::lonnet::get('environment',['texengine']);
my $texengine=$userenv{'texengine'};
+ if (lc($texengine) eq 'jsmath') {
+ $texengine = 'MathJax';
+ }
my %mathchoices=('' => 'Default',
'tth' => 'tth (TeX to HTML)',
#'ttm' => 'TeX to MathML',
- 'jsMath' => 'jsMath',
- 'MathJax' => 'MathJax',
+ 'MathJax' => 'MathJax',
'mimetex' => 'mimetex (Convert to Images)',
'raw' => 'Raw (Screen Reader)'
);
@@ -238,33 +178,17 @@ sub texenginechanger {
'texengine',
\%mathchoices);
my $MathJax_start=&Apache::lontexconvert::MathJax_header();
- my $jsMath_start=&Apache::lontexconvert::jsMath_header();
my %lt=&Apache::lonlocal::texthash(
'headline' => 'Change how math is displayed',
'preftxt' => 'Preferred method to display math',
'change' => 'Save',
'exmpl' => 'Examples',
'mathjax' => 'MathJax:',
- 'jsmath' => 'jsMath:',
+ 'mathjaxinfo' => 'MathJax provides rendered equations whose source code can be extracted in TeX and MathML formats by right clicking the equation.',
'tth' => 'tth (TeX to HTML):',
'mimetex' => 'mimetex (Convert to Images):',
);
- my $jsMathWarning='