https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112639

Revision: 112639
Author:   reedy
Date:     2012-02-28 21:08:35 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
MFT r112045, r112046, r112049, r112061, r112066, r112079, r112128

Modified Paths:
--------------
    branches/REL1_19/phase3/includes/logging/LogEntry.php
    branches/REL1_19/phase3/includes/logging/LogFormatter.php
    branches/REL1_19/phase3/languages/messages/MessagesEn.php

Property Changed:
----------------
    branches/REL1_19/phase3/
    branches/REL1_19/phase3/includes/
    branches/REL1_19/phase3/languages/


Property changes on: branches/REL1_19/phase3
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/JSTesting:100352-107913
/branches/REL1_15/phase3:51646
/branches/REL1_17/phase3:81445,81448
/branches/new-installer/phase3:43664-66004
/branches/sqlite:58211-58321
/branches/wmf/1.18wmf1:97508,111667
/trunk/phase3:111002,111029,111034,111062,111067,111076,111085,111128,111144,111251,111380,111478,111571,111574,111580,111597,111658,111673,111695,111697,111809,111832,111983,112021,112034,112037,112152
   + /branches/JSTesting:100352-107913
/branches/REL1_15/phase3:51646
/branches/REL1_17/phase3:81445,81448
/branches/new-installer/phase3:43664-66004
/branches/sqlite:58211-58321
/branches/wmf/1.18wmf1:97508,111667
/trunk/phase3:111002,111029,111034,111062,111067,111076,111085,111128,111144,111251,111380,111478,111571,111574,111580,111597,111658,111673,111695,111697,111809,111832,111983,112021,112034,112037,112045-112046,112049,112061,112066,112079,112128,112152


Property changes on: branches/REL1_19/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/JSTesting/includes:100352-107913
/branches/REL1_15/phase3/includes:51646
/branches/new-installer/phase3/includes:43664-66004
/branches/sqlite/includes:58211-58321
/branches/wmf/1.18wmf1/includes:97508,111667
/branches/wmf-deployment/includes:53381
/trunk/phase3/includes:111029,111034,111067,111085,111128,111144,111251,111380,111571,111574,111597,111658,111673,111695,111697,111809,111832,111983,112021,112034,112037,112152
   + /branches/JSTesting/includes:100352-107913
/branches/REL1_15/phase3/includes:51646
/branches/new-installer/phase3/includes:43664-66004
/branches/sqlite/includes:58211-58321
/branches/wmf/1.18wmf1/includes:97508,111667
/branches/wmf-deployment/includes:53381
/trunk/phase3/includes:111029,111034,111067,111085,111128,111144,111251,111380,111571,111574,111597,111658,111673,111695,111697,111809,111832,111983,112021,112034,112037,112045-112046,112049,112061,112066,112079,112128,112152

Modified: branches/REL1_19/phase3/includes/logging/LogEntry.php
===================================================================
--- branches/REL1_19/phase3/includes/logging/LogEntry.php       2012-02-28 
21:07:45 UTC (rev 112638)
+++ branches/REL1_19/phase3/includes/logging/LogEntry.php       2012-02-28 
21:08:35 UTC (rev 112639)
@@ -461,7 +461,7 @@
                        $this->getTimestamp(),
                        $logpage,
                        $user,
-                       $formatter->getPlainActionText(), // Used for IRC feeds
+                       $formatter->getIRCActionText(), // Used for IRC feeds
                        $user->isAnon() ? $user->getName() : '',
                        $this->getType(),
                        $this->getSubtype(),

Modified: branches/REL1_19/phase3/includes/logging/LogFormatter.php
===================================================================
--- branches/REL1_19/phase3/includes/logging/LogFormatter.php   2012-02-28 
21:07:45 UTC (rev 112638)
+++ branches/REL1_19/phase3/includes/logging/LogFormatter.php   2012-02-28 
21:08:35 UTC (rev 112639)
@@ -77,6 +77,8 @@
         */
        protected $plaintext = false;
 
+       protected $irctext = false;
+
        protected function __construct( LogEntry $entry ) {
                $this->entry = $entry;
                $this->context = RequestContext::getMain();
@@ -141,6 +143,105 @@
        }
 
        /**
+        * Even uglier hack to maintain backwards compatibilty with IRC bots
+        * (bug 34508).
+        * @see getActionText()
+        * @return string text
+        */
+       public function getIRCActionText() {
+               $this->plaintext = true;
+               $text = $this->getActionText();
+
+               $entry = $this->entry;
+               $parameters = $entry->getParameters();
+               // @see LogPage::actionText()
+               $msgOpts = array( 'parsemag', 'escape', 'replaceafter', 
'content' );
+               // Text of title the action is aimed at.
+               $target = $entry->getTarget()->getPrefixedText() ;
+               $text = null;
+               switch( $entry->getType() ) {
+                       case 'move':
+                               switch( $entry->getSubtype() ) {
+                                       case 'move':
+                                               $movesource =  
$parameters['4::target'];
+                                               $text = wfMsgExt( '1movedto2', 
$msgOpts, $target, $movesource );
+                                               break;
+                                       case 'move_redir':
+                                               $movesource =  
$parameters['4::target'];
+                                               $text = wfMsgExt( 
'1movedto2_redir', $msgOpts, $target, $movesource );
+                                               break;
+                                       case 'move-noredirect':
+                                               break;
+                                       case 'move_redir-noredirect':
+                                               break;
+                               }
+                               break;
+
+                       case 'delete':
+                               switch( $entry->getSubtype() ) {
+                                       case 'delete':
+                                               $text = wfMsgExt( 
'deletedarticle', $msgOpts, $target );
+                                               break;
+                                       case 'restore':
+                                               $text = wfMsgExt( 
'undeletedarticle', $msgOpts, $target );
+                                               break;
+                                       //case 'revision': // Revision deletion
+                                       //case 'event': // Log deletion
+                                               // see 
https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/LogPage.php?&pathrev=97044&r1=97043&r2=97044
+                                       //default:
+                               }
+                               break;
+
+                       case 'patrol':
+                               // 
https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/PatrolLog.php?&pathrev=97495&r1=97494&r2=97495
+                               // Create a diff link to the patrolled revision
+                               if ( $entry->getSubtype() === 'patrol' ) {
+                                       $diffLink = htmlspecialchars(
+                                               wfMsgForContent( 
'patrol-log-diff', $parameters['4::curid'] ) );
+                                       $text = wfMsgForContent( 
'patrol-log-line', $diffLink, "[[$target]]", "" );
+                               } else {
+                                       // broken??
+                               }
+                               break;
+
+                       case 'newusers':
+                               switch( $entry->getSubtype() ) {
+                                       case 'newusers':
+                                       case 'create':
+                                               $text = wfMsgExt( 
'newuserlog-create-entry', $msgOpts /* no params */ );
+                                               break;
+                                       case 'create2':
+                                               $text = wfMsgExt( 
'newuserlog-create2-entry', $msgOpts, $target );
+                                               break;
+                                       case 'autocreate':
+                                               $text = wfMsgExt( 
'newuserlog-autocreate-entry', $msgOpts /* no params */ );
+                                               break;
+                               }
+                               break;
+
+                       case 'upload':
+                               switch( $entry->getSubtype() ) {
+                                       case 'upload':
+                                               $text = wfMsgExt( 
'uploadedimage', $msgOpts, $target );
+                                               break;
+                                       case 'overwrite':
+                                               $text = wfMsgExt( 
'overwroteimage', $msgOpts, $target );
+                                               break;
+                               }
+                               break;
+
+                       // case 'suppress' --private log -- aaron  (sign your 
messages so we know who to blame in a few years :-D)
+                       // default:
+               }
+               if( is_null( $text ) ) {
+                       $text = $this->getPlainActionText();
+               }
+
+               $this->plaintext = false;
+               return $text;
+       }
+
+       /**
         * Gets the log action, including username.
         * @return string HTML
         */
@@ -183,8 +284,8 @@
        protected function getMessageKey() {
                $type = $this->entry->getType();
                $subtype = $this->entry->getSubtype();
-               $key = "logentry-$type-$subtype";
-               return $key;
+
+               return "logentry-$type-$subtype";
        }
 
        /**


Property changes on: branches/REL1_19/phase3/languages
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/JSTesting/languages:100352-107913
/branches/REL1_15/phase3/languages:51646
/branches/REL1_17/phase3/languages:81445,81448
/branches/new-installer/phase3/languages:43664-66004
/branches/nikola/phase3/languages:85224,85239,85308
/branches/sqlite/languages:58211-58321
   + /branches/JSTesting/languages:100352-107913
/branches/REL1_15/phase3/languages:51646
/branches/REL1_17/phase3/languages:81445,81448
/branches/new-installer/phase3/languages:43664-66004
/branches/nikola/phase3/languages:85224,85239,85308
/branches/sqlite/languages:58211-58321
/trunk/phase3/languages:112049,112061,112066,112079,112128

Modified: branches/REL1_19/phase3/languages/messages/MessagesEn.php
===================================================================
--- branches/REL1_19/phase3/languages/messages/MessagesEn.php   2012-02-28 
21:07:45 UTC (rev 112638)
+++ branches/REL1_19/phase3/languages/messages/MessagesEn.php   2012-02-28 
21:08:35 UTC (rev 112639)
@@ -4708,6 +4708,34 @@
 'logentry-newusers-autocreate'        => 'Account $1 was created 
automatically',
 'newuserlog-byemail'                  => 'password sent by e-mail',
 
+# For IRC, see bug 34508.  Do not change
+'revdelete-logentry'          => 'changed revision visibility of "[[$1]]"',
+'logdelete-logentry'          => 'changed event visibility of "[[$1]]"',
+'revdelete-content'           => 'content',
+'revdelete-summary'           => 'edit summary',
+'revdelete-uname'             => 'username',
+'revdelete-hid'               => 'hid $1',
+'revdelete-unhid'             => 'unhid $1',
+'revdelete-log-message'       => '$1 for $2 {{PLURAL:$2|revision|revisions}}',
+'logdelete-log-message'       => '$1 for $2 {{PLURAL:$2|event|events}}',
+'deletedarticle'              => 'deleted "[[$1]]"',
+'suppressedarticle'           => 'suppressed "[[$1]]"',
+'undeletedarticle'            => 'restored "[[$1]]"',
+'patrol-log-line'             => 'marked $1 of $2 patrolled $3',
+'patrol-log-auto'             => '(automatic)',
+'patrol-log-diff'             => 'revision $1',
+'1movedto2'                   => 'moved [[$1]] to [[$2]]',
+'1movedto2_redir'             => 'moved [[$1]] to [[$2]] over redirect',
+'move-redirect-suppressed'    => 'redirect suppressed',
+'newuserlog-byemail'          => 'password sent by e-mail',
+'newuserlog-create-entry'     => 'New user account',
+'newuserlog-create2-entry'    => 'created new account $1',
+'newuserlog-autocreate-entry' => 'Account created automatically',
+'suppressedarticle'           => 'suppressed "[[$1]]"',
+'deletedarticle'              => 'deleted "[[$1]]"',
+'uploadedimage'               => 'uploaded "[[$1]]"',
+'overwroteimage'              => 'uploaded a new version of "[[$1]]"',
+
 # Feedback
 'feedback-bugornote' => 'If you are ready to describe a technical problem in 
detail please [$1 report a bug].
 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 @@
 'api-error-unknownerror'                  => 'Unknown error: "$1".',
 'api-error-uploaddisabled'                => 'Uploading is disabled on this 
wiki.',
 'api-error-verification-error'            => 'This file might be corrupt, or 
have the wrong extension.',
-
 );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to