<select id="{$option->optionName}" name="values[{$option->optionName}]">
- {if $option->allowEmptyValue}<option value="">{lang}wcf.global.noSelection{/lang}</option>{/if}
+ {if $allowEmptyValue}<option value="">{lang}wcf.global.noSelection{/lang}</option>{/if}
{foreach from=$selectOptions key=key item=selectOption}
<option value="{$key}"{if $value == $key} selected="selected"{/if}>{lang}{@$selectOption}{/lang}</option>
{/foreach}
<select id="{$option->optionName}" name="values[{$option->optionName}]">
- {if $option->allowEmptyValue}<option value="">{lang}wcf.global.noSelection{/lang}</option>{/if}
+ {if $allowEmptyValue}<option value="">{lang}wcf.global.noSelection{/lang}</option>{/if}
{foreach from=$selectOptions key=key item=selectOption}
<option value="{$key}"{if $value == $key} selected="selected"{/if}>{lang}{@$selectOption}{/lang}</option>
{/foreach}
* @category Community Framework
*/
class SelectOptionType extends RadioButtonOptionType {
+ protected $allowEmptyValue = false;
+
/**
* @see \wcf\system\option\IOptionType::getFormElement()
*/
'enableOptions' => $options['enableOptions'],
'option' => $option,
'selectOptions' => $option->parseSelectOptions(),
- 'value' => $value
+ 'value' => $value,
+ 'allowEmptyValue' => ($this->allowEmptyValue || $option->allowEmptyValue)
));
return WCF::getTPL()->fetch('selectOptionType');
}
* @see \wcf\system\option\ISearchableUserOption::getSearchFormElement()
*/
public function getSearchFormElement(Option $option, $value) {
+ $this->allowEmptyValue = true;
return $this->getFormElement($option, $value);
}