--- loncom/interface/lonpreferences.pm 2006/03/15 22:11:04 1.76 +++ loncom/interface/lonpreferences.pm 2006/05/01 19:37:34 1.81 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.76 2006/03/15 22:11:04 albertel Exp $ +# $Id: lonpreferences.pm,v 1.81 2006/05/01 19:37:34 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,...):
@@ -505,17 +505,7 @@ ENDVCMSG sub colorschanger { my $r = shift; # figure out colors - my $function='student'; - if ($env{'request.role'}=~/^(cc|in|ta|ep)/) { - $function='coordinator'; - } - if ($env{'request.role'}=~/^(su|dc|ad|li)/) { - $function='admin'; - } - if (($env{'request.role'}=~/^(au|ca)/) || - ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) { - $function='author'; - } + my $function=&Apache::loncommon::get_users_function(); my $domain=&Apache::loncommon::determinedomain(); my %colortypes=('pgbg' => 'Page Background', 'tabbg' => 'Header Background', @@ -550,7 +540,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 +557,7 @@ sub colorschanger { -
+ $chtable @@ -581,17 +571,7 @@ ENDCOL sub verify_and_change_colors { my $r = shift; # figure out colors - my $function='student'; - if ($env{'request.role'}=~/^(cc|in|ta|ep)/) { - $function='coordinator'; - } - if ($env{'request.role'}=~/^(su|dc|ad|li)/) { - $function='admin'; - } - if (($env{'request.role'}=~/^(au|ca)/) || - ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) { - $function='author'; - } + my $function=&Apache::loncommon::get_users_function(); my $domain=&Apache::loncommon::determinedomain(); my %colortypes=('pgbg' => 'Page Background', 'tabbg' => 'Header Background', @@ -617,7 +597,7 @@ sub verify_and_change_colors { } $r->print(< + ENDVCCOL @@ -698,7 +678,7 @@ $errormessage ensure that unencrypted passwords will not be sent out by a crappy browser --> -
+ @@ -887,7 +867,7 @@ sub discussionchanger { } $r->print(<<"END"); - +
$lt{'sdpf'}
$lt{'prca'}
  1. $lt{'whpo'}
  2. $lt{'unwh'}
@@ -992,7 +972,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(< +

@@ -1266,8 +1246,7 @@ sub handler { $help=$option->{'help'}; } } - $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Change Preferences',$help)); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Change Preferences',$help)); my $error; if (defined($call)) { $error = $call->($r);