version 1.61, 2005/06/06 02:32:36
|
version 1.63, 2005/06/06 22:39:59
|
Line 973 $message
|
Line 973 $message
|
ENDVCSCREEN |
ENDVCSCREEN |
} |
} |
|
|
|
################################################################ |
|
# Subroutines for page display on course access (Course Coordinators) |
|
################################################################ |
|
sub coursedisplaychanger { |
|
my $r = shift; |
|
my $user = $env{'user.name'}; |
|
my $domain = $env{'user.domain'}; |
|
my %userenv = &Apache::lonnet::get |
|
('environment',['course_init_display']); |
|
|
|
my $firstselect='checked="checked"'; |
|
my $whatsnewselect=''; |
|
if ($userenv{'course_init_display'} eq 'firstres') { |
|
$firstselect=''; |
|
$whatsnewselect='checked="checked"'; |
|
} |
|
my $whatsnew_off=&mt('Display the first resource in the course.'); |
|
my $whatsnew_on=&mt('Display a summary of items in the course which require action from the course coordinator.'); |
|
|
|
$r->print('<br /><b>'.&mt('Set the page to be displayed when you select the role of Course Coordinator').':</b>'); |
|
$r->print(<<ENDLSCREEN); |
|
<form name="server" action="/adm/preferences" method="post"> |
|
<input type="hidden" name="action" value="verify_and_change_coursepage" /> |
|
<input type="radio" name="newdisp" value="firstres" $firstselect /> $whatsnew_off<br /> |
|
<input type="radio" name="newdisp" value="whatsnew" $whatsnewselect /> $whatsnew_on |
|
ENDLSCREEN |
|
$r->print('<br /><input type="submit" value="'.&mt('Change').'" /> |
|
</form>'); |
|
} |
|
|
|
sub verify_and_change_coursepage { |
|
my $r = shift; |
|
my $message=''; |
|
my %lt = &Apache::lonlocal::texthash( |
|
'when' => 'Whenever you select the Course Coordinator role from the roles screen', |
|
'ywbt' => 'you will be taken to the start of the course.', |
|
'apwb' => 'a page will be displayed that lists items in the course that may require action from you.', |
|
'gtts' => 'Go to the start of the course', |
|
'dasp' => 'Display a summary page listing course action items', |
|
); |
|
my $newdisp = $env{'form.newdisp'}; |
|
if ($newdisp eq 'firstres') { |
|
$message .= $lt{'when'}.', '.$lt{'ywbt'}.'<br/>'; |
|
&Apache::lonnet::put('environment',{'course_init_display' => $newdisp}); |
|
&Apache::lonnet::appenv('environment.course_init_display' => $newdisp); |
|
} else { |
|
$message .= $lt{'when'}.', '.$lt{'apwb'}.'<br/>'; |
|
&Apache::lonnet::del('environment',['course_init_display']); |
|
&Apache::lonnet::delenv('environment\.course_init_display'); |
|
} |
|
if (($env{'request.course.fn'}) && ($env{'request.course.id'})) { |
|
if ($newdisp eq 'firstres') { |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my ($furl,$ferr)= |
|
&Apache::lonuserstate::readmap($cdom.'/'.$cnum); |
|
$message .= '<br /><font size="+1"><a href="'.$furl.'">'.$lt{'gtts'}.' <i>'.&mt('now').'</i></a></font>'; |
|
} else { |
|
$message .= '<br /><font size="+1"><a href="/adm/whatsnew">'.$lt{'dasp'}.'</a></font>'; |
|
} |
|
} |
|
$r->print(<<ENDVCSCREEN); |
|
$message |
|
<br /><br /> |
|
ENDVCSCREEN |
|
} |
|
|
|
|
###################################################### |
###################################################### |
# other handler subroutines # |
# other handler subroutines # |
###################################################### |
###################################################### |
Line 1153 sub handler {
|
Line 1221 sub handler {
|
text => 'Change Math Preferences'}, |
text => 'Change Math Preferences'}, |
printmenu => 'yes', |
printmenu => 'yes', |
})); |
})); |
|
if($env{'request.role'} =~ /^cc\.\//) { |
|
push (@Options,({ action => 'changecourseinit', |
|
linktext => 'Change Course Initialization Preference', |
|
href => '/adm/preferences', |
|
subroutine => \&coursedisplaychanger, |
|
breadcrumb => |
|
{ href => '/adm/preferences?action=changecourseinit', |
|
text => 'Change Course Init. Pref.'}, |
|
}, |
|
{ action => 'verify_and_change_coursepage', |
|
breadcrumb => |
|
{ href => '/adm/preferences?action=changecourseinit', text => 'Change Course Initialization Preference'}, |
|
printmenu => 'yes', |
|
subroutine => \&verify_and_change_coursepage, |
|
})); |
|
} |
|
|
|
if ($env{'user.name'} =~ /^(albertel|fox|foxr|koretemey|korte|hallmat3|turtle|raeburn)$/) { |
if ($env{'user.name'} =~ /^(albertel|fox|foxr|koretemey|korte|hallmat3|turtle)$/) { |
|
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
printmenu => 'yes', |
printmenu => 'yes', |
subroutine => \&toggle_debug, |
subroutine => \&toggle_debug, |
Line 1191 ENDHEADER
|
Line 1274 ENDHEADER
|
if (($printmenu eq 'yes') && (!$env{'form.returnurl'})) { |
if (($printmenu eq 'yes') && (!$env{'form.returnurl'})) { |
my $optionlist = '<table cellpadding="5">'; |
my $optionlist = '<table cellpadding="5">'; |
if ($env{'user.name'} =~ |
if ($env{'user.name'} =~ |
/^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle)$/ |
/^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle|raeburn)$/ |
) { |
) { |
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
linktext => 'Toggle Debug Messages', |
linktext => 'Toggle Debug Messages', |