Index: trunk/extensions/SoundManager2Button/SoundManager2Button.php |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | <?php |
3 | | - |
| 3 | + |
4 | 4 | # Initialization file for SoundManager2Button extension. |
5 | 5 | # |
6 | 6 | # @file SoundManager2Button.php |
— | — | @@ -50,46 +50,57 @@ |
51 | 51 | # In args.js : toggle soundManager.debugMode = false; |
52 | 52 | |
53 | 53 | 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 ); |
56 | 56 | } |
57 | | - |
| 57 | + |
58 | 58 | $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', |
65 | 65 | ); |
66 | | - |
| 66 | + |
67 | 67 | $wgExtensionMessagesFiles['SoundManager2Button'] = dirname( __FILE__ ) . '/SoundManager2Button.i18n.php'; |
68 | | - |
| 68 | + |
69 | 69 | $wgHooks['ParserFirstCallInit'][] = 'wfSoundManager2Button'; |
70 | | - |
| 70 | + |
71 | 71 | $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', |
76 | 76 | ); |
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 | + */ |
79 | 84 | function wfSoundManager2Button( &$parser ) { |
80 | | - $parser->setHook( 'sm2', 'renderSM2' ); |
81 | | - return true; |
| 85 | + $parser->setHook( 'sm2', 'renderSM2' ); |
| 86 | + return true; |
82 | 87 | } |
83 | | - |
84 | | -// Execute |
| 88 | + |
| 89 | +/** |
| 90 | + * Execute |
| 91 | + * @param $input |
| 92 | + * @param $args |
| 93 | + * @param $parser Parser |
| 94 | + * @return string |
| 95 | + */ |
85 | 96 | 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; |
96 | 107 | } |
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_QueryHandler.php |
— | — | @@ -331,15 +331,15 @@ |
332 | 332 | } |
333 | 333 | |
334 | 334 | if ( $this->titleLinkSeparate ) { |
335 | | - $txt = $object->getTitle()->getText(); |
| 335 | + $txt = $object->getTitle()->getText(); |
336 | 336 | |
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 | + } |
340 | 340 | $text .= Html::element( |
341 | 341 | 'a', |
342 | 342 | array( 'href' => $object->getTitle()->getFullUrl() ), |
343 | | - $txt |
| 343 | + $txt |
344 | 344 | ); |
345 | 345 | } |
346 | 346 | } |
— | — | @@ -468,7 +468,7 @@ |
469 | 469 | $legend_labels = array(); |
470 | 470 | |
471 | 471 | // 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 |
473 | 473 | $display_location = method_exists( $row[0], 'getResultSubject' ) ? $row[0]->getResultSubject() : $row[0]; |
474 | 474 | |
475 | 475 | if ( property_exists( $display_location, 'display_options' ) && is_array( $display_location->display_options ) ) { |