--- loncom/interface/lonpreferences.pm 2006/05/01 22:54:43 1.83 +++ loncom/interface/lonpreferences.pm 2006/06/14 18:56:58 1.88 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.83 2006/05/01 22:54:43 albertel Exp $ +# $Id: lonpreferences.pm,v 1.88 2006/06/14 18:56:58 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,6 +33,7 @@ package Apache::lonpreferences; use strict; +use LONCAPA; use Apache::Constants qw(:common); use Apache::File; use Crypt::DES; @@ -107,7 +108,7 @@ sub wysiwygchanger { my $switchoff=&mt('Disable WYSIWYG editor'); my $switchon=&mt('Enable WYSIWYG editor'); $r->print(< +


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

$pref: $selectionbox

@@ -304,7 +305,7 @@ visited and places a table of these at t People with very few roles should leave this feature disabled.

- +
@@ -362,7 +363,7 @@ sub screennamechanger { my $screenname=$userenv{'screenname'}; my $nickname=$userenv{'nickname'}; $r->print(< +
New screenname (shown if you post anonymously): @@ -430,7 +431,7 @@ sub msgforwardchanger { $r->print(< - + New Forwarding Address(es) (user:domain,user:domain,...):
@@ -561,7 +562,7 @@ sub colorschanger { -
+ $start_data_table $chtable @@ -600,9 +601,13 @@ sub verify_and_change_colors { $message.='Reset '.$colortypes{$item}.'
'; } } + my $now = time; + &Apache::lonnet::put('environment',{'color.timestamp' => $now}); + &Apache::lonnet::appenv('environment.color.timestamp' => $now); + $r->print(< + ENDVCCOL @@ -683,7 +688,7 @@ $errormessage ensure that unencrypted passwords will not be sent out by a crappy browser --> -
+ @@ -872,10 +877,10 @@ sub discussionchanger { } $r->print(<<"END"); - +
-$lt{'sdpf'}
$lt{'prca'}
  1. $lt{'whpo'}
  2. $lt{'unwh'}
+$lt{'sdpf'}
$lt{'prca'}
  1. $lt{'whpo'}
  2. $lt{'unwh'}


END @@ -922,11 +927,11 @@ sub verify_and_change_discussion { if (defined($env{'form.discdisp'}) ) { my $newdisp = $env{'form.newdisp'}; if ($newdisp eq 'unread') { - $message .='In discussions: only new posts will be displayed.
'; + $message .='In discussions: only new posts will be displayed.
'; &Apache::lonnet::put('environment',{'discdisplay' => $newdisp}); &Apache::lonnet::appenv('environment.discdisplay' => $newdisp); } else { - $message .= 'In discussions: all posts will be displayed.
'; + $message .= 'In discussions: all posts will be displayed.
'; &Apache::lonnet::del('environment',['discdisplay']); &Apache::lonnet::delenv('environment\.discdisplay'); } @@ -934,11 +939,11 @@ sub verify_and_change_discussion { if (defined($env{'form.discmark'}) ) { my $newmark = $env{'form.newmark'}; if ($newmark eq 'ondisp') { - $message.='In discussions: new posts will be cease to be identified as "new" after display.
'; + $message.='In discussions: new posts will be cease to be identified as "new" after display.
'; &Apache::lonnet::put('environment',{'discmarkread' => $newmark}); &Apache::lonnet::appenv('environment.discmarkread' => $newmark); } else { - $message.='In discussions: posts will be identified as "new" until marked as read by the reader.
'; + $message.='In discussions: posts will be identified as "new" until marked as read by the reader.
'; &Apache::lonnet::del('environment',['discmarkread']); &Apache::lonnet::delenv('environment\.discmarkread'); } @@ -975,7 +980,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(< +

@@ -999,11 +1004,11 @@ sub verify_and_change_coursepage { my $newdisp = $env{'form.newdisp'}; $message = ''.$lt{'defs'}.': '.$lt{'when'}.', '; if ($newdisp eq 'firstres') { - $message .= $lt{'ywbt'}.'
'; + $message .= $lt{'ywbt'}.'
'; &Apache::lonnet::put('environment',{'course_init_display' => $newdisp}); &Apache::lonnet::appenv('environment.course_init_display' => $newdisp); } else { - $message .= $lt{'apwb'}.'
'; + $message .= $lt{'apwb'}.'
'; &Apache::lonnet::del('environment',['course_init_display']); &Apache::lonnet::delenv('environment\.course_init_display'); } @@ -1207,6 +1212,19 @@ sub handler { text => 'Change Math Preferences'}, printmenu => 'yes', })); + + if ($env{'environment.remote'} eq 'off') { + push (@Options,({ action => 'launch', + linktext => 'Launch Remote Control', + href => '/adm/remote?url=/adm/preferences', + })); + } else { + push (@Options,({ action => 'collapse', + linktext => 'Collapse Remote Control', + href => '/adm/remote?url=/adm/preferences', + })); + } + if (&Apache::lonnet::allowed('whn',$env{'request.course.id'}) || &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/' .$env{'request.course.sec'})) { @@ -1273,9 +1291,10 @@ sub handler { foreach my $option(@Options) { my $optiontext = ''; if (exists($option->{'href'})) { - $optiontext .= - ''. + $option->{'href_args'}{'action'}=$option->{'action'}; + $optiontext .= + ''. &mt($option->{'linktext'}).''; } if (exists($option->{'text'})) {