r67298 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67297‎ | r67298 | r67299 >
Date:21:09, 3 June 2010
Author:yaron
Status:deferred
Tags:
Comment:
Moved smwfLoadExtensionMessages() calls into construct() method, so page header can be displayed correctly in MW 1.15
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/Export/SMW_SpecialOWLExport.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialProperties.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialTypes.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialUnusedProperties.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialWantedProperties.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/Statistics/SMW_SpecialStatistics.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/Export/SMW_SpecialOWLExport.php
@@ -30,6 +30,7 @@
3131
3232 public function __construct() {
3333 parent::__construct( 'ExportRDF' );
 34+ smwfLoadExtensionMessages( 'SemanticMediaWiki' );
3435 }
3536
3637 public function execute( $page = '' ) {
@@ -132,8 +133,6 @@
133134 }
134135 }
135136
136 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
137 -
138137 // nothing exported yet; show user interface:
139138 $html = '<form name="tripleSearch" action="" method="POST">' . "\n" .
140139 '<p>' . wfMsg( 'smw_exportrdf_docu' ) . "</p>\n" .
@@ -158,4 +157,4 @@
159158 $wgOut->addHTML( $html );
160159 }
161160
162 -}
\ No newline at end of file
 161+}
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialTypes.php
@@ -34,6 +34,7 @@
3535
3636 public function __construct() {
3737 parent::__construct( 'Types' );
 38+ smwfLoadExtensionMessages( 'SemanticMediaWiki' );
3839 }
3940
4041 public function execute( $param ) {
@@ -71,7 +72,6 @@
7273 }
7374
7475 function getPageHeader() {
75 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
7676 return '<p>' . wfMsg( 'smw_types_docu' ) . "</p><br />\n";
7777 }
7878
@@ -108,7 +108,6 @@
109109 $tv = SMWDataValueFactory::newTypeIDValue( '__typ', $titletext );
110110 $info = array();
111111 $error = array();
112 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
113112 if ( $tv->isAlias() ) { // print the type title as found, long text would (again) print the alias
114113 $ttitle = Title::makeTitle( SMW_NS_TYPE, $titletext );
115114 $link = $skin->makeKnownLinkObj( $ttitle, $ttitle->getText() ); // aliases are only found if the page exists
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialProperties.php
@@ -29,6 +29,7 @@
3030
3131 public function __construct() {
3232 parent::__construct( 'Properties' );
 33+ smwfLoadExtensionMessages( 'SemanticMediaWiki' );
3334 }
3435
3536 public function execute( $param ) {
@@ -74,7 +75,6 @@
7576 }
7677
7778 function getPageHeader() {
78 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
7979 return '<p>' . wfMsg( 'smw_properties_docu' ) . "</p><br />\n";
8080 }
8181
@@ -82,7 +82,6 @@
8383 global $wgLang;
8484 $typestring = '';
8585 $errors = array();
86 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
8786 if ( $result[0]->isUserDefined() && ( $result[1] <= 5 ) ) {
8887 $errors[] = wfMsg( 'smw_propertyhardlyused' );
8988 }
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialWantedProperties.php
@@ -29,6 +29,7 @@
3030
3131 public function __construct() {
3232 parent::__construct( 'WantedProperties' );
 33+ smwfLoadExtensionMessages( 'SemanticMediaWiki' );
3334 }
3435
3536 public function execute( $param ) {
@@ -74,7 +75,6 @@
7576 }
7677
7778 function getPageHeader() {
78 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
7979 return '<p>' . wfMsg( 'smw_wantedproperties_docu' ) . "</p><br />\n";
8080 }
8181
@@ -85,7 +85,6 @@
8686 } else {
8787 $proplink = $result[0]->getLongHTMLText( $skin );
8888 }
89 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
9089 return wfMsgExt( 'smw_wantedproperty_template', array( 'parsemag' ), $proplink, $result[1] );
9190 }
9291
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialUnusedProperties.php
@@ -29,6 +29,7 @@
3030
3131 public function __construct() {
3232 parent::__construct( 'UnusedProperties' );
 33+ smwfLoadExtensionMessages( 'SemanticMediaWiki' );
3334 }
3435
3536 public function execute( $param ) {
@@ -76,7 +77,6 @@
7778 }
7879
7980 function getPageHeader() {
80 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
8181 return '<p>' . wfMsg( 'smw_unusedproperties_docu' ) . "</p><br />\n";
8282 }
8383
@@ -85,7 +85,6 @@
8686 $proplink = $skin->makeKnownLinkObj( $result->getWikiPageValue()->getTitle(), $result->getWikiValue() );
8787 $types = smwfGetStore()->getPropertyValues( $result->getWikiPageValue(), SMWPropertyValue::makeProperty( '_TYPE' ) ); // TODO: do not bypass SMWDataValueFactory!
8888 $errors = array();
89 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
9089 if ( count( $types ) >= 1 ) {
9190 $typestring = current( $types )->getLongHTMLText( $skin );
9291 } else {
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php
@@ -57,7 +57,6 @@
5858
5959 // Produce output
6060 $html = '';
61 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
6261 if ( ( $propname == '' ) ) { // no property given, show a message
6362 $html .= wfMsg( 'smw_pp_docu' ) . "\n";
6463 } else { // property given, find and display results
Index: trunk/extensions/SemanticMediaWiki/specials/Statistics/SMW_SpecialStatistics.php
@@ -20,6 +20,7 @@
2121
2222 public function __construct() {
2323 parent::__construct( 'SemanticStatistics' );
 24+ smwfLoadExtensionMessages( 'SemanticMediaWiki' );
2425 }
2526
2627 public function execute( $param ) {
@@ -39,8 +40,6 @@
4041 )
4142 );
4243
43 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
44 -
4544 $out = wfMsgExt( 'smw_semstats_text', array( 'parse' ),
4645 $wgLang->formatNum( $semanticStatistics['PROPUSES'] ), $wgLang->formatNum( $semanticStatistics['USEDPROPS'] ),
4746 $wgLang->formatNum( $propertyPageAmount ), $wgLang->formatNum( $semanticStatistics['DECLPROPS'] )
@@ -49,4 +48,4 @@
5049 $wgOut->addHTML( $out );
5150 }
5251
53 -}
\ No newline at end of file
 52+}

Status & tagging log