2 // check the default settings
3 // $forcerest to be set in calling page
4 if (!isset($forcereset)) {
7 require_once "defaultsettings.php";
8 tex_defaultsettings( $forcereset );
10 // bit of a bodge - clear the tex cache area
11 // so that any changes will display
12 if (file_exists( "$CFG->dataroot/filter/tex" )) {
13 remove_dir( "$CFG->dataroot/filter/tex", true );
18 $txt->latexsettings
= get_string( 'latexsettings','admin' );
19 $txt->latexpreamble
= get_string( 'latexpreamble','admin' );
20 $txt->backgroundcolour
= get_string( 'backgroundcolour','admin' );
21 $txt->density
= get_string( 'density','admin' );
22 $txt->pathlatex
= get_string( 'pathlatex','admin' );
23 $txt->pathdvips
= get_string( 'pathdvips','admin' );
24 $txt->pathconvert
= get_string( 'pathconvert','admin' );
25 $txt->tick
= '✔';
26 $txt->cross
= '✘';
28 // check file exists & display tick or cross
29 function texbinaryconfirm( $path ) {
32 echo "<span style=\"color:green;\">$txt->tick</span>";
35 echo "<span style=\"color:red;\">$txt->cross</span>";
40 <table cellpadding=
"9" cellspacing=
"0">
42 <th align=
"right" scope=
"col"><?php echo $txt->latexsettings
; ?></th>
46 <td align=
"right"><?php echo $txt->latexpreamble
; ?></td>
47 <td><textarea type=
"text" name=
"filter_tex_latexpreamble" cols=
"60" rows=
"5"><?php p($CFG->filter_tex_latexpreamble
); ?></textarea></td>
50 <td align=
"right"><?php echo $txt->backgroundcolour
; ?></td>
51 <td><input type=
"text" name=
"filter_tex_latexbackground"
52 value=
"<?php p($CFG->filter_tex_latexbackground) ?>" /></td
>
55 <td align
="right"><?php
echo $txt->density
; ?></td>
56 <td><input type=
"text" name=
"filter_tex_density"
57 value=
"<?php p($CFG->filter_tex_density); ?>" /></td
>
60 <td align
="right"><?php
echo $txt->pathlatex
; ?></td>
61 <td><input type=
"text" name=
"filter_tex_pathlatex" size=
"50"
62 value=
"<?php p($CFG->filter_tex_pathlatex); ?>" />
63 <?php
texbinaryconfirm( $CFG->filter_tex_pathlatex
); ?>
67 <td align=
"right"><?php echo $txt->pathdvips
; ?></td>
68 <td><input type=
"text" name=
"filter_tex_pathdvips" size=
"50"
69 value=
"<?php p($CFG->filter_tex_pathdvips); ?>" />
70 <?php
texbinaryconfirm( $CFG->filter_tex_pathdvips
); ?>
74 <td align=
"right"><?php echo $txt->pathconvert
; ?></td>
75 <td><input type=
"text" name=
"filter_tex_pathconvert" size=
"50"
76 value=
"<?php p($CFG->filter_tex_pathconvert); ?>" />
77 <?php
texbinaryconfirm( $CFG->filter_tex_pathconvert
); ?>