r106317 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106316‎ | r106317 | r106318 >
Date:13:26, 15 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Fixed mixed spaces and tabs
Modified paths:
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_QueryHandler.php (modified) (history)
  • /trunk/extensions/SoundManager2Button/SoundManager2Button.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SoundManager2Button/SoundManager2Button.php
@@ -1,5 +1,5 @@
22 <?php
3 -
 3+
44 # Initialization file for SoundManager2Button extension.
55 #
66 # @file SoundManager2Button.php
@@ -50,46 +50,57 @@
5151 # In args.js : toggle soundManager.debugMode = false;
5252
5353 if ( !defined( 'MEDIAWIKI' ) ) {
54 - echo "This is the SoundManager2Button MediaWiki extension. It cannot be run standalone.\n";
55 - die( -1 );
 54+ echo "This is the SoundManager2Button MediaWiki extension. It cannot be run standalone.\n";
 55+ die( -1 );
5656 }
57 -
 57+
5858 $wgExtensionCredits['media'][] = array(
59 - 'path' => __FILE__,
60 - 'name' => 'SoundManager2Button',
61 - 'author' => 'kroocsiogsi',
62 - 'url' => 'https://www.mediawiki.org/wiki/Extension:SoundManager2Button',
63 - 'descriptionmsg' => 'soundmanager2button-desc',
64 - 'version' => '0.3.0',
 59+ 'path' => __FILE__,
 60+ 'name' => 'SoundManager2Button',
 61+ 'author' => 'kroocsiogsi',
 62+ 'url' => 'https://www.mediawiki.org/wiki/Extension:SoundManager2Button',
 63+ 'descriptionmsg' => 'soundmanager2button-desc',
 64+ 'version' => '0.3.0',
6565 );
66 -
 66+
6767 $wgExtensionMessagesFiles['SoundManager2Button'] = dirname( __FILE__ ) . '/SoundManager2Button.i18n.php';
68 -
 68+
6969 $wgHooks['ParserFirstCallInit'][] = 'wfSoundManager2Button';
70 -
 70+
7171 $wgResourceModules['ext.wfSoundManager2Button'] = array(
72 - 'scripts' => array( 'script/soundmanager2-nodebug.js', 'script/mp3-player-button.js', 'script/args.js' ),
73 - 'styles' => 'css/mp3-player-button.css',
74 - 'localBasePath' => dirname( __FILE__ ),
75 - 'remoteExtPath' => 'SoundManager2Button',
 72+ 'scripts' => array( 'script/soundmanager2-nodebug.js', 'script/mp3-player-button.js', 'script/args.js' ),
 73+ 'styles' => 'css/mp3-player-button.css',
 74+ 'localBasePath' => dirname( __FILE__ ),
 75+ 'remoteExtPath' => 'SoundManager2Button',
7676 );
77 -
78 -// Hook our callback function into the parser
 77+
 78+/**
 79+ * Hook our callback function into the parser
 80+ *
 81+ * @param $parser Parser
 82+ * @return bool
 83+ */
7984 function wfSoundManager2Button( &$parser ) {
80 - $parser->setHook( 'sm2', 'renderSM2' );
81 - return true;
 85+ $parser->setHook( 'sm2', 'renderSM2' );
 86+ return true;
8287 }
83 -
84 -// Execute
 88+
 89+/**
 90+ * Execute
 91+ * @param $input
 92+ * @param $args
 93+ * @param $parser Parser
 94+ * @return string
 95+ */
8596 function renderSM2( $input, $args, $parser ) {
86 - global $wgExtensionAssetsPath;
87 - $parser->getOutput()->addModules( 'ext.wfSoundManager2Button' );
88 -
89 - $file = wfFindFile($input);
90 - if( $file ) {
91 - $url = $file->getFullURL();
92 - $output='<a href="'.$url.'" title="'.wfMsgForContent('play').'" class="sm2_button">'.wfMsgForContent('play').'</a>';
93 - };
94 -
95 - return $output;
 97+ $parser->getOutput()->addModules( 'ext.wfSoundManager2Button' );
 98+
 99+ $file = wfFindFile($input);
 100+ $output = '';
 101+ if( $file ) {
 102+ $url = $file->getFullURL();
 103+ $output='<a href="'.$url.'" title="'.wfMsgForContent('play').'" class="sm2_button">'.wfMsgForContent('play').'</a>';
 104+ }
 105+
 106+ return $output;
96107 }
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_QueryHandler.php
@@ -331,15 +331,15 @@
332332 }
333333
334334 if ( $this->titleLinkSeparate ) {
335 - $txt = $object->getTitle()->getText();
 335+ $txt = $object->getTitle()->getText();
336336
337 - if ( $this->pageLinkText !== '' ) {
338 - $txt = str_replace( '$1', $txt, $this->pageLinkText );
339 - }
 337+ if ( $this->pageLinkText !== '' ) {
 338+ $txt = str_replace( '$1', $txt, $this->pageLinkText );
 339+ }
340340 $text .= Html::element(
341341 'a',
342342 array( 'href' => $object->getTitle()->getFullUrl() ),
343 - $txt
 343+ $txt
344344 );
345345 }
346346 }
@@ -468,7 +468,7 @@
469469 $legend_labels = array();
470470
471471 // Look for display_options field, which can be set by Semantic Compound Queries
472 - // the location of this field changed in SMW 1.5
 472+ // the location of this field changed in SMW 1.5
473473 $display_location = method_exists( $row[0], 'getResultSubject' ) ? $row[0]->getResultSubject() : $row[0];
474474
475475 if ( property_exists( $display_location, 'display_options' ) && is_array( $display_location->display_options ) ) {

Status & tagging log