r80578 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80577‎ | r80578 | r80579 >
Date:17:59, 19 January 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Removed calls to wfLoadExtensionMessages all through the code and incremented version to 1.5.3 alpha
Modified paths:
  • /trunk/extensions/SemanticResultFormats/BibTeX/SRF_BibTeX.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Exhibit/SRF_Exhibit.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Math/SRF_Math.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Outline/SRF_Outline.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/SemanticResultFormats.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/iCalendar/SRF_iCalendar.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/vCard/SRF_vCard.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/Outline/SRF_Outline.php
@@ -32,7 +32,6 @@
3333 if ( array_key_exists( $field_name, $this->mVals ) )
3434 return $this->mVals[$field_name];
3535 else {
36 - wfLoadExtensionMessages( 'SemanticResultFormats' );
3736 return array( wfMsg( 'srf_outline_novalue' ) );
3837 }
3938 }
Index: trunk/extensions/SemanticResultFormats/iCalendar/SRF_iCalendar.php
@@ -53,7 +53,6 @@
5454 }
5555
5656 public function getName() {
57 - wfLoadExtensionMessages( 'SemanticResultFormats' );
5857 return wfMsg( 'srf_printername_icalendar' );
5958 }
6059
@@ -119,7 +118,6 @@
120119 if ( $this->getSearchLabel( $outputmode ) ) {
121120 $label = $this->getSearchLabel( $outputmode );
122121 } else {
123 - wfLoadExtensionMessages( 'SemanticResultFormats' );
124122 $label = wfMsgForContent( 'srf_icalendar_link' );
125123 }
126124
Index: trunk/extensions/SemanticResultFormats/SemanticResultFormats.php
@@ -20,7 +20,7 @@
2121 die( 'Not an entry point.' );
2222 }
2323
24 -define( 'SRF_VERSION', '1.5.2' );
 24+define( 'SRF_VERSION', '1.5.3 alpha' );
2525
2626 // Require the settings file.
2727 require dirname( __FILE__ ) . '/SRF_Settings.php';
@@ -46,6 +46,8 @@
4747 // FIXME: Can be removed when new style magic words are used (introduced in r52503)
4848 $wgHooks['LanguageGetMagic'][] = 'SRFParserFunctions::languageGetMagic';
4949
 50+$wgExtensionFunctions[] = 'efSRFSetup';
 51+
5052 $wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'other'][] = array(
5153 'path' => __FILE__,
5254 'name' => 'Semantic Result Formats',
@@ -60,7 +62,8 @@
6163 'David Loomer',
6264 '[http://simia.net Denny Vrandecic]',
6365 'Hans-Jörg Happel',
64 - 'Rowan Rodrik van der Molen'
 66+ 'Rowan Rodrik van der Molen',
 67+ '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]'
6568 ),
6669 'url' => 'http://semantic-mediawiki.org/wiki/Help:Semantic_Result_Formats',
6770 'descriptionmsg' => 'srf-desc'
@@ -131,6 +134,25 @@
132135 }
133136
134137 /**
 138+ * Extension initialization hook.
 139+ *
 140+ * @since 0.5.3
 141+ *
 142+ * @return true
 143+ */
 144+function efSRFSetup() {
 145+ global $wgVersion;
 146+
 147+ // This function has been deprecated in 1.16, but needed for earlier versions.
 148+ // It's present in 1.16 as a stub, but lets check if it exists in case it gets removed at some point.
 149+ if ( version_compare( $wgVersion, '1.15', '<=' ) ) {
 150+ wfLoadExtensionMessages( 'SemanticResultFormats' );
 151+ }
 152+
 153+ return true;
 154+}
 155+
 156+/**
135157 * Adds a link to Admin Links page.
136158 */
137159 function srffAddToAdminLinks( &$admin_links_tree ) {
@@ -142,7 +164,6 @@
143165 }
144166
145167 $smw_docu_row = $displaying_data_section->getRow( 'smw' );
146 - wfLoadExtensionMessages( 'SemanticResultFormats' );
147168 $srf_docu_label = wfMsg( 'adminlinks_documentation', wfMsg( 'srf-name' ) );
148169 $smw_docu_row->addItem( AlItem::newFromExternalLink( 'http://www.mediawiki.org/wiki/Extension:Semantic_Result_Formats', $srf_docu_label ) );
149170
Index: trunk/extensions/SemanticResultFormats/Math/SRF_Math.php
@@ -14,7 +14,6 @@
1515 class SRFMath extends SMWResultPrinter {
1616
1717 public function getName() {
18 - wfLoadExtensionMessages( 'SemanticResultFormats' );
1918 return wfMsg( 'srf_printername_' . $this->mFormat );
2019 }
2120
Index: trunk/extensions/SemanticResultFormats/Exhibit/SRF_Exhibit.php
@@ -50,9 +50,6 @@
5151
5252 global $smwgIQRunningNumber, $wgScriptPath, $wgGoogleMapsKey, $smwgScriptPath, $srfgIP, $srfgScriptPath;
5353
54 - wfLoadExtensionMessages( 'SemanticMediaWiki' );
55 -
56 -
5754 // //////////////////////////////
5855 // ///////REMOTE STUFF///////////
5956 // //////////////////////////////
Index: trunk/extensions/SemanticResultFormats/vCard/SRF_vCard.php
@@ -33,7 +33,6 @@
3434 }
3535
3636 public function getName() {
37 - wfLoadExtensionMessages( 'SemanticResultFormats' );
3837 return wfMsg( 'srf_printername_vcard' );
3938 }
4039
@@ -316,7 +315,6 @@
317316 if ( $this->getSearchLabel( $outputmode ) ) {
318317 $label = $this->getSearchLabel( $outputmode );
319318 } else {
320 - wfLoadExtensionMessages( 'SemanticResultFormats' );
321319 $label = wfMsgForContent( 'srf_vcard_link' );
322320 }
323321 $link = $res->getQueryLink( $label );
Index: trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php
@@ -16,7 +16,6 @@
1717
1818 public function getName()
1919 {
20 - wfLoadExtensionMessages( 'SemanticResultFormats' );
2120 return wfMsg( 'srf_printername_gallery' );
2221 }
2322
Index: trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php
@@ -34,7 +34,6 @@
3535 }
3636
3737 public function getName() {
38 - wfLoadExtensionMessages( 'SemanticResultFormats' );
3938 return wfMsg( 'srf_printername_calendar' );
4039 }
4140
@@ -214,7 +213,6 @@
215214 'media' => "screen, print",
216215 'href' => $srfgScriptPath . "/Calendar/skins/SRFC_main.css"
217216 ) );
218 - wfLoadExtensionMessages( 'SemanticResultFormats' );
219217
220218 // set variables differently depending on whether this is
221219 // being called from an #ask call or the Special:Ask page
Index: trunk/extensions/SemanticResultFormats/BibTeX/SRF_BibTeX.php
@@ -50,7 +50,6 @@
5151 }
5252
5353 public function getName() {
54 - wfLoadExtensionMessages( 'SemanticResultFormats' );
5554 return wfMsg( 'srf_printername_bibtex' );
5655 }
5756
@@ -287,7 +286,6 @@
288287 if ( $this->getSearchLabel( $outputmode ) ) {
289288 $label = $this->getSearchLabel( $outputmode );
290289 } else {
291 - wfLoadExtensionMessages( 'SemanticResultFormats' );
292290 $label = wfMsgForContent( 'srf_bibtex_link' );
293291 }
294292 $link = $res->getQueryLink( $label );

Status & tagging log