Index: branches/REL1_19/phase3/includes/logging/LogEntry.php |
— | — | @@ -461,7 +461,7 @@ |
462 | 462 | $this->getTimestamp(), |
463 | 463 | $logpage, |
464 | 464 | $user, |
465 | | - $formatter->getPlainActionText(), // Used for IRC feeds |
| 465 | + $formatter->getIRCActionText(), // Used for IRC feeds |
466 | 466 | $user->isAnon() ? $user->getName() : '', |
467 | 467 | $this->getType(), |
468 | 468 | $this->getSubtype(), |
Index: branches/REL1_19/phase3/includes/logging/LogFormatter.php |
— | — | @@ -77,6 +77,8 @@ |
78 | 78 | */ |
79 | 79 | protected $plaintext = false; |
80 | 80 | |
| 81 | + protected $irctext = false; |
| 82 | + |
81 | 83 | protected function __construct( LogEntry $entry ) { |
82 | 84 | $this->entry = $entry; |
83 | 85 | $this->context = RequestContext::getMain(); |
— | — | @@ -141,6 +143,105 @@ |
142 | 144 | } |
143 | 145 | |
144 | 146 | /** |
| 147 | + * Even uglier hack to maintain backwards compatibilty with IRC bots |
| 148 | + * (bug 34508). |
| 149 | + * @see getActionText() |
| 150 | + * @return string text |
| 151 | + */ |
| 152 | + public function getIRCActionText() { |
| 153 | + $this->plaintext = true; |
| 154 | + $text = $this->getActionText(); |
| 155 | + |
| 156 | + $entry = $this->entry; |
| 157 | + $parameters = $entry->getParameters(); |
| 158 | + // @see LogPage::actionText() |
| 159 | + $msgOpts = array( 'parsemag', 'escape', 'replaceafter', 'content' ); |
| 160 | + // Text of title the action is aimed at. |
| 161 | + $target = $entry->getTarget()->getPrefixedText() ; |
| 162 | + $text = null; |
| 163 | + switch( $entry->getType() ) { |
| 164 | + case 'move': |
| 165 | + switch( $entry->getSubtype() ) { |
| 166 | + case 'move': |
| 167 | + $movesource = $parameters['4::target']; |
| 168 | + $text = wfMsgExt( '1movedto2', $msgOpts, $target, $movesource ); |
| 169 | + break; |
| 170 | + case 'move_redir': |
| 171 | + $movesource = $parameters['4::target']; |
| 172 | + $text = wfMsgExt( '1movedto2_redir', $msgOpts, $target, $movesource ); |
| 173 | + break; |
| 174 | + case 'move-noredirect': |
| 175 | + break; |
| 176 | + case 'move_redir-noredirect': |
| 177 | + break; |
| 178 | + } |
| 179 | + break; |
| 180 | + |
| 181 | + case 'delete': |
| 182 | + switch( $entry->getSubtype() ) { |
| 183 | + case 'delete': |
| 184 | + $text = wfMsgExt( 'deletedarticle', $msgOpts, $target ); |
| 185 | + break; |
| 186 | + case 'restore': |
| 187 | + $text = wfMsgExt( 'undeletedarticle', $msgOpts, $target ); |
| 188 | + break; |
| 189 | + //case 'revision': // Revision deletion |
| 190 | + //case 'event': // Log deletion |
| 191 | + // see https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/LogPage.php?&pathrev=97044&r1=97043&r2=97044 |
| 192 | + //default: |
| 193 | + } |
| 194 | + break; |
| 195 | + |
| 196 | + case 'patrol': |
| 197 | + // https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/PatrolLog.php?&pathrev=97495&r1=97494&r2=97495 |
| 198 | + // Create a diff link to the patrolled revision |
| 199 | + if ( $entry->getSubtype() === 'patrol' ) { |
| 200 | + $diffLink = htmlspecialchars( |
| 201 | + wfMsgForContent( 'patrol-log-diff', $parameters['4::curid'] ) ); |
| 202 | + $text = wfMsgForContent( 'patrol-log-line', $diffLink, "[[$target]]", "" ); |
| 203 | + } else { |
| 204 | + // broken?? |
| 205 | + } |
| 206 | + break; |
| 207 | + |
| 208 | + case 'newusers': |
| 209 | + switch( $entry->getSubtype() ) { |
| 210 | + case 'newusers': |
| 211 | + case 'create': |
| 212 | + $text = wfMsgExt( 'newuserlog-create-entry', $msgOpts /* no params */ ); |
| 213 | + break; |
| 214 | + case 'create2': |
| 215 | + $text = wfMsgExt( 'newuserlog-create2-entry', $msgOpts, $target ); |
| 216 | + break; |
| 217 | + case 'autocreate': |
| 218 | + $text = wfMsgExt( 'newuserlog-autocreate-entry', $msgOpts /* no params */ ); |
| 219 | + break; |
| 220 | + } |
| 221 | + break; |
| 222 | + |
| 223 | + case 'upload': |
| 224 | + switch( $entry->getSubtype() ) { |
| 225 | + case 'upload': |
| 226 | + $text = wfMsgExt( 'uploadedimage', $msgOpts, $target ); |
| 227 | + break; |
| 228 | + case 'overwrite': |
| 229 | + $text = wfMsgExt( 'overwroteimage', $msgOpts, $target ); |
| 230 | + break; |
| 231 | + } |
| 232 | + break; |
| 233 | + |
| 234 | + // case 'suppress' --private log -- aaron (sign your messages so we know who to blame in a few years :-D) |
| 235 | + // default: |
| 236 | + } |
| 237 | + if( is_null( $text ) ) { |
| 238 | + $text = $this->getPlainActionText(); |
| 239 | + } |
| 240 | + |
| 241 | + $this->plaintext = false; |
| 242 | + return $text; |
| 243 | + } |
| 244 | + |
| 245 | + /** |
145 | 246 | * Gets the log action, including username. |
146 | 247 | * @return string HTML |
147 | 248 | */ |
— | — | @@ -183,8 +284,8 @@ |
184 | 285 | protected function getMessageKey() { |
185 | 286 | $type = $this->entry->getType(); |
186 | 287 | $subtype = $this->entry->getSubtype(); |
187 | | - $key = "logentry-$type-$subtype"; |
188 | | - return $key; |
| 288 | + |
| 289 | + return "logentry-$type-$subtype"; |
189 | 290 | } |
190 | 291 | |
191 | 292 | /** |
Property changes on: branches/REL1_19/phase3/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
192 | 293 | Merged /trunk/phase3/includes:r112045-112046,112049,112061,112066,112079,112128 |
Index: branches/REL1_19/phase3/languages/messages/MessagesEn.php |
— | — | @@ -4708,6 +4708,34 @@ |
4709 | 4709 | 'logentry-newusers-autocreate' => 'Account $1 was created automatically', |
4710 | 4710 | 'newuserlog-byemail' => 'password sent by e-mail', |
4711 | 4711 | |
| 4712 | +# For IRC, see bug 34508. Do not change |
| 4713 | +'revdelete-logentry' => 'changed revision visibility of "[[$1]]"', |
| 4714 | +'logdelete-logentry' => 'changed event visibility of "[[$1]]"', |
| 4715 | +'revdelete-content' => 'content', |
| 4716 | +'revdelete-summary' => 'edit summary', |
| 4717 | +'revdelete-uname' => 'username', |
| 4718 | +'revdelete-hid' => 'hid $1', |
| 4719 | +'revdelete-unhid' => 'unhid $1', |
| 4720 | +'revdelete-log-message' => '$1 for $2 {{PLURAL:$2|revision|revisions}}', |
| 4721 | +'logdelete-log-message' => '$1 for $2 {{PLURAL:$2|event|events}}', |
| 4722 | +'deletedarticle' => 'deleted "[[$1]]"', |
| 4723 | +'suppressedarticle' => 'suppressed "[[$1]]"', |
| 4724 | +'undeletedarticle' => 'restored "[[$1]]"', |
| 4725 | +'patrol-log-line' => 'marked $1 of $2 patrolled $3', |
| 4726 | +'patrol-log-auto' => '(automatic)', |
| 4727 | +'patrol-log-diff' => 'revision $1', |
| 4728 | +'1movedto2' => 'moved [[$1]] to [[$2]]', |
| 4729 | +'1movedto2_redir' => 'moved [[$1]] to [[$2]] over redirect', |
| 4730 | +'move-redirect-suppressed' => 'redirect suppressed', |
| 4731 | +'newuserlog-byemail' => 'password sent by e-mail', |
| 4732 | +'newuserlog-create-entry' => 'New user account', |
| 4733 | +'newuserlog-create2-entry' => 'created new account $1', |
| 4734 | +'newuserlog-autocreate-entry' => 'Account created automatically', |
| 4735 | +'suppressedarticle' => 'suppressed "[[$1]]"', |
| 4736 | +'deletedarticle' => 'deleted "[[$1]]"', |
| 4737 | +'uploadedimage' => 'uploaded "[[$1]]"', |
| 4738 | +'overwroteimage' => 'uploaded a new version of "[[$1]]"', |
| 4739 | + |
4712 | 4740 | # Feedback |
4713 | 4741 | 'feedback-bugornote' => 'If you are ready to describe a technical problem in detail please [$1 report a bug]. |
4714 | 4742 | Otherwise, you can use the easy form below. Your comment will be added to the page "[$3 $2]", along with your username and what browser you are using.', |
— | — | @@ -4761,5 +4789,4 @@ |
4762 | 4790 | 'api-error-unknownerror' => 'Unknown error: "$1".', |
4763 | 4791 | 'api-error-uploaddisabled' => 'Uploading is disabled on this wiki.', |
4764 | 4792 | 'api-error-verification-error' => 'This file might be corrupt, or have the wrong extension.', |
4765 | | - |
4766 | 4793 | ); |
Property changes on: branches/REL1_19/phase3/languages |
___________________________________________________________________ |
Modified: svn:mergeinfo |
4767 | 4794 | Merged /trunk/phase3/languages:r112049,112061,112066,112079,112128 |
Property changes on: branches/REL1_19/phase3 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
4768 | 4795 | Merged /trunk/phase3:r112045-112046,112049,112061,112066,112079,112128 |