version 1.59, 2005/04/07 06:56:23
|
version 1.69.2.1, 2005/12/28 21:40:25
|
Line 110 sub wysiwygchanger {
|
Line 110 sub wysiwygchanger {
|
<form name="server" action="/adm/preferences" method="post"> |
<form name="server" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="set_wysiwyg" /> |
<input type="hidden" name="action" value="set_wysiwyg" /> |
<br /> |
<br /> |
<input type="radio" name="wysiwyg" value="off" $onselect /> $switchoff<br /> |
<label><input type="radio" name="wysiwyg" value="off" $onselect /> $switchoff</label><br /> |
<input type="radio" name="wysiwyg" value="on" $offselect /> $switchon |
<label><input type="radio" name="wysiwyg" value="on" $offselect /> $switchon</label> |
ENDLSCREEN |
ENDLSCREEN |
$r->print('<br /><input type="submit" value="'.&mt('Change').'" />'); |
$r->print('<br /><input type="submit" value="'.&mt('Change').'" />'); |
} |
} |
Line 188 sub texenginechanger {
|
Line 188 sub texenginechanger {
|
my $texengine=$userenv{'texengine'}; |
my $texengine=$userenv{'texengine'}; |
|
|
my $pref=&mt('Preferred method to display Math'); |
my $pref=&mt('Preferred method to display Math'); |
my %mathchoices=('' => 'No Preference', |
my %mathchoices=('' => 'Default', |
'tth' => 'TeX to HTML', |
'tth' => 'TeX to HTML', |
'ttm' => 'TeX to MathML', |
#'ttm' => 'TeX to MathML', |
'jsMath' => 'jsMath', |
'jsMath' => 'jsMath', |
'mimetex' => 'Convert to Images' |
'mimetex' => 'Convert to Images' |
); |
); |
my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine', |
my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine', |
%mathchoices); |
%mathchoices); |
my $mathexample='$$\int\left(\frac{a+b}{c^6*d}\right)$$'; |
my $jsMath_start=&Apache::lontexconvert::jsMath_header(); |
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 $change=&mt('Change'); |
my $change=&mt('Change'); |
$r->print(<<ENDLSCREEN); |
$r->print(<<ENDLSCREEN); |
|
<br /> |
|
|
<form name="server" action="/adm/preferences" method="post"> |
<form name="server" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_texengine" /> |
<input type="hidden" name="action" value="verify_and_change_texengine" /> |
<p>$pref: $selectionbox</p> |
<p>$pref: $selectionbox</p> |
<p><input type="submit" value="$change" /></p> |
<p><input type="submit" value="$change" /></p> |
</form> |
</form> |
Examples: |
Examples: |
<p> TeX to HTML <br /> $tth_example</p> |
<p> TeX to HTML <br /> |
<script type="text/javascript">function NoFontMessage () { }</script> |
<iframe src="/res/adm/pages/math_example.tex?buttons=no&mode=tth" width="400" hieght="200"></iframe> |
<script src="/adm/jsMath/jsMath.js"></script> |
</p> |
<p>jsMath <br /> |
<p>jsMath <br /> |
|
$jsMath_start |
<script type="text/javascript"> |
<script type="text/javascript"> |
if (jsMath.nofonts == 1) { |
if (jsMath.nofonts == 1) { |
document.writeln |
document.writeln |
Line 231 if (jsMath.nofonts == 1) {
|
Line 228 if (jsMath.nofonts == 1) {
|
+'</font></small></div></center>'); |
+'</font></small></div></center>'); |
} |
} |
</script> |
</script> |
|
<iframe src="/res/adm/pages/math_example.tex?buttons=no&mode=jsMath" width="400" hieght="200"></iframe> |
|
|
$jsMath_example</p> |
</p> |
<p> Convert to Images <br /> $mimetex_example</p> |
<p> Convert to Images <br /> |
|
<br /> |
|
<iframe src="/res/adm/pages/math_example.tex?buttons=no&mode=mimetex" width="400" hieght="200"></iframe> |
|
</p> |
ENDLSCREEN |
ENDLSCREEN |
if ($env{'environment.texengine'} ne 'jsMath') { |
if ($env{'environment.texengine'} ne 'jsMath') { |
$r->print('<script type="text/javascript">jsMath.Process()</script>'); |
$r->print('<script type="text/javascript">jsMath.Process()</script>'); |
Line 402 sub verify_and_change_screenname {
|
Line 403 sub verify_and_change_screenname {
|
&Apache::lonnet::delenv('environment\.nickname'); |
&Apache::lonnet::delenv('environment\.nickname'); |
$message.='Reset nickname'; |
$message.='Reset nickname'; |
} |
} |
|
&Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain); |
$r->print(<<ENDVCSCREEN); |
$r->print(<<ENDVCSCREEN); |
$message |
$message |
ENDVCSCREEN |
ENDVCSCREEN |
Line 973 $message
|
Line 974 $message
|
ENDVCSCREEN |
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('<br /><b>'.&mt('Set the page to be displayed when you select the role of Course Coordinator').':</b>'); |
|
$r->print(<<ENDLSCREEN); |
|
<form name="server" action="/adm/preferences" method="post"> |
|
<input type="hidden" name="action" value="verify_and_change_coursepage" /> |
|
<br /> |
|
<label><input type="radio" name="newdisp" value="firstres" $firstselect /> $whatsnew_off</label><br /> |
|
<label><input type="radio" name="newdisp" value="whatsnew" $whatsnewselect /> $whatsnew_on</label> |
|
ENDLSCREEN |
|
$r->print('<br /><input type="submit" value="'.&mt('Change').'" /> |
|
</form>'); |
|
} |
|
|
|
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'}.'<br/>'; |
|
&Apache::lonnet::put('environment',{'course_init_display' => $newdisp}); |
|
&Apache::lonnet::appenv('environment.course_init_display' => $newdisp); |
|
} else { |
|
$message .= $lt{'when'}.', '.$lt{'apwb'}.'<br/>'; |
|
&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 .= '<br /><font size="+1"><a href="'.$furl.'">'.$lt{'gtts'}.' <i>'.&mt('now').'</i></a></font>'; |
|
} else { |
|
$message .= '<br /><font size="+1"><a href="/adm/whatsnew">'.$lt{'dasp'}.'</a></font>'; |
|
} |
|
} |
|
$r->print(<<ENDVCSCREEN); |
|
$message |
|
<br /><br /> |
|
ENDVCSCREEN |
|
} |
|
|
|
|
###################################################### |
###################################################### |
# other handler subroutines # |
# other handler subroutines # |
###################################################### |
###################################################### |
Line 1153 sub handler {
|
Line 1222 sub handler {
|
text => 'Change Math Preferences'}, |
text => 'Change Math Preferences'}, |
printmenu => 'yes', |
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)$/) { |
if ($env{'user.name'} =~ /^(albertel|fox|foxr|koretemey|korte|hallmat3|turtle)$/) { |
|
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
printmenu => 'yes', |
printmenu => 'yes', |
subroutine => \&toggle_debug, |
subroutine => \&toggle_debug, |
Line 1191 ENDHEADER
|
Line 1275 ENDHEADER
|
if (($printmenu eq 'yes') && (!$env{'form.returnurl'})) { |
if (($printmenu eq 'yes') && (!$env{'form.returnurl'})) { |
my $optionlist = '<table cellpadding="5">'; |
my $optionlist = '<table cellpadding="5">'; |
if ($env{'user.name'} =~ |
if ($env{'user.name'} =~ |
/^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle)$/ |
/^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle|raeburn)$/ |
) { |
) { |
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
linktext => 'Toggle Debug Messages', |
linktext => 'Toggle Debug Messages', |