X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=class%2Fhtml.class;h=dcdb805bce4afba897da68643f51f66156a5a9b5;hb=843204d4070cba2a59f5161147efb84938431ad6;hp=b2a5f75757cba5fcd23478f4c4cf3bc48d737447;hpb=84d46e4ee219902f7c95b0cc2342623ea9f31866;p=squirrelmail.git diff --git a/class/html.class b/class/html.class index b2a5f757..dcdb805b 100644 --- a/class/html.class +++ b/class/html.class @@ -5,7 +5,6 @@ * Copyright (c) 2002 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * - * * This contains functions needed to generate html output. * * $Id$ @@ -131,43 +130,38 @@ class html { echo ' '.$js; } if ($tag) echo '>'; - if ($text) { - if ($style && !$usecss) { /* if use css then fallback to stylesheet for layout */ - foreach ($style as $k => $v) { - echo '<'.$k.'>'; - } - echo $text; - foreach ($style as $k => $v) { /* if value of key value = true close the tag */ - if ($v) { - echo ''; - } - } - } else { - echo $text; + + $openstyles = ''; + $closestyles = ''; + if ($style && !$usecss) { + foreach ($style as $k => $v) { + $openstyles .= '<'.$k.'>'; + } + foreach ($style as $k => $v) { + /* if value of key value = true close the tag */ + if ($v) { + $closestyles .= ''; + } } } + echo $openstyles; + + if ($text) { + echo $text; + } + $cnt = count($this->html_el); if ($cnt) { - if ($style && !$usecss) { - foreach ($style as $k => $v) { - echo '<'.$k.'>'; - } - } echo "\n"; for($i = 0;$i<$cnt;$i++) { $el = $this->html_el[$i]; $el->echoHtml($usecss,$indentmore); } - if ($style && !$usecss) { - foreach ($style as $k => $v) { /* if value of key value = true close the tag */ - if ($v) { - echo ''; - } - } - } + echo $indent; } + echo $closestyles; if ($tag) { - echo $indent . ''."\n"; + echo ''."\n"; } else { echo "\n"; }