r109219 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109218‎ | r109219 | r109220 >
Date:21:33, 17 January 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added missing args in log formatting code
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.hooks.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPUtils.php (modified) (history)
  • /trunk/extensions/EducationProgram/resources/ep.instructor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/includes/EPUtils.php
@@ -45,7 +45,7 @@
4646 else {
4747 // Compatibility with MediaWiki 1.18.
4848 $log = new LogPage( $info['type'] );
49 -
 49+
5050 $log->addEntry(
5151 $info['subtype'],
5252 $info['title'],
Index: trunk/extensions/EducationProgram/resources/ep.instructor.js
@@ -125,9 +125,9 @@
126126 $add.button( 'option', 'label', ep.msg( 'ep-instructor-adding' ) );
127127
128128 ep.api.addInstructor( {
129 - 'courseid': this.courseId,
130 - 'username': this.getName(),
131 - 'reason': this.summaryInput.val()
 129+ 'courseid': _this.courseId,
 130+ 'username': _this.getName(),
 131+ 'reason': _this.summaryInput.val()
132132 } ).done( function() {
133133 _this.$dialog.text( ep.msg(
134134 _this.selfMode ? 'ep-instructor-addittion-self-success' : 'ep-instructor-addittion-success',
Index: trunk/extensions/EducationProgram/EducationProgram.hooks.php
@@ -152,12 +152,22 @@
153153 */
154154 public static function formatLogEntry( $type, $action, Title $title, $forUI, array $params ) {
155155 global $wgContLang, $wgLang;
156 -
157 - return wfMessage( 'logentry-' . $type . '-' . $action )->params(
158 - '', // User link in the new system
159 - '#', // User name for gender in the new system
160 - Message::rawParam( $forUI ? Linker::link( $title ) : $title->getPrefixedText() )
161 - )->inLanguage( $forUI === null ? $wgContLang : $wgLang )->text();
 156+
 157+ $message = wfMessage( 'logentry-' . $type . '-' . $action );
 158+
 159+ $message = call_user_func_array(
 160+ array( $message, 'params' ),
 161+ array_merge(
 162+ array(
 163+ '', // User link in the new system
 164+ '#', // User name for gender in the new system
 165+ Message::rawParam( $forUI ? Linker::link( $title ) : $title->getPrefixedText() )
 166+ ),
 167+ $params
 168+ )
 169+ );
 170+
 171+ return $message->inLanguage( $forUI === null ? $wgContLang : $wgLang )->text();
162172 }
163173
164174 }

Status & tagging log