r90405 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90404‎ | r90405 | r90406 >
Date:17:18, 19 June 2011
Author:yaron
Status:deferred
Tags:
Comment:
Improved formatting
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
@@ -126,7 +126,7 @@
127127
128128 // load jQuery on MW 1.16
129129 if ( is_callable( array( $wgOut, 'includeJQuery' ) ) ) {
130 - $wgOut -> includeJQuery();
 130+ $wgOut->includeJQuery();
131131 }
132132
133133 return true;
@@ -250,7 +250,7 @@
251251 }
252252
253253 static function renderFormInput ( &$parser ) {
254 - global $wgVersion;
 254+ global $wgVersion;
255255
256256 $params = func_get_args();
257257 array_shift( $params ); // don't need the parser
@@ -342,7 +342,7 @@
343343 'value' => $inValue,
344344 'class' => 'autocompleteInput createboxInput formInput',
345345 'autocompletesettings' => 'input_' . $input_num
346 - ) );
 346+ ) );
347347 }
348348 // if the form start URL looks like "index.php?title=Special:FormStart"
349349 // (i.e., it's in the default URL style), add in the title as a
@@ -438,10 +438,10 @@
439439 */
440440 static function renderArrayMapObj( &$parser, $frame, $args ) {
441441 # Set variables
442 - $value = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
443 - $delimiter = isset( $args[1] ) ? trim( $frame->expand( $args[1] ) ) : ',';
444 - $var = isset( $args[2] ) ? trim( $frame->expand( $args[2], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : 'x';
445 - $formula = isset( $args[3] ) ? $args[3] : 'x';
 442+ $value = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
 443+ $delimiter = isset( $args[1] ) ? trim( $frame->expand( $args[1] ) ) : ',';
 444+ $var = isset( $args[2] ) ? trim( $frame->expand( $args[2], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : 'x';
 445+ $formula = isset( $args[3] ) ? $args[3] : 'x';
446446 $new_delimiter = isset( $args[4] ) ? trim( $frame->expand( $args[4] ) ) : ', ';
447447 # Unstrip some
448448 $delimiter = $parser->mStripState->unstripNoWiki( $delimiter );
@@ -462,8 +462,8 @@
463463 $old_value = trim( $old_value );
464464 if ( $old_value == '' ) continue;
465465 $result_value = $frame->expand( $formula, PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES );
466 - $result_value = str_replace( $var, $old_value, $result_value );
467 - $result_value = $parser->preprocessToDom( $result_value, $frame->isTemplate() ? Parser::PTD_FOR_INCLUSION : 0 );
 466+ $result_value = str_replace( $var, $old_value, $result_value );
 467+ $result_value = $parser->preprocessToDom( $result_value, $frame->isTemplate() ? Parser::PTD_FOR_INCLUSION : 0 );
468468 $result_value = trim( $frame->expand( $result_value ) );
469469 if ( $result_value == '' ) continue;
470470 $results_array[] = $result_value;
@@ -507,9 +507,9 @@
508508 */
509509 static function renderArrayMapTemplateObj( &$parser, $frame, $args ) {
510510 # Set variables
511 - $value = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
512 - $template = isset( $args[1] ) ? trim( $frame->expand( $args[1] ) ) : '';
513 - $delimiter = isset( $args[2] ) ? trim( $frame->expand( $args[2] ) ) : ',';
 511+ $value = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
 512+ $template = isset( $args[1] ) ? trim( $frame->expand( $args[1] ) ) : '';
 513+ $delimiter = isset( $args[2] ) ? trim( $frame->expand( $args[2] ) ) : ',';
514514 $new_delimiter = isset( $args[3] ) ? trim( $frame->expand( $args[3] ) ) : ', ';
515515 # Unstrip some
516516 $delimiter = $parser->mStripState->unstripNoWiki( $delimiter );
@@ -564,10 +564,10 @@
565565
566566 switch ( $key ) {
567567 case 'link text':
568 - $linkString = $parser -> recursiveTagParse( $value );
 568+ $linkString = $parser->recursiveTagParse( $value );
569569 break;
570570 case 'link type':
571 - $linkType = $parser -> recursiveTagParse( $value );
 571+ $linkType = $parser->recursiveTagParse( $value );
572572 break;
573573 case 'reload':
574574 $classString .= ' reload';
@@ -600,7 +600,7 @@
601601 );
602602
603603 // return output HTML
604 - return $parser -> insertStripItem( $output, $parser -> mStripState );
 604+ return $parser->insertStripItem( $output, $parser->mStripState );
605605 }
606606
607607
@@ -651,7 +651,7 @@
652652 global $sfgScriptPath;
653653
654654 if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
655 - $parser -> getOutput() -> addModules( 'ext.semanticforms.autoedit' );
 655+ $parser->getOutput()->addModules( 'ext.semanticforms.autoedit' );
656656 } else {
657657
658658 static $loaded = false;
@@ -660,14 +660,14 @@
661661 if ( !$loaded ) {
662662
663663 // load extensions JavaScript
664 - $parser -> getOutput() -> addHeadItem(
 664+ $parser->getOutput()->addHeadItem(
665665 '<script type="text/javascript" src="' . $sfgScriptPath
666666 . '/libs/SF_autoedit.js"></script> ' ."\n",
667667 'sf_autoedit_script'
668668 );
669669
670670 // load extensions style sheet
671 - $parser -> getOutput() -> addHeadItem(
 671+ $parser->getOutput()->addHeadItem(
672672 '<link rel="stylesheet" href="' . $sfgScriptPath
673673 . '/skins/SF_autoedit.css"/> ' ."\n",
674674 'sf_autoedit_style'