Checking options parameter for combos
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 7 Jul 2008 21:36:39 +0000 (21:36 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 7 Jul 2008 21:36:39 +0000 (21:36 +0000)
includes/ui/ui_lists.inc

index 3aae252197bbf4a98084e2b824936fed981a2c33..864c486afcfa79938e85054f6c4870b448b99640 100644 (file)
@@ -51,7 +51,8 @@ $opts = array(                // default options
        'box_hint' => null // box/selectors hints; null = std see below
 );
 // ------ merge options with defaults ----------
-       $opts = array_merge($opts, $options);
+       if($options != null)
+               $opts = array_merge($opts, $options);
        if (!is_array($opts['where']))  $opts['where'] = array($opts['where']);
 
        $search_box = $opts['search_box']===true ? '_'.$name.'_edit' : $opts['search_box'];
@@ -231,7 +232,8 @@ $opts = array(              // default options
        'disabled' => false
 );
 // ------ merge options with defaults ----------
-       $opts = array_merge($opts, $options);
+       if($options != null)
+               $opts = array_merge($opts, $options);
        $select_submit =  $opts['select_submit']===true ? '_'.$name.'_update' : $opts['select_submit'];
        $spec_id = $opts['spec_id'];
        $spec_option = $opts['spec_option'];