--- loncom/interface/lonpreferences.pm 2005/06/06 16:23:55 1.62
+++ loncom/interface/lonpreferences.pm 2005/11/17 16:57:54 1.68
@@ -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.68 2005/11/17 16:57:54 www 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('');
@@ -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(<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',