--- loncom/interface/lonpreferences.pm 2005/06/06 02:29:46 1.60 +++ loncom/interface/lonpreferences.pm 2005/12/09 23:48:06 1.69 @@ -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.69 2005/12/09 23:48:06 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,8 +110,8 @@ sub wysiwygchanger {

- $switchoff
- $switchon +
+ ENDLSCREEN $r->print('
'); } @@ -188,33 +188,30 @@ sub texenginechanger { my $texengine=$userenv{'texengine'}; my $pref=&mt('Preferred method to display Math'); - my %mathchoices=('' => 'No Preference', + my %mathchoices=('' => 'Default', 'tth' => 'TeX to HTML', - 'ttm' => 'TeX to MathML', + #'ttm' => 'TeX to MathML', 'jsMath' => 'jsMath', 'mimetex' => 'Convert to Images' ); my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine', %mathchoices); - my $mathexample='$$\int\left(\frac{a+b}{c^6*d}\right)$$'; - my $jsMath_example=&Apache::lontexconvert::jsMath_converted(\$mathexample); - $mathexample='$$\int\left(\frac{a+b}{c^6*d}\right)$$'; - my $tth_example=&Apache::lontexconvert::tth_converted(\$mathexample); - $mathexample='$$\int\left(\frac{a+b}{c^6*d}\right)$$'; - my $mimetex_example=&Apache::lontexconvert::mimetex_converted(\$mathexample); + my $jsMath_start=&Apache::lontexconvert::jsMath_header(); my $change=&mt('Change'); $r->print(< +

$pref: $selectionbox

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,9 +1221,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 +1274,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',