From e47d5adef39abd1d0611c9766232cabf17c20d4c Mon Sep 17 00:00:00 2001 From: dongsheng <dongsheng> Date: Mon, 16 Feb 2009 03:10:01 +0000 Subject: [PATCH] "FILTER/MDL-18230, remove hardcoded style for TeX formulas image, merged from 1.9" --- filter/tex/filter.php | 22 +++++++++++++--------- theme/standard/styles_layout.css | 4 ++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/filter/tex/filter.php b/filter/tex/filter.php index e02e906bd6e..54cbe8acc0c 100644 --- a/filter/tex/filter.php +++ b/filter/tex/filter.php @@ -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('<','<',$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\">"; diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index b7fd9468465..64efb1ec98a 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -939,6 +939,10 @@ table.navbar { margin:0px; margin-left:0.5em; } +.texrender { + border:0px; + vertical-align:middle; +} /***