Index: trunk/extensions/SemanticForms/includes/forminputs/SF_ComboBoxInput.php |
— | — | @@ -56,7 +56,17 @@ |
57 | 57 | |
58 | 58 | list( $autocompleteFieldType, $autocompletionSource ) = |
59 | 59 | SFTextWithAutocompleteInput::getAutocompletionTypeAndSource( $other_args ); |
60 | | - $values = SFUtils::getAutocompleteValues( $autocompletionSource, $autocompleteFieldType ); |
| 60 | + |
| 61 | + // @TODO - that count() check shouldn't be necessary |
| 62 | + if ( array_key_exists( 'possible_values', $other_args ) && |
| 63 | + count( $other_args['possible_values'] ) > 0 ) { |
| 64 | + $values = $other_args['possible_values']; |
| 65 | + } elseif ( $autocompleteFieldType == 'values' ) { |
| 66 | + $autocompleteValues = explode( ',', $other_args['values'] ); |
| 67 | + } else { |
| 68 | + $values = SFUtils::getAutocompleteValues( $autocompletionSource, $autocompleteFieldType ); |
| 69 | + $autocompleteValues = SFUtils::getAutocompleteValues( $autocompletionSource, $autocompleteFieldType ); |
| 70 | + } |
61 | 71 | $autocompletionSource = str_replace( "'", "\'", $autocompletionSource ); |
62 | 72 | |
63 | 73 | $optionsText = Xml::element( 'option', array( 'value' => $cur_value ), null, false ) . "\n"; |