--- loncom/interface/lonpreferences.pm 2005/12/19 21:39:37 1.70 +++ loncom/interface/lonpreferences.pm 2006/01/06 19:05:30 1.73 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.70 2005/12/19 21:39:37 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.73 2006/01/06 19:05:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -982,20 +982,28 @@ sub coursedisplaychanger { 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'} ne 'firstres') { - $firstselect=''; - $whatsnewselect='checked="checked"'; + my $currvalue = 'whatsnew'; + my $firstselect = ''; + my $whatsnewselect = 'checked="checked"'; + if (exists($userenv{'course_init_display'})) { + if ($userenv{'course_init_display'} eq 'firstres') { + $currvalue = 'firstres'; + $firstselect = 'checked="checked"'; + $whatsnewselect = ''; + } } + my %pagenames = ( + firstres => '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 other than student or TA').':
'.&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('
'.&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 @@ -1008,7 +1016,7 @@ sub verify_and_change_coursepage { my $message=''; my %lt = &Apache::lonlocal::texthash( 'defs' => 'Default now set', - 'when' => 'when selecting a course role other than student or TA from the roles screen', + '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', @@ -1225,7 +1233,7 @@ sub handler { text => 'Change Math Preferences'}, printmenu => 'yes', })); - if($env{'request.role'} =~ /^cc\.\//) { + if ($env{'user.adv'}) { push (@Options,({ action => 'changecourseinit', linktext => 'Change Course Initialization Preference', href => '/adm/preferences',