Elgg/Elgg — pull request #176 by adayth (2012-03-12 22:10:57+00:00)
Title: Improved input/dropdown view to allow selection of multiple values

I pulled this before in 1.8 branch https://github.com/Elgg/Elgg/pull/173

I needed this feature while developing a plugin so I think that should be useful to share this with the community.

The main change is that an array can be used in `$vars['value']` to allow to select more of one value in dropdown box.
To detect the values `in_array` function is used.

With this change you can use code like this to output a multiple selection dropdown box:

```php
$options = array(
'name' => 'annotations[]',
'options_values' => array('a'=>'a', 'b'='b', 'c'='c'),
'value' => array('a', 'c'), // single value can be used too, e.g. 'a'
'multiple' => true,
);
echo elgg_view('input/dropdown', $options);
```

Notes:
- You need to use at the end of dropwdown's name `[]` so the form sends an array of values instead of only one.
- You need to specify `'multiple' => true` so format_attributes translates it in `multiple="multiple"` attribute in select form element.

I'm waiting your comments about this feature ;)