Index: trunk/extensions/InputBox/InputBox.classes.php |
— | — | @@ -353,36 +353,38 @@ |
354 | 354 | $values[ strtolower( trim( $name ) ) ] = trim( $value ); |
355 | 355 | } |
356 | 356 | |
357 | | - // Go through and set all the options we found |
| 357 | + // Build list of options, with local member names and deafults |
358 | 358 | $options = array( |
359 | | - 'type' => 'mType', |
360 | | - 'width' => 'mWidth', |
361 | | - 'preload' => 'mPreload', |
362 | | - 'editintro' => 'mEditIntro', |
363 | | - 'break' => 'mBR', |
364 | | - 'default' => 'mDefaultText', |
365 | | - 'bgcolor' => 'mBGColor', |
366 | | - 'buttonlabel' => 'mButtonLabel', |
367 | | - 'searchbuttonlabel' => 'mSearchButtonLabel', |
368 | | - 'fulltextbutton' => 'mFullTextButton', |
369 | | - 'namespaces' => '_namespaces', |
370 | | - 'labeltext' => 'mLabelText', |
371 | | - 'hidden' => 'mHidden', |
372 | | - 'id' => 'mID', |
373 | | - 'inline' => 'mInline' |
| 359 | + 'type' => array( 'mType', '' ), |
| 360 | + 'width' => array( 'mWidth', 50 ), |
| 361 | + 'preload' => array( 'mPreload', '' ), |
| 362 | + 'editintro' => array( 'mEditIntro', '' ), |
| 363 | + 'break' => array( 'mBR', 'yes' ), |
| 364 | + 'default' => array( 'mDefaultText', '' ), |
| 365 | + 'bgcolor' => array( 'mBGColor', 'transparent' ), |
| 366 | + 'buttonlabel' => array( 'mButtonLabel', '' ), |
| 367 | + 'searchbuttonlabel' => array( 'mSearchButtonLabel', '' ), |
| 368 | + 'fulltextbutton' => array( 'mFullTextButton', '' ), |
| 369 | + 'namespaces' => array( '_namespaces', '' ), |
| 370 | + 'labeltext' => array( 'mLabelText', '' ), |
| 371 | + 'hidden' => array( 'mHidden', '' ), |
| 372 | + 'id' => array( 'mID', '' ), |
| 373 | + 'inline' => array( 'mInline', false ) |
374 | 374 | ); |
375 | 375 | foreach ( $options as $name => $var ) { |
376 | 376 | if ( isset( $values[$name] ) ) { |
377 | | - $this->$var = $values[$name]; |
| 377 | + $this->$var[0] = $values[$name]; |
| 378 | + } else { |
| 379 | + $this->$var[0] = $var[1]; |
378 | 380 | } |
379 | 381 | } |
380 | | - |
| 382 | + |
381 | 383 | // Insert a line break if configured to do so |
382 | 384 | $this->mBR = ( strtolower( $this->mBR ) == "no" ) ? '' : '<br />'; |
383 | 385 | |
384 | 386 | // Validate the width; make sure it's a valid, positive integer |
385 | 387 | $this->mWidth = intval( $this->mWidth <= 0 ? 50 : $this->mWidth ); |
386 | | - |
| 388 | + |
387 | 389 | wfProfileOut( __METHOD__ ); |
388 | 390 | } |
389 | 391 | |