"FILTER/MDL-18230, remove hardcoded style for TeX formulas image, merged from 1.9"

This commit is contained in:
dongsheng 2009-02-16 03:10:01 +00:00
parent 37d975e11f
commit e47d5adef3
2 changed files with 17 additions and 9 deletions

View File

@ -40,13 +40,24 @@ function string_file_picture_tex($imagefile, $tex= "", $height="", $width="", $a
if($alt==='') {
$alt=s($tex);
}
// Given the path to a picture file in a course, or a URL,
// Given the path to a picture file in a course, or a URL,
// this function includes the picture in the page.
global $CFG;
$output = "";
$origtex = $tex;
$style = 'style="border:0px; vertical-align:'.$align.';';
if ($align !== 'middle') {
$style = ' style="vertical-align:'.$align.';';
} else {
$style = '';
}
if ($height) {
$style .= " height:{$height}px;";
}
if ($width) {
$style .= " width:{$width}px;";
}
$style .= '"';
if ($tex) {
$tex = str_replace('&','&',$tex);
$tex = str_replace('<','&lt;',$tex);
@ -60,13 +71,6 @@ function string_file_picture_tex($imagefile, $tex= "", $height="", $width="", $a
// code.
$title = "title=\"$tex\"";
}
if ($height) {
$style .= " height:{$height}px;";
}
if ($width) {
$style .= " width:{$width}px;";
}
$style .= '"';
if ($imagefile) {
if (!file_exists("$CFG->dataroot/filter/tex/$imagefile") && has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
$output .= "<a href=\"$CFG->wwwroot/filter/tex/texdebug.php\">";

View File

@ -939,6 +939,10 @@ table.navbar {
margin:0px;
margin-left:0.5em;
}
.texrender {
border:0px;
vertical-align:middle;
}
/***