phpbb/phpbb3 — pull request #1317 by Skouat (2013-03-23 12:51:10+00:00)
Title: [ticket/10910] Function build_cfg_template() allow $size for $tpl_type = select

*Function build_cfg_template() allow $size for $tpl_type = select*

***How to use it ?***
In ACP file (eg: *includes/acp/acp_foo.php*) use the **select** type as below :
For example define the size to **8**
```php
$display_vars = array(
'title'	=> 'FOO_CONFIG',
'vars'	=> array(
'legend1'	=> 'FOO_SETTINGS',
'foo_group_id'	=> array('lang' => 'FOO_GROUP',	'validate' => 'int',	'type' => 'select:8', 'function' => 'group_select_options', 'params' => array('{CONFIG_VALUE}', false, false), 'explain' => true),

'legend4'	=> 'ACP_SUBMIT_CHANGES',
)
);
```
After, on submit, we check if no value is selected by using the following code
```php
// We go compare $display_vars with $cfg_array to determine if the type "select" does not have a choice selected.
if ($submit)
{
$display_vars_diff = array_diff_key($display_vars['vars'] , $cfg_array);

foreach ($display_vars_diff as $config_name_diff => $vars_diff)
{
if (strpos($vars_diff['type'], 'select') === false)
{
continue;
}

$cfg_array[$config_name_diff] = '';
}
unset($config_name_diff);
}
```
Ticket [PHPBB3-10910](http://tracker.phpbb.com/browse/PHPBB3-10910)