Changeset 1083
- Timestamp:
- 02/12/2009 09:59:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-classes.php
r1052 r1083 429 429 $html .= '<label class="signup-label" for="field_' . $this->id . '">' . $asterisk . $this->name . ':</label>'; 430 430 $html .= $this->message . '<select class="multi-select" multiple="multiple" name="field_' . $this->id . '[]" id="field_' . $this->id . '">'; 431 for ( $k = 0; $k < count($options); $k++ ) { 432 $option_value = BP_XProfile_ProfileData::get_value_byid($options[$k]->parent_id); 433 $values = explode( ',', $option_value ); 434 435 if ( $option_value == $options[$k]->name || $value == $options[$k]->name || in_array( $options[$k]->name, $values ) || ( $options[$k]->is_default_option ) ) { 436 $selected = ' selected="selected"'; 437 } else { 438 $selected = ''; 439 } 440 441 $html .= '<option' . $selected . ' value="' . $options[$k]->name . '">' . $options[$k]->name . '</option>'; 431 432 if ( $value ) { 433 $option_values = maybe_unserialize($value); 434 } else { 435 $option_values = BP_XProfile_ProfileData::get_value_byid($options[0]->parent_id); 436 $option_values = maybe_unserialize($option_values); 437 } 438 439 for ( $k = 0; $k < count($options); $k++ ) { 440 if ( @in_array( $options[$k]->name, $option_values ) ) { 441 $selected = ' selected="selected"'; 442 } else { 443 $selected = ''; 442 444 } 445 446 $html .= '<option' . $selected . ' value="' . $options[$k]->name . '">' . $options[$k]->name . '</option>'; 447 } 448 443 449 $html .= '</select>'; 444 450 $html .= '<span class="signup-description">' . $this->desc . '</span>'; … … 478 484 479 485 if ( $value ) { 480 $option_values = unserialize($value);486 $option_values = maybe_unserialize($value); 481 487 } else { 482 488 $option_values = BP_XProfile_ProfileData::get_value_byid($options[0]->parent_id); 483 $option_values = unserialize($option_values);489 $option_values = maybe_unserialize($option_values); 484 490 } 485 491
Note: See TracChangeset
for help on using the changeset viewer.