--- loncom/interface/lonpreferences.pm 2006/01/06 21:04:34 1.74 +++ loncom/interface/lonpreferences.pm 2006/03/24 18:09:27 1.79 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.74 2006/01/06 21:04:34 albertel Exp $ +# $Id: lonpreferences.pm,v 1.79 2006/03/24 18:09:27 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -98,16 +98,16 @@ sub wysiwygchanger { my $r = shift; my %userenv = &Apache::lonnet::get ('environment',['wysiwygeditor']); + my $onselect='checked="checked"'; my $offselect=''; - my $onselect='checked="1"'; - if ($userenv{'wysiwygeditor'}) { + if ($userenv{'wysiwygeditor'} eq 'on') { $onselect=''; - $offselect='checked="1"'; + $offselect='checked="checked"'; } my $switchoff=&mt('Disable WYSIWYG editor'); my $switchon=&mt('Enable WYSIWYG editor'); $r->print(< +


@@ -147,7 +147,7 @@ sub languagechanger { my $selectionbox=&Apache::loncommon::select_form($language,'language', %langchoices); $r->print(< +
$pref: $selectionbox ENDLSCREEN @@ -201,14 +201,14 @@ sub texenginechanger { $r->print(< - +

$pref: $selectionbox

Examples:

TeX to HTML
- +

jsMath
$jsMath_start @@ -228,12 +228,12 @@ if (jsMath.nofonts == 1) { +''); } - +

Convert to Images

- +

ENDLSCREEN if ($env{'environment.texengine'} ne 'jsMath') { @@ -304,7 +304,7 @@ visited and places a table of these at t People with very few roles should leave this feature disabled.

-
+
Enable Recent Roles Hotlist: @@ -362,7 +362,7 @@ sub screennamechanger { my $screenname=$userenv{'screenname'}; my $nickname=$userenv{'nickname'}; $r->print(< +
New screenname (shown if you post anonymously): @@ -430,7 +430,7 @@ sub msgforwardchanger { $r->print(< - + New Forwarding Address(es) (user:domain,user:domain,...):
@@ -550,7 +550,7 @@ sub colorschanger { pclose(); if (document.parmform.pres_marker.value!='') { if (document.parmform.pres_type.value!='') { - eval('document.server.'+ + eval('document.prefs.'+ document.parmform.pres_marker.value+ '.value=document.parmform.pres_value.value;'); } @@ -567,7 +567,7 @@ sub colorschanger { -
+ $chtable @@ -617,7 +617,7 @@ sub verify_and_change_colors { } $r->print(< + ENDVCCOL @@ -659,8 +659,6 @@ sub passwordchanger { $lkey_npass2= hex($lkey_npass2); # Output javascript to deal with passwords # Output DES javascript - my $html=&Apache::lonxml::xmlbegin(); - $r->print($html.""); { my $include = $r->dir_config('lonIncludes'); my $jsh=Apache::File->new($include."/londes.js"); @@ -700,7 +698,7 @@ $errormessage ensure that unencrypted passwords will not be sent out by a crappy browser --> -
+ @@ -741,14 +739,6 @@ sub verify_and_change_password { # Check for authentication types that allow changing of the password. return if ($currentauth !~ /^(unix|internal):/); # - my $html=&Apache::lonxml::xmlbegin(); - $r->print(< -LON-CAPA Preferences: Change password for $user - -ENDHEADER - # my $currentpass = $env{'form.currentpass'}; my $newpass1 = $env{'form.newpass_1'}; my $newpass2 = $env{'form.newpass_2'}; @@ -773,7 +763,7 @@ password decryption. Please log out and

ENDERROR # Probably should log an error here - return; + return 1; } my ($ckey,$n1key,$n2key)=split(/&/,$tmpinfo); # @@ -786,14 +776,14 @@ ENDERROR 'ERROR:'. 'The new passwords you entered do not match. '. 'Please try again.'); - return; + return 1; } if (length($newpass1) < 7) { &passwordchanger($r, 'ERROR:'. 'Passwords must be a minimum of 7 characters long. '. 'Please try again.'); - return; + return 1; } # # Check for bad characters @@ -828,6 +818,7 @@ ENDTEXT

The password for $user was not changed

Please make sure your old password was entered correctly. ENDERROR + return 1; } return; } @@ -896,7 +887,7 @@ sub discussionchanger { } $r->print(<<"END"); - +
$lt{'sdpf'}
$lt{'prca'}
  1. $lt{'whpo'}
  2. $lt{'unwh'}
@@ -1001,7 +992,7 @@ sub coursedisplaychanger { $r->print('
'.&mt('Set the default page to be displayed when you select a course role').' '.&mt('(Currently: [_1])',$pagenames{$currvalue}).'
'.&mt('The global user preference you set for your courses can be overridden in an individual course by setting a course specific setting via the "[_1]" page in the course',"What's New").'

'); $r->print(< +

@@ -1096,7 +1087,7 @@ sub handler { breadcrumb => { href =>'/adm/preferences?action=changepass', text => 'Change Password'}, - printmenu => 'yes', + printmenu => 'not_on_error', })); } push (@Options,({ action => 'changescreenname', @@ -1258,13 +1249,9 @@ sub handler { subroutine => \&toggle_debug, })); } - my $html=&Apache::lonxml::xmlbegin(); - $r->print(< -LON-CAPA Preferences - -ENDHEADER + + $r->print(&Apache::loncommon::start_page('Change Preferences')); + my $call = undef; my $help = undef; my $printmenu = 'yes'; @@ -1279,13 +1266,15 @@ ENDHEADER $help=$option->{'help'}; } } - $r->print(&Apache::loncommon::bodytag('Change Preferences')); $r->print(&Apache::lonhtmlcommon::breadcrumbs (undef,'Change Preferences',$help)); + my $error; if (defined($call)) { - $call->($r); + $error = $call->($r); } - if (($printmenu eq 'yes') && (!$env{'form.returnurl'})) { + if ( ( ($printmenu eq 'yes') + || ($printmenu eq 'not_on_error' && !$error) ) + && (!$env{'form.returnurl'})) { my $optionlist = '
'; if ($env{'user.name'} =~ /^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle|raeburn)$/ @@ -1329,7 +1318,7 @@ ENDHEADER $r->print('
'. &mt('Return').''); } - $r->print(&Apache::loncommon::endbodytag().''); + $r->print(&Apache::loncommon::end_page()); return OK; }