adding some strings
[moodle-linuxchix.git] / filter / tex / filterconfig.html
blob36bedf64659fdcc346f5ae97cecf58b5cdef432d
1 <?php
2 // check the default settings
3 // $forcerest to be set in calling page
4 if (!isset($forcereset)) {
5 $forcereset = false;
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 );
16 // get strings
17 $txt = new Object;
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 = '&#x2714;';
26 $txt->cross = '&#x2718;';
28 // check file exists & display tick or cross
29 function texbinaryconfirm( $path ) {
30 global $txt;
31 if (is_file($path)) {
32 echo "<span style=\"color:green;\">$txt->tick</span>";
34 else {
35 echo "<span style=\"color:red;\">$txt->cross</span>";
40 <table cellpadding="9" cellspacing="0">
41 <tr valign="top">
42 <th align="right" scope="col"><?php echo $txt->latexsettings; ?></th>
43 <th>&nbsp;</th>
44 </tr>
45 <tr valign="top">
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>
48 </tr>
49 <tr valign="top">
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>
53 </tr>
54 <tr valign="top">
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>
58 </tr>
59 <tr valign="top">
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 ); ?>
64 </td>
65 </tr>
66 <tr valign="top">
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 ); ?>
71 </td>
72 </tr>
73 <tr valign="top">
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 ); ?>
78 </td>
79 </tr>
80 </table>