version 1.84, 2006/05/08 18:50:27
|
version 1.87, 2006/06/14 18:54:23
|
Line 33
|
Line 33
|
package Apache::lonpreferences; |
package Apache::lonpreferences; |
|
|
use strict; |
use strict; |
|
use LONCAPA; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::File; |
use Apache::File; |
use Crypt::DES; |
use Crypt::DES; |
Line 879 sub discussionchanger {
|
Line 880 sub discussionchanger {
|
<form name="prefs" action="/adm/preferences" method="POST"> |
<form name="prefs" action="/adm/preferences" method="POST"> |
<input type="hidden" name="action" value="verify_and_change_discussion" /> |
<input type="hidden" name="action" value="verify_and_change_discussion" /> |
<br /> |
<br /> |
$lt{'sdpf'}<br/> $lt{'prca'} <ol><li>$lt{'whpo'}</li><li>$lt{'unwh'}</li></ol> |
$lt{'sdpf'}<br /> $lt{'prca'} <ol><li>$lt{'whpo'}</li><li>$lt{'unwh'}</li></ol> |
<br /> |
<br /> |
<br /> |
<br /> |
END |
END |
Line 926 sub verify_and_change_discussion {
|
Line 927 sub verify_and_change_discussion {
|
if (defined($env{'form.discdisp'}) ) { |
if (defined($env{'form.discdisp'}) ) { |
my $newdisp = $env{'form.newdisp'}; |
my $newdisp = $env{'form.newdisp'}; |
if ($newdisp eq 'unread') { |
if ($newdisp eq 'unread') { |
$message .='In discussions: only new posts will be displayed.<br/>'; |
$message .='In discussions: only new posts will be displayed.<br />'; |
&Apache::lonnet::put('environment',{'discdisplay' => $newdisp}); |
&Apache::lonnet::put('environment',{'discdisplay' => $newdisp}); |
&Apache::lonnet::appenv('environment.discdisplay' => $newdisp); |
&Apache::lonnet::appenv('environment.discdisplay' => $newdisp); |
} else { |
} else { |
$message .= 'In discussions: all posts will be displayed.<br/>'; |
$message .= 'In discussions: all posts will be displayed.<br />'; |
&Apache::lonnet::del('environment',['discdisplay']); |
&Apache::lonnet::del('environment',['discdisplay']); |
&Apache::lonnet::delenv('environment\.discdisplay'); |
&Apache::lonnet::delenv('environment\.discdisplay'); |
} |
} |
Line 938 sub verify_and_change_discussion {
|
Line 939 sub verify_and_change_discussion {
|
if (defined($env{'form.discmark'}) ) { |
if (defined($env{'form.discmark'}) ) { |
my $newmark = $env{'form.newmark'}; |
my $newmark = $env{'form.newmark'}; |
if ($newmark eq 'ondisp') { |
if ($newmark eq 'ondisp') { |
$message.='In discussions: new posts will be cease to be identified as "new" after display.<br/>'; |
$message.='In discussions: new posts will be cease to be identified as "new" after display.<br />'; |
&Apache::lonnet::put('environment',{'discmarkread' => $newmark}); |
&Apache::lonnet::put('environment',{'discmarkread' => $newmark}); |
&Apache::lonnet::appenv('environment.discmarkread' => $newmark); |
&Apache::lonnet::appenv('environment.discmarkread' => $newmark); |
} else { |
} else { |
$message.='In discussions: posts will be identified as "new" until marked as read by the reader.<br/>'; |
$message.='In discussions: posts will be identified as "new" until marked as read by the reader.<br />'; |
&Apache::lonnet::del('environment',['discmarkread']); |
&Apache::lonnet::del('environment',['discmarkread']); |
&Apache::lonnet::delenv('environment\.discmarkread'); |
&Apache::lonnet::delenv('environment\.discmarkread'); |
} |
} |
Line 1003 sub verify_and_change_coursepage {
|
Line 1004 sub verify_and_change_coursepage {
|
my $newdisp = $env{'form.newdisp'}; |
my $newdisp = $env{'form.newdisp'}; |
$message = '<b>'.$lt{'defs'}.'</b>: '.$lt{'when'}.', '; |
$message = '<b>'.$lt{'defs'}.'</b>: '.$lt{'when'}.', '; |
if ($newdisp eq 'firstres') { |
if ($newdisp eq 'firstres') { |
$message .= $lt{'ywbt'}.'<br/>'; |
$message .= $lt{'ywbt'}.'<br />'; |
&Apache::lonnet::put('environment',{'course_init_display' => $newdisp}); |
&Apache::lonnet::put('environment',{'course_init_display' => $newdisp}); |
&Apache::lonnet::appenv('environment.course_init_display' => $newdisp); |
&Apache::lonnet::appenv('environment.course_init_display' => $newdisp); |
} else { |
} else { |
$message .= $lt{'apwb'}.'<br/>'; |
$message .= $lt{'apwb'}.'<br />'; |
&Apache::lonnet::del('environment',['course_init_display']); |
&Apache::lonnet::del('environment',['course_init_display']); |
&Apache::lonnet::delenv('environment\.course_init_display'); |
&Apache::lonnet::delenv('environment\.course_init_display'); |
} |
} |
Line 1211 sub handler {
|
Line 1212 sub handler {
|
text => 'Change Math Preferences'}, |
text => 'Change Math Preferences'}, |
printmenu => 'yes', |
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'}) |
if (&Apache::lonnet::allowed('whn',$env{'request.course.id'}) |
|| &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/' |
|| &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/' |
.$env{'request.course.sec'})) { |
.$env{'request.course.sec'})) { |
Line 1277 sub handler {
|
Line 1291 sub handler {
|
foreach my $option(@Options) { |
foreach my $option(@Options) { |
my $optiontext = ''; |
my $optiontext = ''; |
if (exists($option->{'href'})) { |
if (exists($option->{'href'})) { |
$optiontext .= |
$option->{'href_args'}{'action'}=$option->{'action'}; |
'<a href="'.$option->{'href'}. |
$optiontext .= |
'?action='.$option->{'action'}.'">'. |
'<a href="'.&add_get_param($option->{'href'}, |
|
$option->{'href_args'}).'">'. |
&mt($option->{'linktext'}).'</a>'; |
&mt($option->{'linktext'}).'</a>'; |
} |
} |
if (exists($option->{'text'})) { |
if (exists($option->{'text'})) { |