--- loncom/interface/lonpreferences.pm 2005/06/06 02:29:46 1.60
+++ loncom/interface/lonpreferences.pm 2005/07/05 15:25:34 1.66
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.60 2005/06/06 02:29:46 albertel Exp $
+# $Id: lonpreferences.pm,v 1.66 2005/07/05 15:25:34 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -110,8 +110,8 @@ sub wysiwygchanger {
');
+}
+
+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'}.'
';
+ &Apache::lonnet::put('environment',{'course_init_display' => $newdisp});
+ &Apache::lonnet::appenv('environment.course_init_display' => $newdisp);
+ } else {
+ $message .= $lt{'when'}.', '.$lt{'apwb'}.'
';
+ &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 .= '
'.$lt{'gtts'}.' '.&mt('now').'';
+ } else {
+ $message .= '
'.$lt{'dasp'}.'';
+ }
+ }
+ $r->print(<
+ENDVCSCREEN
+}
+
+
######################################################
# other handler subroutines #
######################################################
@@ -1153,9 +1220,24 @@ sub handler {
text => 'Change Math Preferences'},
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'} =~ /^(megan|albertel|fox|foxr|koretemey|korte|hallmat3|turtle)$/) {
+ if ($env{'user.name'} =~ /^(albertel|fox|foxr|koretemey|korte|hallmat3|turtle|raeburn)$/) {
push (@Options,({ action => 'debugtoggle',
printmenu => 'yes',
subroutine => \&toggle_debug,
@@ -1191,7 +1273,7 @@ ENDHEADER
if (($printmenu eq 'yes') && (!$env{'form.returnurl'})) {
my $optionlist = '';
if ($env{'user.name'} =~
- /^(megan|albertel|kortemey|fox|foxr|korte|hallmat3|turtle)$/
+ /^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle|raeburn)$/
) {
push (@Options,({ action => 'debugtoggle',
linktext => 'Toggle Debug Messages',