version 1.36, 2004/03/08 17:31:37
|
version 1.42, 2004/05/11 10:42:41
|
Line 25
|
Line 25
|
# |
# |
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
# (Internal Server Error Handler |
|
# |
|
# (Login Screen |
|
# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14, |
|
# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer) |
|
# |
|
# 3/1/1 Gerd Kortemeyer) |
|
# |
|
# 3/1 Gerd Kortemeyer |
|
# |
|
# 2/13/02 2/14 2/15 Matthew Hall |
|
# |
|
# This package uses the "londes.js" javascript code. |
# This package uses the "londes.js" javascript code. |
# |
# |
# TODOs that have to be completed: |
# TODOs that have to be completed: |
Line 638 ENDERROR
|
Line 626 ENDERROR
|
return; |
return; |
} |
} |
|
|
|
################################################################ |
|
# discussion display subroutines |
|
################################################################ |
|
sub discussionchanger { |
|
my $r = shift; |
|
my $user = $ENV{'user.name'}; |
|
my $domain = $ENV{'user.domain'}; |
|
my %userenv = &Apache::lonnet::get |
|
('environment',['discdisplay']); |
|
my $discdisplay=$userenv{'discdisplay'}; |
|
my $discchange = 'unread'; |
|
my $alllong = &mt('all posts'); |
|
my $unreadlong = &mt('only unread posts'); |
|
my $discbutton = $unreadlong; |
|
my $currdisc = $alllong; |
|
if ($discdisplay eq 'unread') { |
|
$discchange = 'allposts'; |
|
$discbutton = $alllong; |
|
$currdisc = $unreadlong; |
|
} |
|
$r->print(<<ENDLSCREEN); |
|
<form name="server" action="/adm/preferences" method="post"> |
|
<input type="hidden" name="action" value="verify_and_change_discussion" /> |
|
<br /> |
|
ENDLSCREEN |
|
$r->print( |
|
&mt('You can set a display preference for discussion posts for both bulletin boards and individual resources in all your courses.').'<br/>'. |
|
&mt('This default preference can be overridden within each individual discussion.').'<br/><br />'. |
|
&mt('Your discussion post display preference is currently set to display').' '.$currdisc. |
|
'.<br /><br /><input type="hidden" name="discdisplay" value="'. |
|
$discchange.'" /><input type="submit" value="'. |
|
&mt('Change to display').' '.$discbutton.'" /></form>' |
|
); |
|
} |
|
|
|
sub verify_and_change_discussion { |
|
my $r = shift; |
|
my $user = $ENV{'user.name'}; |
|
my $domain = $ENV{'user.domain'}; |
|
# Discussion |
|
my $discdisplay = $ENV{'form.discdisplay'}; |
|
my $message=''; |
|
if ($discdisplay eq 'unread') { |
|
&Apache::lonnet::put('environment',{'discdisplay' => $discdisplay}); |
|
&Apache::lonnet::appenv('environment.discdisplay' => $discdisplay); |
|
$message='Discussions set to display only unread posts'; |
|
} else { |
|
&Apache::lonnet::del('environment',['discdisplay']); |
|
&Apache::lonnet::delenv('environment\.discdisplay'); |
|
$message='Discussions set to display all posts'; |
|
} |
|
$r->print(<<ENDVCSCREEN); |
|
</p> |
|
$message |
|
ENDVCSCREEN |
|
} |
|
|
###################################################### |
###################################################### |
# other handler subroutines # |
# other handler subroutines # |
###################################################### |
###################################################### |
Line 668 sub handler {
|
Line 713 sub handler {
|
my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain); |
my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain); |
if ($currentauth =~ /^(unix|internal):/) { |
if ($currentauth =~ /^(unix|internal):/) { |
push (@Options,({ action => 'changepass', |
push (@Options,({ action => 'changepass', |
linktext => 'Change password', |
linktext => 'Change Password', |
href => '/adm/preferences', |
href => '/adm/preferences', |
help => 'Change_Password', |
help => 'Change_Password', |
subroutine => \&passwordchanger, |
subroutine => \&passwordchanger, |
Line 721 sub handler {
|
Line 766 sub handler {
|
'/adm/'.$ENV{'user.domain'}.'/'.$ENV{'user.name'}.'/aboutme'; |
'/adm/'.$ENV{'user.domain'}.'/'.$ENV{'user.name'}.'/aboutme'; |
push (@Options,{ action => 'none', |
push (@Options,{ action => 'none', |
linktext => |
linktext => |
q{Edit the 'About Me' personal information screen}, |
q{Edit the 'About Me' Personal Information Screen}, |
href => $aboutmeaction}); |
href => $aboutmeaction}); |
push (@Options,({ action => 'changecolors', |
push (@Options,({ action => 'changecolors', |
linktext => 'Change Color Scheme', |
linktext => 'Change Color Scheme', |
Line 740 sub handler {
|
Line 785 sub handler {
|
subroutine => \&verify_and_change_colors, |
subroutine => \&verify_and_change_colors, |
})); |
})); |
push (@Options,({ action => 'changelanguages', |
push (@Options,({ action => 'changelanguages', |
linktext => 'Change Language Prefences', |
linktext => 'Change Language Preferences', |
href => '/adm/preferences', |
href => '/adm/preferences', |
breadcrumb=> |
breadcrumb=> |
{ href => '/adm/preferences?action=changelanguages', |
{ href => '/adm/preferences?action=changelanguages', |
Line 754 sub handler {
|
Line 799 sub handler {
|
printmenu => 'yes', |
printmenu => 'yes', |
subroutine=>\&verify_and_change_languages, } |
subroutine=>\&verify_and_change_languages, } |
)); |
)); |
|
push (@Options,({ action => 'changediscussions', |
|
linktext => 'Change Discussion Display Preferences', |
|
href => '/adm/preferences', |
|
breadcrumb => |
|
{ href => '/adm/preferences?action=changediscussions', |
|
text => 'Change Discussions'}, |
|
subroutine => \&discussionchanger, |
|
}, |
|
{ action => 'verify_and_change_discussion', |
|
breadcrumb => |
|
{ href => '/adm/preferences?action=changediscussions', |
|
text => 'Change Discussions'}, |
|
printmenu => 'yes', |
|
subroutine => \&verify_and_change_discussion, } |
|
)); |
|
|
if ($ENV{'user.name'} =~ /^(albertel|koretemey|korte|hallmat3|turtle)$/) { |
if ($ENV{'user.name'} =~ /^(albertel|koretemey|korte|hallmat3|turtle)$/) { |
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
printmenu => 'yes', |
printmenu => 'yes', |
Line 770 ENDHEADER
|
Line 831 ENDHEADER
|
my $printmenu = 'yes'; |
my $printmenu = 'yes'; |
foreach my $option (@Options) { |
foreach my $option (@Options) { |
if ($option->{'action'} eq $ENV{'form.action'}) { |
if ($option->{'action'} eq $ENV{'form.action'}) { |
&Apache::lonnet::logthis('got action '.$option->{'action'}); |
|
$call = $option->{'subroutine'}; |
$call = $option->{'subroutine'}; |
$printmenu = $option->{'printmenu'}; |
$printmenu = $option->{'printmenu'}; |
if (exists($option->{'breadcrumb'})) { |
if (exists($option->{'breadcrumb'})) { |
Line 788 ENDHEADER
|
Line 848 ENDHEADER
|
if ($printmenu eq 'yes') { |
if ($printmenu eq 'yes') { |
my $optionlist = '<table cellpadding="5">'; |
my $optionlist = '<table cellpadding="5">'; |
if ($ENV{'user.name'} =~ |
if ($ENV{'user.name'} =~ |
/^(albertel|koretemey|korte|hallmat3|turtle)$/ |
/^(albertel|kortemey|korte|hallmat3|turtle)$/ |
) { |
) { |
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
linktext => 'Toggle Debug Messages', |
linktext => 'Toggle Debug Messages', |