]> git.mjollnir.org Git - moodle.git/commitdiff
"FILTER/MDL-18230, remove hardcoded style for TeX formulas image, merged from 1.9"
authordongsheng <dongsheng>
Mon, 16 Feb 2009 03:10:01 +0000 (03:10 +0000)
committerdongsheng <dongsheng>
Mon, 16 Feb 2009 03:10:01 +0000 (03:10 +0000)
filter/tex/filter.php
theme/standard/styles_layout.css

index e02e906bd6e1f171f0a6ceaaceb852fc597cdf4c..54cbe8acc0c7bb184b15503dec5ed71313054e34 100644 (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('&','&amp;',$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\">";
index b7fd9468465b86a317544daad2c9d246d48766e7..64efb1ec98ade9fa1b8422ab7186a4f9ca0663f2 100644 (file)
@@ -939,6 +939,10 @@ table.navbar {
   margin:0px;
   margin-left:0.5em;
 }
+.texrender {
+  border:0px;
+  vertical-align:middle;
+}
 
 
 /***