odstranen duplicitni kod z funkce pro generovani formulare
authorThomas Mudrunka <tomas@mudrunka.cz>
Fri, 22 Jul 2011 03:29:00 +0000 (05:29 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Fri, 22 Jul 2011 03:29:00 +0000 (05:29 +0200)
index.php

index b2474e362a2d44c483e4932e548aab571bf498a1..142967c36f6e5e2563e31eec2a09fbdb17ebd6f0 100755 (executable)
--- 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;
                        }
This page took 0.142547 seconds and 4 git commands to generate.