Преглед на файлове

* fix style closing tags (</1> should be </b> etc.)
* prevent ' style="Array"' from the html output

teepe преди 23 години
родител
ревизия
961084aff9
променени са 1 файла, в които са добавени 6 реда и са изтрити 5 реда
  1. 6 5
      class/html.class

+ 6 - 5
class/html.class

@@ -118,7 +118,8 @@ class html {
     if ($xtr_prop) {
     if ($xtr_prop) {
        echo ' '.$prop;
        echo ' '.$prop;
     }
     }
-    if ($style && !$usecss) {
+    if ($style && !$usecss && !is_array($style)) {
+       /* last premisse is to prevent 'style="Array"' in the output */
        echo ' style="'.$style.'"';  
        echo ' style="'.$style.'"';  
     }
     }
     if ($javascript) {
     if ($javascript) {
@@ -133,7 +134,7 @@ class html {
 	  echo $text;
 	  echo $text;
           foreach ($style as $k => $v) { /* if value of key value = true close the tag */
           foreach ($style as $k => $v) { /* if value of key value = true close the tag */
 	    if ($v) {
 	    if ($v) {
-               echo '</'.$v.'>';
+               echo '</'.$k.'>';
 	    }   
 	    }   
 	  }
 	  }
        } else {
        } else {
@@ -148,15 +149,15 @@ class html {
 	  }
 	  }
        }
        }
        echo "\n";
        echo "\n";
-       $indent.='  ';
+       $indentmore = $indent . '  ';
        for($i = 0;$i<$cnt;$i++) {
        for($i = 0;$i<$cnt;$i++) {
           $el = $this->html_el[$i];
           $el = $this->html_el[$i];
-	  $el->echoHtml($usecss,$indent);
+	  $el->echoHtml($usecss,$indentmore);
        }
        }
        if ($style && !$usecss) {       
        if ($style && !$usecss) {       
           foreach ($style as $k => $v) { /* if value of key value = true close the tag */
           foreach ($style as $k => $v) { /* if value of key value = true close the tag */
 	    if ($v) {
 	    if ($v) {
-               echo '</'.$v.'>';
+               echo '</'.$k.'>';
 	    }   
 	    }   
 	  }
 	  }
        }
        }