Re: [SMARTY-DEV] html_* functions fixes

From: Date: Wed, 03 Mar 2004 20:12:11 +0000
Subject: Re: [SMARTY-DEV] html_* functions fixes
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2184@lists.php.net to get a copy of this message
On Wed, Feb 25, 2004 at 10:51:39PM +0100, Tarik ANSARI wrote: > Hi, > > Here are the updates I suggest to answer html_* functions critics and keep > complete backward compatibility : > References are made on today's CVS. > > [ PHP ] / smarty/ libs/ plugins/function.html_image.php, line 137: > return $prefix . '<img src="'.$file.'" > alt="'.$alt.'" style="border: > '.$border.'px;" width="'.$width.'" > height="'.$height.'"'.$extra.' />' . > $suffix; what does the standard say if I provide multiple "style"-attributes? AFAIK you are not allowed to have two equally named attributes inside one tag, so {html_image file="foo.gif" style="align:somewhere;"} wouldn't "keep complete backward compatibility", IMHO. > For the carriage returns that is breaking html indentation, my solution it > to forget them. If finally we think this is really important, then we need > to buffer the line indentation while parsing template file and print it on > each line plus necessary sub-indentations (and the root indentation must not > be add by each html_* function, but at compilation, with a unique > instruction). > > [ PHP ] / smarty/ libs/ plugins/ function.html_checkboxes.php, line 130: > $_output .= $separator; > > [ PHP ] / smarty/ libs/ plugins/ function.html_options.php, line 90: > $_html_result = '<select name="' . $name . '"' . $extra . > '>' . "\n" . > $_html_result . '</select>'; > > line 103 : > $_html_result .= ">" . smarty_function_escape_special_chars($value) . > "</option>"; > > line 111: > $optgroup_html = '<optgroup label="' . > smarty_function_escape_special_chars($key) . '">'; > > line 115: > $optgroup_html .= "</optgroup>"; > > [ PHP ] / smarty/ libs/ plugins/function.html_radios.php, line 133: > $_output .= $separator; > > [ PHP ] / smarty/ libs/ plugins/function.html_select_date.php, line 182: > $month_result .= ">"; > > line 218: > $day_result .= ">"; > > line 262: > $year_result .= ">"; > > delete lines 72, 73, 288, 289, 290, 291. > > [ PHP ] / smarty/ libs/ plugins/function.html_select_time.php, line 99: > $html_result .= ">"; > > line 105: > $html_result .= "</select>"; > > line 125: > $html_result .= ">"; > > line 132: > $html_result .= "</select>"; > > line 153: > $html_result .= ">"; > > line 160: > $html_result .= "</select>"; > > line 177: > $html_result .= ">"; > > line 184: > $html_result .= "</select>"; > > [ PHP ] / smarty/ libs/ plugins/function.html_table.php, line 97: > $output = "<table $table_attr>"; > > line 100: > $output .= "<tr" . smarty_function_html_table_cycle("tr", $tr_attr, $r) > . > ">"; > > line 111: > $output .= "<td" . smarty_function_html_table_cycle("td", $td_attr, $c) > . > ">" . $loop[$x] . "</td>"; > > line 113: > $output .= "<td" . smarty_function_html_table_cycle("td", $td_attr, $c) > . > ">$trailpad</td>"; > > line 116: > $output .= "</tr>"; > > line 118: > $output .= "</table>"; > > That's all :-) sorry, can you provide this as a unified diff ("cvs diff -u") against cvs-HEAD or 2.6.2? greetings messju > > Tarik Ansari

« previous php.smarty.dev (#2184) next »