[phpwebapp-commits] CVS: web_app/parser class.Render.php,1.11,1.12
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2004-07-16 07:37:14
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19892/parser Modified Files: class.Render.php Log Message: Index: class.Render.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.Render.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** class.Render.php 15 Jul 2004 13:36:13 -0000 1.11 --- class.Render.php 16 Jul 2004 07:37:05 -0000 1.12 *************** *** 55,58 **** --- 55,61 ---- $str = WebApp::replaceVars($str); + //extra replacements + $str = $this->other_replaces($str); + if ($indent) { *************** *** 66,69 **** --- 69,91 ---- $this->output($str); } + /** Make some extra processing and replacements in the output. */ + function other_replaces($str) + { + //remove checked="no" or checked="false" or checked="" + $pattern = '/ checked=["\'](no|false)?["\']/'; + $str = preg_replace($pattern, '', $str); + //rplace checked="yes" or checked="true" with checked="checked" + $pattern = '/checked=["\'](yes|true)["\']/'; + $str = preg_replace($pattern, 'checked="checked"', $str); + + //remove selected="no" or selected="false" or selected="" + $pattern = '/ selected=["\'](no|false)?["\']/'; + $str = preg_replace($pattern, '', $str); + //rplace selected="yes" or selected="true" with selected="selected" + $pattern = '/selected=["\'](yes|true)["\']/'; + $str = preg_replace($pattern, 'selected="selected"', $str); + + return $str; + } /** Usually prints the given string. */ *************** *** 300,304 **** /** ! * Render it as a normally, but add in the scope of the * template the page (navigation) variables of the recordset, * which are: {{NextPage}}, {{PrevPage}}, etc. --- 322,326 ---- /** ! * Render it as a normal template, but add in the scope of the * template the page (navigation) variables of the recordset, * which are: {{NextPage}}, {{PrevPage}}, etc. |