r111271 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111270‎ | r111271 | r111272 >
Date:23:53, 11 February 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Fix global typo

Fix whitespace, remove unused global that wasn't defined
Modified paths:
  • /trunk/extensions/EtherpadLite/EtherpadLite.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EtherpadLite/EtherpadLite.php
@@ -73,7 +73,7 @@
7474 // https://www.mediawiki.org/wiki/Manual:Tag_extensions
7575 function efEtherpadLiteParser_Initialize( &$parser ) {
7676 $parser->setHook('eplite', 'efEtherpadLiteParserFunction_Render');
77 - return true;
 77+ return true;
7878 }
7979
8080 # Define a default Etherpad Lite server Url and base path
@@ -88,12 +88,11 @@
8989 $wgEtherpadLiteShowAuthorColors = 'true';
9090
9191 function efEtherpadLiteParserFunction_Render( $input, $args, $parser, $frame ) {
92 -
 92+
9393 global $wgUser;
94 - global $wgEtherpadLiteDefaultPadUrl,$wgEtherpadLiteDefaultWidth,
95 - $wgEtherpadLiteDefaultHeigth,$wgEtherpadLiteMonospacedFont,$wgEtherpadLiteShowControls,
96 - $wgEtherpadLiteShowLineNumbers,$wgEtherpadLiteShowChat,$wgEtherpadLiteUserName,
97 - $wgEtherpadLiteShowAuthorColors;
 94+ global $wgEtherpadLiteDefaultPadUrl, $wgEtherpadLiteDefaultWidth, $wgEtherpadLiteDefaultHeight,
 95+ $wgEtherpadLiteMonospacedFont, $wgEtherpadLiteShowControls, $wgEtherpadLiteShowLineNumbers,
 96+ $wgEtherpadLiteShowChat, $wgEtherpadLiteShowAuthorColors;
9897
9998 $padId = ( !empty( $args['pad-id'] ) ) ? $args['pad-id'] : "" ;
10099 $height = ( !empty( $args['height'] ) ) ? $args['height'] : $wgEtherpadLiteDefaultHeight;
@@ -104,17 +103,17 @@
105104 $showLineNumbers = ( !empty( $args['show-linenumbers'] ) ) ? $args['show-linenumbers'] : $wgEtherpadLiteShowLineNumbers;
106105 $showChat = ( !empty( $args['show-chat'] ) ) ? $args['show-chat'] : $wgEtherpadLiteShowChat;
107106 $noColors = ! ( ( !empty( $args['show-colors'] ) ) ? $args['show-colors'] : $wgEtherpadLiteShowAuthorColors );
108 -
 107+
109108 $epliteHostUrl = Sanitizer::cleanUrl (
110109 ( !empty( $args['pad-url'] ) ) ? $args['pad-url'] : $wgEtherpadLiteDefaultPadUrl
111 - );
 110+ );
112111
113112 // preset the pad username from MediaWiki username or IP
114113 // attention:
115114 // the pad username can currently be overwritten when editing the pad
116115
117116 $userName = $wgUser->getName();
118 -
 117+
119118 $iframeAttributes = array(
120119 "style" => "width:$width;height:$height",
121120 "id" => "epframe$padId",
@@ -126,10 +125,9 @@
127126 "&userName=$userName" .
128127 "&noColors=$noColors"
129128 );
130 -
 129+
131130 $output = Html::rawElement( 'iframe', $iframeAttributes );
132 -
 131+
133132 wfDebug( "EtherpadLite:efEtherpadLiteParserFunction_Render $output\n" );
134133 return array( $output, 'noparse' => true, 'isHTML' => true );
135 -
136134 }

Comments

#Comment by Wikinaut (talk | contribs)   23:56, 11 February 2012

(thanks. Re whitespaces: I need to use another editor)

#Comment by Wikinaut (talk | contribs)   00:02, 12 February 2012

(removal of unused variable: perfect. This parameter was a relict before I added $userName = $wgUser->getName();)

Status & tagging log