version 1.196.4.23, 2016/09/19 03:21:20
|
version 1.217, 2016/01/27 00:24:09
|
Line 160 sub texenginechanger {
|
Line 160 sub texenginechanger {
|
my $domain = $env{'user.domain'}; |
my $domain = $env{'user.domain'}; |
my %userenv = &Apache::lonnet::get('environment',['texengine']); |
my %userenv = &Apache::lonnet::get('environment',['texengine']); |
my $texengine=$userenv{'texengine'}; |
my $texengine=$userenv{'texengine'}; |
if (lc($texengine) eq 'jsmath') { |
|
$texengine = 'MathJax'; |
|
} |
|
|
|
my %mathchoices=('' => 'Default', |
my %mathchoices=('' => 'Default', |
'tth' => 'tth (TeX to HTML)', |
'tth' => 'tth (TeX to HTML)', |
#'ttm' => 'TeX to MathML', |
#'ttm' => 'TeX to MathML', |
'MathJax' => 'MathJax', |
'jsMath' => 'jsMath', |
|
'MathJax' => 'MathJax', |
'mimetex' => 'mimetex (Convert to Images)', |
'mimetex' => 'mimetex (Convert to Images)', |
'raw' => 'Raw (Screen Reader)' |
'raw' => 'Raw (Screen Reader)' |
); |
); |
Line 178 sub texenginechanger {
|
Line 176 sub texenginechanger {
|
'texengine', |
'texengine', |
\%mathchoices); |
\%mathchoices); |
my $MathJax_start=&Apache::lontexconvert::MathJax_header(); |
my $MathJax_start=&Apache::lontexconvert::MathJax_header(); |
|
my $jsMath_start=&Apache::lontexconvert::jsMath_header(); |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'headline' => 'Change how math is displayed', |
'headline' => 'Change how math is displayed', |
'preftxt' => 'Preferred method to display math', |
'preftxt' => 'Preferred method to display math', |
'change' => 'Save', |
'change' => 'Save', |
'exmpl' => 'Examples', |
'exmpl' => 'Examples', |
'mathjax' => 'MathJax:', |
'mathjax' => 'MathJax:', |
'mathjaxinfo' => 'MathJax provides rendered equations whose source code can be extracted in TeX and MathML formats by right clicking the equation.', |
'mathjaxinfo' => 'MathJax provides rendered equations whose source code can be extracted in TeX and MathML formats by right clicking the equation.', |
|
'jsmath' => 'jsMath:', |
'tth' => 'tth (TeX to HTML):', |
'tth' => 'tth (TeX to HTML):', |
'mimetex' => 'mimetex (Convert to Images):', |
'mimetex' => 'mimetex (Convert to Images):', |
); |
); |
|
|
|
my $jsMathWarning='<p>' |
|
.'<div class="LC_warning">' |
|
.&mt("It looks like you don't have the TeX math fonts installed.") |
|
.'</div>' |
|
.'<div>' |
|
.&mt('The jsMath example on this page may not look right without them. ' |
|
.'The [_1]jsMath Home Page[_2] has information on how to download the ' |
|
.'needed fonts. In the meantime, jsMath will do the best it can ' |
|
.'with the fonts you have, but it may not be pretty and some equations ' |
|
.'may not be rendered correctly.' |
|
,'<a href="http://www.math.union.edu/locate/jsMath/" target="_blank">' |
|
,'</a>') |
|
.'</div>' |
|
.'</p>'; |
|
|
$r->print(<<ENDLSCREEN); |
$r->print(<<ENDLSCREEN); |
<h2>$lt{'headline'}</h2> |
<h2>$lt{'headline'}</h2> |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
Line 211 $lt{'exmpl'}
|
Line 226 $lt{'exmpl'}
|
$lt{'mathjaxinfo'} |
$lt{'mathjaxinfo'} |
</p> |
</p> |
|
|
|
<h3>$lt{'jsmath'}</h3> |
|
<p> |
|
$jsMath_start |
|
<script type="text/javascript" language="JavaScript"> |
|
if (jsMath.nofonts == 1) { |
|
document.writeln($jsMathWarning); |
|
} |
|
|
|
</script> |
|
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=jsMath" width="400" height="150"></iframe> |
|
</p> |
|
|
<h3>$lt{'mimetex'}</h3> |
<h3>$lt{'mimetex'}</h3> |
<p> |
<p> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=mimetex" width="400" height="150"></iframe> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=mimetex" width="400" height="150"></iframe> |
Line 221 $lt{'mathjaxinfo'}
|
Line 248 $lt{'mathjaxinfo'}
|
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="150"></iframe> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="150"></iframe> |
</p> |
</p> |
ENDLSCREEN |
ENDLSCREEN |
|
if ($env{'environment.texengine'} ne 'jsMath') { |
|
$r->print('<script type="text/javascript" language="JavaScript">jsMath.Process()</script>'); |
|
} |
} |
} |
|
|
|
|
Line 231 sub verify_and_change_texengine {
|
Line 261 sub verify_and_change_texengine {
|
# Screenname |
# Screenname |
my $newtexengine = $env{'form.texengine'}; |
my $newtexengine = $env{'form.texengine'}; |
$newtexengine=~s/[^\-\w]//g; |
$newtexengine=~s/[^\-\w]//g; |
if (lc($newtexengine) eq 'jsmath') { |
|
$newtexengine = 'MathJax'; |
|
} |
|
if ($newtexengine eq 'ttm') { |
if ($newtexengine eq 'ttm') { |
&Apache::lonnet::appenv({'browser.mathml' => 1}); |
&Apache::lonnet::appenv({'browser.mathml' => 1}); |
} else { |
} else { |
Line 282 sub rolesprefchanger {
|
Line 309 sub rolesprefchanger {
|
my $hotlist_n=$userenv{'recentrolesn'}; |
my $hotlist_n=$userenv{'recentrolesn'}; |
my ($checkedon,$checkedoff); |
my ($checkedon,$checkedoff); |
if ($hotlist_flag) { |
if ($hotlist_flag) { |
$checkedon = 'checked="checked"'; |
$checkedon = 'checked="checked"'; |
} else { |
} else { |
$checkedoff = 'checked="checked"'; |
$checkedoff = 'checked="checked"'; |
} |
} |
Line 365 $options.'
|
Line 392 $options.'
|
&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::end_pick_box().' |
&Apache::lonhtmlcommon::end_pick_box().' |
</div>'); |
</div>'); |
if ($roles_check_list) { |
if ($roles_check_list) { |
$r->print('<div class="LC_left_float"> |
$r->print('<div class="LC_left_float"> |
<h4>'.&mt('Freeze Roles').'</h4> |
<h4>'.&mt('Freeze Roles').'</h4> |
<p>'.&mt('The table below can be used to [_1]freeze[_2] '.$lc_role.'s in the Hotlist.','<q>','</q>').'<br />'. |
<p>'.&mt('The table below can be used to [_1]freeze[_2] '.$lc_role.'s in the Hotlist.','<q>','</q>').'<br />'. |
Line 1139 sub colorschanger {
|
Line 1166 sub colorschanger {
|
foreach my $item (sort(keys(%colortypes))) { |
foreach my $item (sort(keys(%colortypes))) { |
my $curcol=&Apache::loncommon::designparm($function.'.'.$item,$domain); |
my $curcol=&Apache::loncommon::designparm($function.'.'.$item,$domain); |
$chtable.=&Apache::loncommon::start_data_table_row(). |
$chtable.=&Apache::loncommon::start_data_table_row(). |
'<td>'.$colortypes{$item}.'<td><input name="'.$item. |
'<td>'.$colortypes{$item}.'<td><input name="'.$item. |
'" class="colorchooser" size="10" value="'.$curcol. |
'" class="colorchooser" size="10" value="'.$curcol. |
'" /></td>'. |
'" /></td>'. |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
} |
} |
my $end_data_table = &Apache::loncommon::end_data_table(); |
my $end_data_table = &Apache::loncommon::end_data_table(); |
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); |
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); |
Line 1154 sub colorschanger {
|
Line 1181 sub colorschanger {
|
' . $colorchooser . ' |
' . $colorchooser . ' |
</script> |
</script> |
'); |
'); |
|
|
$r->print(<<ENDCOL); |
$r->print(<<ENDCOL); |
|
|
<form name="parmform" action=""> |
<form name="parmform" action=""> |
Line 1195 sub verify_and_change_colors {
|
Line 1221 sub verify_and_change_colors {
|
my $message=''; |
my $message=''; |
foreach my $item (keys(%colortypes)) { |
foreach my $item (keys(%colortypes)) { |
my $color=$env{'form.'.$item}; |
my $color=$env{'form.'.$item}; |
if (!($color =~ /^#/)) { |
if (!($color =~ /^#/)) { |
$color = '#' . $color; |
$color = '#' . $color; |
} |
} |
my $entry='color.'.$function.'.'.$item; |
my $entry='color.'.$function.'.'.$item; |
if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$env{'form.resetall'})) { |
if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$env{'form.resetall'})) { |
&Apache::lonnet::put('environment',{$entry => $color}); |
&Apache::lonnet::put('environment',{$entry => $color}); |
Line 1254 sub passwordchanger {
|
Line 1280 sub passwordchanger {
|
$r->print( |
$r->print( |
'<p class="LC_warning">' |
'<p class="LC_warning">' |
.&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.' |
.&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.' |
,'<a href="/adm/resetpw">','</a>') |
,'<a href="/adm/resetpw">','</a>') |
.'</p>' |
.'</p>' |
); |
); |
return; |
return; |
Line 1275 sub passwordchanger {
|
Line 1301 sub passwordchanger {
|
} |
} |
} else { |
} else { |
$r->print( |
$r->print( |
'<p class="LC_warning">' |
'<p class="LC_warning">' |
.&mt('Sorry, the URL generated when you requested reset of' |
.&mt('Sorry, the URL generated when you requested reset of' |
.' your password contained incomplete information.') |
.' your password contained incomplete information.') |
.'</p>' |
.'</p>' |
); |
); |
return; |
return; |
Line 1348 sub jscript_send {
|
Line 1374 sub jscript_send {
|
uextkey=this.document.client.elements.ukey_cpass.value; |
uextkey=this.document.client.elements.ukey_cpass.value; |
lextkey=this.document.client.elements.lkey_cpass.value; |
lextkey=this.document.client.elements.lkey_cpass.value; |
initkeys(); |
initkeys(); |
this.document.pserver.elements.currentpass.value = |
|
getCrypted(this.document.client.elements.currentpass.value); |
this.document.pserver.elements.currentpass.value |
|
=crypted(this.document.client.elements.currentpass.value); |
|
|
uextkey=this.document.client.elements.ukey_npass1.value; |
uextkey=this.document.client.elements.ukey_npass1.value; |
lextkey=this.document.client.elements.lkey_npass1.value; |
lextkey=this.document.client.elements.lkey_npass1.value; |
initkeys(); |
initkeys(); |
this.document.pserver.elements.newpass_1.value |
this.document.pserver.elements.newpass_1.value |
=getCrypted(this.document.client.elements.newpass_1.value); |
=crypted(this.document.client.elements.newpass_1.value); |
|
|
uextkey=this.document.client.elements.ukey_npass2.value; |
uextkey=this.document.client.elements.ukey_npass2.value; |
lextkey=this.document.client.elements.lkey_npass2.value; |
lextkey=this.document.client.elements.lkey_npass2.value; |
initkeys(); |
initkeys(); |
this.document.pserver.elements.newpass_2.value |
this.document.pserver.elements.newpass_2.value |
=getCrypted(this.document.client.elements.newpass_2.value); |
=crypted(this.document.client.elements.newpass_2.value); |
|; |
|; |
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
$output .= qq| |
$output .= qq| |
Line 1374 sub jscript_send {
|
Line 1403 sub jscript_send {
|
$ output .= qq| |
$ output .= qq| |
this.document.pserver.submit(); |
this.document.pserver.submit(); |
} |
} |
|
|
</script> |
</script> |
|; |
|; |
} |
} |
Line 1394 sub client_form {
|
Line 1422 sub client_form {
|
my $output = '<form name="client" action="">' |
my $output = '<form name="client" action="">' |
.&Apache::lonhtmlcommon::start_pick_box(); |
.&Apache::lonhtmlcommon::start_pick_box(); |
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
my $mobileargs; |
|
(undef,undef,undef,undef,undef,undef,my $clientmobile) = |
|
&Apache::loncommon::decode_user_agent(); |
|
if ($clientmobile) { |
|
$mobileargs = 'autocapitalize="off" autocorrect="off" '; |
|
} |
|
$output .= &Apache::lonhtmlcommon::row_title( |
$output .= &Apache::lonhtmlcommon::row_title( |
'<label for="email">'.$lt{'email'}.'</label>') |
'<label for="email">'.$lt{'email'}.'</label>') |
.'<input type="text" name="email" size="30" '.$mobileargs.'/>' |
.'<input type="text" name="email" size="30" />' |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_title( |
.&Apache::lonhtmlcommon::row_title( |
'<label for="uname">'.$lt{'username'}.'</label>') |
'<label for="uname">'.$lt{'username'}.'</label>') |
.'<input type="text" name="uname" size="20" '.$mobileargs.'/>' |
.'<input type="text" name="uname" size="15" />' |
.'<input type="hidden" name="currentpass" value="'.$currentpass.'" />' |
.'<input type="hidden" name="currentpass" value="'.$currentpass.'" />' |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_title( |
.&Apache::lonhtmlcommon::row_title( |
Line 1416 sub client_form {
|
Line 1438 sub client_form {
|
} else { |
} else { |
$output .= &Apache::lonhtmlcommon::row_title( |
$output .= &Apache::lonhtmlcommon::row_title( |
'<label for="currentpass">'.$lt{'currentpass'}.'</label>') |
'<label for="currentpass">'.$lt{'currentpass'}.'</label>') |
.'<input type="password" name="currentpass" size="20"/>' |
.'<input type="password" name="currentpass" size="10"/>' |
.&Apache::lonhtmlcommon::row_closure(); |
.&Apache::lonhtmlcommon::row_closure(); |
} |
} |
$output .= &Apache::lonhtmlcommon::row_title( |
$output .= &Apache::lonhtmlcommon::row_title( |
'<label for="newpass_1">'.$lt{'newpass'}.'</label>') |
'<label for="newpass_1">'.$lt{'newpass'}.'</label>') |
.'<input type="password" name="newpass_1" size="20" />' |
.'<input type="password" name="newpass_1" size="10" />' |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_title( |
.&Apache::lonhtmlcommon::row_title( |
'<label for="newpass_2">'.$lt{'confirmpass'}.'</label>') |
'<label for="newpass_2">'.$lt{'confirmpass'}.'</label>') |
.'<input type="password" name="newpass_2" size="20" />' |
.'<input type="password" name="newpass_2" size="10" />' |
.&Apache::lonhtmlcommon::row_closure(1) |
.&Apache::lonhtmlcommon::row_closure(1) |
.&Apache::lonhtmlcommon::end_pick_box(); |
.&Apache::lonhtmlcommon::end_pick_box(); |
$output .= '<p><input type="button" value="'.$lt{'changepass'}.'" onclick="send();" /></p>' |
$output .= '<p><input type="button" value="'.$lt{'changepass'}.'" onclick="send();" /></p>' |
Line 2122 push(@{ $menu[0]->{items} }, {
|
Line 2144 push(@{ $menu[0]->{items} }, {
|
linktitle => 'Change your password.', |
linktitle => 'Change your password.', |
}); |
}); |
} |
} |
if ($env{'environment.remote'} eq 'off') { |
|
push(@{ $menu[1]->{items} }, { |
|
linktext => 'Launch Remote Control', |
|
url => '/adm/remote?url=/adm/preferences&action=launch', |
|
permission => 'F', |
|
#help => '', |
|
icon => 'remotecontrol.png', |
|
linktitle => 'Launch the remote control for LON-CAPA.', |
|
}); |
|
}else{ |
|
push(@{ $menu[1]->{items} }, { |
|
linktext => 'Collapse Remote Control', |
|
url => '/adm/remote?url=/adm/preferences&action=collapse', |
|
permission => 'F', |
|
#help => '', |
|
icon => 'remotecontrol.png', |
|
linktitle => 'Collapse the remote control for LON-CAPA.', |
|
}); |
|
} |
|
|
|
if (&can_toggle_namelocking()) { |
if (&can_toggle_namelocking()) { |
push(@{ $menu[0]->{items} }, { |
push(@{ $menu[0]->{items} }, { |
Line 2179 push(@{ $menu[4]->{items} }, {
|
Line 2182 push(@{ $menu[4]->{items} }, {
|
|
|
} |
} |
|
|
my %author_coauthor_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au','ca','aa']); |
my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au','ca','aa']); |
if (keys(%author_coauthor_roles) > 0) { |
if (keys(%author_roles) > 0) { |
push(@{ $menu[4]->{items} }, { |
push(@{ $menu[4]->{items} }, { |
linktext => 'Authoring Space Configuration', |
linktext => 'Authoring Space Configuration', |
url => '/adm/preferences?action=authorsettings', |
url => '/adm/preferences?action=authorsettings', |
permission => 'F', |
permission => 'F', |
icon => 'codemirror.png', |
icon => 'course_ini.png', |
linktitle => 'Settings for your authoring space.', |
linktitle => 'Settings for your authoring space.', |
}); |
}); |
} |
} |
Line 2234 sub handler {
|
Line 2237 sub handler {
|
} else { |
} else { |
$brlink ='/adm/preferences'; |
$brlink ='/adm/preferences'; |
$brtxt = 'Set User Preferences'; |
$brtxt = 'Set User Preferences'; |
$brhelp = 'Prefs_About_Me,Prefs_Language,Prefs_Screen_Name_Nickname,Change_Colors,Change_Password,Prefs_Messages,Change_Discussion_Display'; |
$brhelp = 'Prefs_About_Me,Prefs_Language,Prefs_Screen_Name_Nickname,Change_Colors,Change_Password,Prefs_Messages,Change_Discussion_Display'; |
} |
} |
Apache::lonhtmlcommon::add_breadcrumb |
Apache::lonhtmlcommon::add_breadcrumb |
({href => $brlink, |
({href => $brlink, |
Line 2245 sub handler {
|
Line 2248 sub handler {
|
}elsif($env{'form.action'} eq 'changepass'){ |
}elsif($env{'form.action'} eq 'changepass'){ |
&passwordchanger($r); |
&passwordchanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_pass'){ |
}elsif($env{'form.action'} eq 'verify_and_change_pass'){ |
&verify_and_change_password($r,'preferences'); |
&verify_and_change_password($r); |
}elsif($env{'form.action'} eq 'changescreenname'){ |
}elsif($env{'form.action'} eq 'changescreenname'){ |
&screennamechanger($r); |
&screennamechanger($r); |
}elsif($env{'form.action'} eq 'verify_and_change_screenname'){ |
}elsif($env{'form.action'} eq 'verify_and_change_screenname'){ |