-// If we have a TYPE_DROPDOWN custom field - add control to select an option.
-if ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN) {
- $form->addInput(array('type'=>'combobox','name'=>'option',
- 'style'=>'width: 250px;',
- 'value'=>$cl_cf_1,
- 'data'=>$custom_fields->options,
- 'empty'=>array(''=>$i18n->get('dropdown.all'))));
+// If we have a TYPE_DROPDOWN custom field - add a control to select an option.
+if ($showCustomFieldDropdown) {
+ $form->addInput(array('type'=>'combobox','name'=>'option',
+ 'style'=>'width: 250px;',
+ 'value'=>$cl_cf_1,
+ 'data'=>$custom_fields->options,
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))));