r106595 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106594‎ | r106595 | r106596 >
Date:20:18, 18 December 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
follow up to r106404, use wfMessage and Message class as Nikerabbit suggested
Modified paths:
  • /trunk/extensions/EducationProgram/specials/SpecialEPFormPage.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEPPage.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialInstitutions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialInstitutions.php
@@ -41,7 +41,7 @@
4242 $org = EPOrg::has( array( 'name' => $this->subPage ) );
4343
4444 if ( $org === false ) {
45 - $this->showError( 'ep-institutions-nosuchinstitution', $this->subPage );
 45+ $this->showError( wfMessage( 'ep-institutions-nosuchinstitution', $this->subPage ) );
4646 $this->displayPage();
4747 }
4848 else {
Index: trunk/extensions/EducationProgram/specials/SpecialEPPage.php
@@ -73,13 +73,11 @@
7474 *
7575 * @since 0.1
7676 *
77 - * @param string $message Message key
78 - * @param array|string $args Message arguments
 77+ * @param Message $message
7978 */
80 - protected function showError( $message, $args = array() ) {
81 - $message = call_user_func_array( 'wfMsgExt', array_merge( array( $message ), (array)$args ) );
 79+ protected function showError( Message $message ) {
8280 $this->getOutput()->addHTML(
83 - '<p class="visualClear errorbox">' . $message . '</p>'
 81+ '<p class="visualClear errorbox">' . $message->parse() . '</p>'
8482 . '<hr style="display: block; clear: both; visibility: hidden;" />'
8583 );
8684 }
@@ -89,13 +87,11 @@
9088 *
9189 * @since 0.1
9290 *
93 - * @param string $message Message key
94 - * @param array|string $args Message arguments
 91+ * @param Message $message
9592 */
96 - protected function showWarning( $message, $args = array() ) {
97 - $message = call_user_func_array( 'wfMsgExt', array_merge( array( $message ), (array)$args ) );
 93+ protected function showWarning( Message $message ) {
9894 $this->getOutput()->addHTML(
99 - '<p class="visualClear warningbox">' . $message . '</p>'
 95+ '<p class="visualClear warningbox">' . $message->parse() . '</p>'
10096 . '<hr style="display: block; clear: both; visibility: hidden;" />'
10197 );
10298 }
@@ -105,13 +101,11 @@
106102 *
107103 * @since 0.1
108104 *
109 - * @param string $message Message key
110 - * @param array|string $args Message arguments
 105+ * @param Message $message
111106 */
112 - protected function showSuccess( $message, $args = array() ) {
113 - $message = call_user_func_array( 'wfMsgExt', array_merge( array( $message ), (array)$args ) );
 107+ protected function showSuccess( Message $message ) {
114108 $this->getOutput()->addHTML(
115 - '<div class="successbox"><strong><p>' . $message . '</p></strong></div>'
 109+ '<div class="successbox"><strong><p>' . $message->parse() . '</p></strong></div>'
116110 . '<hr style="display: block; clear: both; visibility: hidden;" />'
117111 );
118112 }
Index: trunk/extensions/EducationProgram/specials/SpecialEPFormPage.php
@@ -110,7 +110,7 @@
111111 $object = new $c( $data, true );
112112 }
113113 else {
114 - $this->showWarning( 'educationprogram-' . strtolower( $this->getName() ) . '-exists-already' );
 114+ $this->showWarning( wfMessage( 'educationprogram-' . strtolower( $this->getName() ) . '-exists-already' ) );
115115 }
116116 }
117117 else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106404unfinished code, will follow up soonish, from other devicejeroendedauw02:24, 16 December 2011

Status & tagging log