Index: trunk/extensions/SocialProfile/UserGifts/SpecialGiftManager.php |
— | — | @@ -237,18 +237,24 @@ |
238 | 238 | |
239 | 239 | // If the user isn't in the gift admin group, they can only create |
240 | 240 | // private gifts |
241 | | - if ( !in_array( 'giftadmin', $wgUser->getGroups() ) ) { |
| 241 | + if ( !$wgUser->isAllowed( 'giftadmin' ) ) { |
242 | 242 | $form .= '<input type="hidden" name="access" value="1" />'; |
243 | 243 | } else { |
244 | | - // FIXME: undefined variable gift (twice) |
| 244 | + $publicSelected = $privateSelected = ''; |
| 245 | + if ( isset( $gift['access'] ) && $gift['access'] == 0 ) { |
| 246 | + $publicSelected = ' selected="selected"'; |
| 247 | + } |
| 248 | + if ( isset( $gift['access'] ) && $gift['access'] == 1 ) { |
| 249 | + $privateSelected = ' selected="selected"'; |
| 250 | + } |
245 | 251 | $form .= '<tr> |
246 | 252 | <td class="view-form">' . wfMsg( 'giftmanager-access' ) . '</td> |
247 | 253 | <td> |
248 | 254 | <select name="access"> |
249 | | - <option value="0"' . ( ( $gift['access'] == 0 ) ? ' selected="selected"' : '' ) . '>' . |
| 255 | + <option value="0"' . $publicSelected . '>' . |
250 | 256 | wfMsg( 'giftmanager-public' ) . |
251 | 257 | '</option> |
252 | | - <option value="1"' . ( ( $gift['access'] == 1 ) ? ' selected="selected"' : '' ) . '>' . |
| 258 | + <option value="1"' . $privateSelected . '>' . |
253 | 259 | wfMsg( 'giftmanager-private' ) . |
254 | 260 | '</option> |
255 | 261 | </select> |