ENDLSCREEN
if ($env{'environment.texengine'} ne 'jsMath') {
$r->print('');
@@ -402,7 +403,7 @@ sub verify_and_change_screenname {
&Apache::lonnet::delenv('environment\.nickname');
$message.='Reset nickname';
}
-
+ &Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain);
$r->print(< 'First resource',
+ whatsnew => "What's new page",
+ );
+ my $whatsnew_off=&mt('Display the [_1] in the course.','first resource');
+ my $whatsnew_on=&mt('Display the "[_1]" page - a summary of items in the course which require attention.',"What's New");
+
+ $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(<
+
+
+
+ENDLSCREEN
+ $r->print('
+');
+}
+
+sub verify_and_change_coursepage {
+ my $r = shift;
+ my $message='';
+ my %lt = &Apache::lonlocal::texthash(
+ 'defs' => 'Default now set',
+ 'when' => 'when you select a course 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 the What's New page listing course action items",
+ );
+ my $newdisp = $env{'form.newdisp'};
+ $message = ''.$lt{'defs'}.': '.$lt{'when'}.', ';
+ if ($newdisp eq 'firstres') {
+ $message .= $lt{'ywbt'}.' ';
+ &Apache::lonnet::put('environment',{'course_init_display' => $newdisp});
+ &Apache::lonnet::appenv('environment.course_init_display' => $newdisp);
+ } else {
+ $message .= $lt{'apwb'}.' ';
+ &Apache::lonnet::del('environment',['course_init_display']);
+ &Apache::lonnet::delenv('environment\.course_init_display');
+ }
+ my $refpage = $env{'form.refpage'};
+ 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 #
######################################################
@@ -991,7 +1070,7 @@ sub handler {
return OK if $r->header_only;
#
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['action','wysiwyg','returnurl']);
+ ['action','wysiwyg','returnurl','refpage']);
#
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb
@@ -1153,7 +1232,22 @@ sub handler {
text => 'Change Math Preferences'},
printmenu => 'yes',
}));
-
+ if ($env{'user.adv'}) {
+ 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)$/) {
push (@Options,({ action => 'debugtoggle',