--- loncom/interface/lonpreferences.pm 2005/06/06 16:23:55 1.62
+++ loncom/interface/lonpreferences.pm 2005/08/16 16:31:09 1.67
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.62 2005/06/06 16:23:55 raeburn Exp $
+# $Id: lonpreferences.pm,v 1.67 2005/08/16 16:31:09 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -110,8 +110,8 @@ sub wysiwygchanger {
Examples:
- TeX to HTML
$tth_example
-
-
+ TeX to HTML
+
+
jsMath
-
+$jsMath_start
+
-$jsMath_example
- Convert to Images
$mimetex_example
+
+ Convert to Images
+
+
+
ENDLSCREEN
if ($env{'environment.texengine'} ne 'jsMath') {
$r->print('');
@@ -973,6 +974,73 @@ $message
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'} ne '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('
'.&mt('Set the page to be displayed when you select the role of Course Coordinator').':');
+ $r->print(<
+
+
+
+ENDLSCREEN
+ $r->print('
+');
+}
+
+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,7 +1221,22 @@ 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'} =~ /^(albertel|fox|foxr|koretemey|korte|hallmat3|turtle|raeburn)$/) {
push (@Options,({ action => 'debugtoggle',