From: Thomas Mudrunka Date: Fri, 22 Jul 2011 03:29:00 +0000 (+0200) Subject: odstranen duplicitni kod z funkce pro generovani formulare X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=e9cb8cea54ae8ea0ba0ae464125f9ae854b065e6;p=mirrors%2FSokoMan.git odstranen duplicitni kod z funkce pro generovani formulare --- diff --git a/index.php b/index.php index b2474e3..142967c 100755 --- a/index.php +++ b/index.php @@ -182,18 +182,17 @@ EOF; foreach($columns as $column) { $html.=$column['Field'].': '; $name='value:'.$column['Field'].'[]'; + $val = $update ? $current[$column['Field']] : false; switch(true) { case preg_match('/auto_increment/', $column['Extra']): - $val = $update ? $current[$column['Field']] : ''; //opakuje se (skoro) zbytecne + if(!$val) $val = ''; $html.=$this->input($name, $val, 'hidden'); $html.=$val.'(AUTO)'; break; case isset($selectbox[$column['Field']]): - $val = $update ? $current[$column['Field']] : false; - $html.=$this->select($name,$selectbox[$column['Field']],$val); //opakuje se + $html.=$this->select($name,$selectbox[$column['Field']],$val); break; default: - $val = $update ? $current[$column['Field']] : false; //opakuje se $html.=$this->input($name, $val); break; }