mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Added ability to reset page to defaults. bug #4123
This commit is contained in:
parent
56a031c9ac
commit
cda8673c5f
@ -3,24 +3,24 @@
|
||||
// deafault settings are done here, saves doing all this twice in
|
||||
// both the rendering routine and the config screen
|
||||
|
||||
function tex_defaultsettings() {
|
||||
function tex_defaultsettings( $force=false ) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
if (!isset($CFG->filter_tex_latexpreamble)) {
|
||||
if (!isset($CFG->filter_tex_latexpreamble) or $force) {
|
||||
set_config( 'filter_tex_latexpreamble', " \\usepackage[latin1]{inputenc}\n \\usepackage{amsmath}\n \\usepackage{amsfonts}\n \\RequirePackage{amsmath,amssymb,latexsym}\n");
|
||||
}
|
||||
|
||||
if (!isset($CFG->filter_tex_latexbackground)) {
|
||||
if (!isset($CFG->filter_tex_latexbackground) or $force) {
|
||||
set_config( 'filter_tex_latexbackground', '#FFFFFF' );
|
||||
}
|
||||
|
||||
if (!isset($CFG->filter_tex_density)) {
|
||||
if (!isset($CFG->filter_tex_density) or $force) {
|
||||
set_config( 'filter_tex_density', '120' );
|
||||
}
|
||||
|
||||
// defaults for paths - if one not set assume all not set
|
||||
if (!isset($CFG->filter_tex_pathlatex)) {
|
||||
if (!isset($CFG->filter_tex_pathlatex) or $force) {
|
||||
// load the paths for the appropriate OS
|
||||
// it would be nice to expand this
|
||||
if (PHP_OS=='Linux') {
|
||||
|
@ -1,7 +1,11 @@
|
||||
<?php
|
||||
// check the default settings
|
||||
// $forcerest to be set in calling page
|
||||
if (!isset($forcereset)) {
|
||||
$forcereset = false;
|
||||
}
|
||||
require_once "defaultsettings.php";
|
||||
tex_defaultsettings();
|
||||
tex_defaultsettings( $forcereset );
|
||||
|
||||
// bit of a bodge - clear the tex cache area
|
||||
// so that any changes will display
|
||||
|
Loading…
x
Reference in New Issue
Block a user