r93203 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93202‎ | r93203 | r93204 >
Date:16:33, 26 July 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added handling of 'values' parameter, and of allowed values from property
Modified paths:
  • /trunk/extensions/SemanticForms/includes/forminputs/SF_ComboBoxInput.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/forminputs/SF_ComboBoxInput.php
@@ -56,7 +56,17 @@
5757
5858 list( $autocompleteFieldType, $autocompletionSource ) =
5959 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+ }
6171 $autocompletionSource = str_replace( "'", "\'", $autocompletionSource );
6272
6373 $optionsText = Xml::element( 'option', array( 'value' => $cur_value ), null, false ) . "\n";

Follow-up revisions

RevisionCommit summaryAuthorDate
r105505Fix for r93203 - fixed and simplified setting of valuesyaron00:58, 8 December 2011