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);
// 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\">";