Index: trunk/extensions/ArticleComments/ArticleComments.php |
— | — | @@ -181,7 +181,6 @@ |
182 | 182 | $tmp[strtolower( $k )] = (bool)strcasecmp( $v, "false" ); |
183 | 183 | } |
184 | 184 | $params = $tmp; |
185 | | - $ac = 'article-comments-'; |
186 | 185 | |
187 | 186 | # Build out the comment form. |
188 | 187 | $content = '<div id="commentForm">'; |
— | — | @@ -190,21 +189,21 @@ |
191 | 190 | $content .= '<p>'; |
192 | 191 | $content .= Html::hidden( 'commentArticle', $title->getPrefixedDBkey() ); |
193 | 192 | |
194 | | - $content .= '<label for="commenterName">' . wfMsgExt( $ac . 'name-field', array( 'parseinline', 'content' ) ) . Html::element( 'br' ) . '</label>'; |
| 193 | + $content .= '<label for="commenterName">' . wfMsgExt( 'article-comments-name-field', array( 'parseinline', 'content' ) ) . Html::element( 'br' ) . '</label>'; |
195 | 194 | $content .= Html::input( 'commenterName', '', 'text', array( 'id' => 'commenterName' ) ); |
196 | 195 | $content .= '</p>'; |
197 | 196 | |
198 | 197 | if ( $params['showurlfield'] ) { |
199 | | - $content .= '<p><label for="commenterURL">' . wfMsgExt( $ac . 'url-field', array( 'parseinline', 'content' ) ) . Html::element( 'br' ) . '</label>'; |
| 198 | + $content .= '<p><label for="commenterURL">' . wfMsgExt( 'article-comments-url-field', array( 'parseinline', 'content' ) ) . Html::element( 'br' ) . '</label>'; |
200 | 199 | $content .= Html::input( 'commenterURL', 'http://', 'text', array( 'id' => 'commenterURL' ) ); |
201 | 200 | $content .= '</p>'; |
202 | 201 | } |
203 | 202 | |
204 | | - $content .= '<p><label for="comment">' . wfMsgExt( $ac . 'comment-field', array( 'parseinline', 'content' ) ) . Html::element( 'br' ) . '</label>'; |
| 203 | + $content .= '<p><label for="comment">' . wfMsgExt( 'article-comments-comment-field', array( 'parseinline', 'content' ) ) . Html::element( 'br' ) . '</label>'; |
205 | 204 | |
206 | 205 | $content .= '<textarea id="comment" name="comment" style="width:30em" rows="5">' . '</textarea></p>'; |
207 | 206 | |
208 | | - $content .= '<p>' . Html::input( 'comment-submit', wfMsgForContent( $ac . 'submit-button' ), 'submit' ) . '</p>'; |
| 207 | + $content .= '<p>' . Html::input( 'comment-submit', wfMsgForContent( 'article-comments-submit-button' ), 'submit' ) . '</p>'; |
209 | 208 | $content .= '</form></div>'; |
210 | 209 | |
211 | 210 | # Short-circuit if noScript has been set to anything other than false |
— | — | @@ -230,7 +229,7 @@ |
231 | 230 | # Note: This is done dynamically with JavaScript since it would be annoying |
232 | 231 | # for JS-disabled browsers to have the prefilled text (since they'd have |
233 | 232 | # to manually delete it) and would break parser output caching |
234 | | - $pretext = wfMsgForContent( $ac . 'prefilled-comment-text' ); |
| 233 | + $pretext = wfMsgForContent( 'article-comments-prefilled-comment-text' ); |
235 | 234 | if ( $pretext ) { |
236 | 235 | $content .= |
237 | 236 | 'var comment = document.getElementById("comment");' . "\n" . |
— | — | @@ -259,7 +258,7 @@ |
260 | 259 | 'p.innerHTML="<a href=\'javascript:void(0)\' onclick=\'' . |
261 | 260 | 'document.getElementById(\\"commentForm\\").style.display=\\"block\\";' . |
262 | 261 | 'this.style.display=\\"none\\";false' . |
263 | | - '\'>' . wfMsgForContent( $ac . 'leave-comment-link' ) . '</a>";' . "\n" . |
| 262 | + '\'>' . wfMsgForContent( 'article-comments-leave-comment-link' ) . '</a>";' . "\n" . |
264 | 263 | 'cf.parentNode.insertBefore(p,cf);' . "\n"; |
265 | 264 | } |
266 | 265 | |
— | — | @@ -304,30 +303,29 @@ |
305 | 304 | $title = Title::newFromText( $titleText ); |
306 | 305 | |
307 | 306 | # Perform validation checks on supplied fields |
308 | | - $ac = 'article-comments-'; |
309 | 307 | $messages = array(); |
310 | 308 | |
311 | 309 | if ( !$wgRequest->wasPosted() ) |
312 | | - $messages[] = wfMsgForContent( $ac . 'not-posted' ); |
| 310 | + $messages[] = wfMsgForContent( 'article-comments-not-posted' ); |
313 | 311 | |
314 | 312 | if ( $titleText === '' || !$title ) { |
315 | 313 | $messages[] = wfMsgForContent( |
316 | | - $ac . 'invalid-field', wfMsgForContent( $ac . 'title-string' ), $titleText ); |
| 314 | + 'article-comments-invalid-field', wfMsgForContent( 'article-comments-title-string' ), $titleText ); |
317 | 315 | } |
318 | 316 | |
319 | 317 | if ( !$commenterName ) $messages[] = wfMsgForContent( |
320 | | - $ac . 'required-field', wfMsgForContent( $ac . 'name-string' ) ); |
| 318 | + 'article-comments-required-field', wfMsgForContent( 'article-comments-name-string' ) ); |
321 | 319 | |
322 | 320 | if ( !preg_match( "/^(" . wfUrlProtocols() . ')' . Parser::EXT_LINK_URL_CLASS . '+$/', $commenterURL ) ) |
323 | 321 | $messages[] = wfMsgForContent( |
324 | | - $ac . 'invalid-field', wfMsgForContent( $ac . 'url-string' ), $commenterURL ); |
| 322 | + 'article-comments-invalid-field', wfMsgForContent( 'article-comments-url-string' ), $commenterURL ); |
325 | 323 | |
326 | 324 | if ( !$comment ) $messages[] = wfMsgForContent( |
327 | | - $ac . 'required-field', wfMsgForContent( $ac . 'comment-string' ) ); |
| 325 | + 'article-comments-required-field', wfMsgForContent( 'article-comments-comment-string' ) ); |
328 | 326 | if ( !empty( $messages ) ) { |
329 | | - $wgOut->setPageTitle( wfMsgForContent( $ac . 'submission-failed' ) ); |
| 327 | + $wgOut->setPageTitle( wfMsgForContent( 'article-comments-submission-failed' ) ); |
330 | 328 | $wikiText = "<div class='errorbox'>"; |
331 | | - $wikiText .= wfMsgForContent( $ac . 'failure-reasons' ) . "\n\n"; |
| 329 | + $wikiText .= wfMsgForContent( 'article-comments-failure-reasons' ) . "\n\n"; |
332 | 330 | foreach ( $messages as $message ) { |
333 | 331 | $wikiText .= "* $message\n"; |
334 | 332 | } |
— | — | @@ -343,10 +341,10 @@ |
344 | 342 | |
345 | 343 | # Check whether user is blocked from editing the talk page |
346 | 344 | if ( $wgUser->isBlockedFrom( $talkTitle ) ) { |
347 | | - $wgOut->setPageTitle( wfMsgForContent( $ac . 'submission-failed' ) ); |
| 345 | + $wgOut->setPageTitle( wfMsgForContent( 'article-comments-submission-failed' ) ); |
348 | 346 | $wikiText = "<div class='errorbox'>"; |
349 | | - $wikiText .= wfMsgForContent( $ac . 'failure-reasons' ) . "\n\n"; |
350 | | - $wikiText .= '* ' . wfMsgForContent( $ac . 'user-is-blocked', $talkTitle->getPrefixedText() ) . "\n"; |
| 347 | + $wikiText .= wfMsgForContent( 'article-comments-failure-reasons' ) . "\n\n"; |
| 348 | + $wikiText .= '* ' . wfMsgForContent( 'article-comments-user-is-blocked', $talkTitle->getPrefixedText() ) . "\n"; |
351 | 349 | $wgOut->addWikiText( $wikiText . "</div>" ); |
352 | 350 | return; |
353 | 351 | } |
— | — | @@ -378,10 +376,10 @@ |
379 | 377 | preg_match( '/<comments( +[^>]*)?\\/>/', $articleContent ) === 0 && |
380 | 378 | preg_match( '/<comments( +[^>]*)?\\/>/', $talkContent ) === 0 |
381 | 379 | ) { |
382 | | - $wgOut->setPageTitle( wfMsgForContent( $ac . 'submission-failed' ) ); |
| 380 | + $wgOut->setPageTitle( wfMsgForContent( 'article-comments-submission-failed' ) ); |
383 | 381 | $wgOut->addWikiText( |
384 | 382 | "<div class='errorbox'>" . |
385 | | - wfMsgForContent( $ac . 'no-comments', $title->getPrefixedText() ) . |
| 383 | + wfMsgForContent( 'article-comments-no-comments', $title->getPrefixedText() ) . |
386 | 384 | "</div>" |
387 | 385 | ); |
388 | 386 | return; |
— | — | @@ -393,10 +391,10 @@ |
394 | 392 | |
395 | 393 | # If it's spam - it's gone! |
396 | 394 | if ( $isspam ) { |
397 | | - $wgOut->setPageTitle( wfMsgForContent( $ac . 'submission-failed' ) ); |
| 395 | + $wgOut->setPageTitle( wfMsgForContent( 'article-comments-submission-failed' ) ); |
398 | 396 | $wgOut->addWikiText( |
399 | 397 | "<div class='errorbox'>" . |
400 | | - wfMsgForContent( $ac . 'no-spam' ) . |
| 398 | + wfMsgForContent( 'article-comments-no-spam' ) . |
401 | 399 | "</div>" |
402 | 400 | ); |
403 | 401 | return; |
— | — | @@ -404,7 +402,7 @@ |
405 | 403 | |
406 | 404 | # Initialize the talk page's content. |
407 | 405 | if ( $talkContent == '' ) { |
408 | | - $talkContent = wfMsgForContent( $ac . 'talk-page-starter', $title->getPrefixedText() ); |
| 406 | + $talkContent = wfMsgForContent( 'article-comments-talk-page-starter', $title->getPrefixedText() ); |
409 | 407 | } |
410 | 408 | |
411 | 409 | # Determine signature components |
— | — | @@ -414,8 +412,8 @@ |
415 | 413 | |
416 | 414 | # Search for insertion point, or append most recent comment. |
417 | 415 | $commentText = wfMsgForContent( |
418 | | - $ac . 'new-comment', |
419 | | - wfMsgForContent( $ac . 'commenter-said', $commenterName ), |
| 416 | + 'article-comments-new-comment', |
| 417 | + wfMsgForContent( 'article-comments-commenter-said', $commenterName ), |
420 | 418 | $comment, |
421 | 419 | $sigText, |
422 | 420 | '~~~~~' |
— | — | @@ -435,12 +433,12 @@ |
436 | 434 | } |
437 | 435 | |
438 | 436 | # Update the talkArticle with the new comment |
439 | | - $summary = wfMsgForContent( $ac . 'summary', $commenterName ); |
| 437 | + $summary = wfMsgForContent( 'article-comments-summary', $commenterName ); |
440 | 438 | $talkArticle->doEdit( $talkContent, $summary ); |
441 | 439 | |
442 | | - $wgOut->setPageTitle( wfMsgForContent( $ac . 'submission-succeeded' ) ); |
443 | | - $wgOut->addWikiText( wfMsgForContent( $ac . 'submission-success', $title->getPrefixedText() ) ); |
444 | | - $wgOut->addWikiText( wfMsgForContent( $ac . 'submission-view-all', $talkTitle->getPrefixedText() ) ); |
| 440 | + $wgOut->setPageTitle( wfMsgForContent( 'article-comments-submission-succeeded' ) ); |
| 441 | + $wgOut->addWikiText( wfMsgForContent( 'article-comments-submission-success', $title->getPrefixedText() ) ); |
| 442 | + $wgOut->addWikiText( wfMsgForContent( 'article-comments-submission-view-all', $talkTitle->getPrefixedText() ) ); |
445 | 443 | } |
446 | 444 | |
447 | 445 | /** |