Added support for multily selection in combo_input lists.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 1 Oct 2009 20:07:57 +0000 (20:07 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 1 Oct 2009 20:07:57 +0000 (20:07 +0000)
includes/ui/ui_lists.inc

index 62a34df9b9c5612c2e4e62bbc5b3088b8defa243..050223923e0b744d90d5c0c64fb1a00a5c691b52 100644 (file)
@@ -52,6 +52,7 @@ $opts = array(                // default options
        'search_submit' => true, //search submit button: true/false
        'size' => 8,    // size and max of box tag
        'max' => 50,
+       'height' => false,      // number of lines in select box
        'cells' => false,       // combo displayed as 2 <td></td> cells
        'search' => array(), // sql field names to search
        'format' => null,        // format functions for regular options
@@ -207,7 +208,9 @@ $opts = array(              // default options
                $txt = $found;
                $Ajax->addUpdate($name, $search_box, $txt ? $txt : '');
        }
-       $selector = "<select $disabled name='$name' class='$class' title='"
+       $selector = "<select ".(strpos($name,'[]')!==false ? "multiple" : '')
+               . ($opts['height']!==false ? ' size="'.$opts['height'].'"' : '')
+               . "$disabled name='$name' class='$class' title='"
                . $opts['sel_hint']."' $rel>".$selector."</select>\n";
 
        $Ajax->addUpdate($name, "_{$name}_sel", $selector);