http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56317

Revision: 56317
Author:   mrzman
Date:     2009-09-14 18:10:13 +0000 (Mon, 14 Sep 2009)

Log Message:
-----------
Replace the user rename log display for non-existent userpages with a hook 
(followup to r56251).
Update for Renameuser extension to follow.

Also make docs for LogEventsList::showLogExtract() actually useful

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/docs/hooks.txt
    trunk/phase3/includes/Article.php
    trunk/phase3/includes/LogEventsList.php
    trunk/phase3/languages/messages/MessagesEn.php
    trunk/phase3/maintenance/language/messages.inc

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2009-09-14 17:57:04 UTC (rev 56316)
+++ trunk/phase3/RELEASE-NOTES  2009-09-14 18:10:13 UTC (rev 56317)
@@ -222,8 +222,9 @@
   excerpt from the block log.
 * (bug 19646) New hook: ImgAuthBeforeStream for tests and functionality before
   file is streamed to user, but only when using img_auth
-* Note on non-existing user and user talk pages if user does not exist and show
-  renameuser log if the user has been renamed
+* Note on non-existing user and user talk pages if user does not exist
+* New hook ShowMissingArticle so extensions can modify the output for 
+  non-existent pages.
 
 === Bug fixes in 1.16 ===
 

Modified: trunk/phase3/docs/hooks.txt
===================================================================
--- trunk/phase3/docs/hooks.txt 2009-09-14 17:57:04 UTC (rev 56316)
+++ trunk/phase3/docs/hooks.txt 2009-09-14 18:10:13 UTC (rev 56317)
@@ -1231,6 +1231,9 @@
 
 'SetupAfterCache': Called in Setup.php, after cache objects are set
 
+'ShowMissingArticle': Called when generating the output for a non-existent page
+$article: The article object corresponding to the page
+
 'ShowRawCssJs': Customise the output of raw CSS and JavaScript in page views
 $text: Text being shown
 $title: Title of the custom script/stylesheet page

Modified: trunk/phase3/includes/Article.php
===================================================================
--- trunk/phase3/includes/Article.php   2009-09-14 17:57:04 UTC (rev 56316)
+++ trunk/phase3/includes/Article.php   2009-09-14 18:10:13 UTC (rev 56317)
@@ -1201,20 +1201,17 @@
        public function showMissingArticle() {
                global $wgOut, $wgRequest, $wgUser;
 
-               # Show info in user (talk) namespace. Does the user exist and 
if not, has he been renamed.
+               # Show info in user (talk) namespace. Does the user exist?
                if ( $this->mTitle->getNamespace() == NS_USER || 
$this->mTitle->getNamespace() == NS_USER_TALK ) {
                        $id = User::idFromName( $this->mTitle->getBaseText() );
                        $ip = User::isIP( $this->mTitle->getBaseText() );
                        if ( $id == 0 && !$ip ) { # User does not exist
                                $wgOut->wrapWikiMsg( '<div 
class="mw-userpage-userdoesnotexist error">$1</div>',
                                        array( 
'userpage-userdoesnotexist-view', $this->mTitle->getBaseText() ) );
-
-                               # Show rename log because user does not exist. 
-                               $parent = $this->mTitle->getNsText() . ":" . 
$this->mTitle->getBaseText();
-                               LogEventsList::showLogExtract( $wgOut, 
'renameuser', $parent, '', 10, array(), false, 'renamed-notice' );
                        }
 
                }
+               wfRunHooks( 'ShowMissingArticle', array( $this ) );
                # Show delete and move logs
                LogEventsList::showLogExtract( $wgOut, array( 'delete', 'move' 
), 
                        $this->mTitle->getPrefixedText(), '', 10, array( 
"log_action != 'revision'" ), false, 'moveddeleted-notice');

Modified: trunk/phase3/includes/LogEventsList.php
===================================================================
--- trunk/phase3/includes/LogEventsList.php     2009-09-14 17:57:04 UTC (rev 
56316)
+++ trunk/phase3/includes/LogEventsList.php     2009-09-14 18:10:13 UTC (rev 
56317)
@@ -569,10 +569,10 @@
         * Show log extract. Either with text and a box (set $msgKey) or 
without (don't set $msgKey)
         * @param $out OutputPage or String-by-reference
         * @param $types String or Array
-        * @param $page String
-        * @param $user String
+        * @param $page String The page title to show log entries for
+        * @param $user String The user who made the log entries
         * @param $lim Integer Limit of items to show, default is 50
-        * @param $conds Array
+        * @param $conds Array Extra conditions for the query
         * @param $showIfEmpty boolean Set to false if you don't want any 
output in case the loglist is empty
         *              if set to true (default), "No matching items in log" is 
displayed if loglist is empty
         * @param $msgKey String if you want a nice box with a message, set 
this to the key of the message
@@ -663,13 +663,13 @@
        /**
         * constructor
         * @param $list LogEventsList
-        * @param $types String or Array
-        * @param $user String
-        * @param $title String
-        * @param $pattern String
-        * @param $conds Array
-        * @param $year Integer
-        * @param $month Integer
+        * @param $types String or Array log types to show
+        * @param $user String The user who made the log entries
+        * @param $title String The page title the log entries are for
+        * @param $pattern String Do a prefix search rather than an exact title 
match
+        * @param $conds Array Extra conditions for the query
+        * @param $year Integer The year to start from
+        * @param $month Integer The month to start from
         */
        public function __construct( $list, $types = array(), $user = '', 
$title = '', $pattern = '',
                $conds = array(), $year = false, $month = false, $tagFilter = 
'' ) 

Modified: trunk/phase3/languages/messages/MessagesEn.php
===================================================================
--- trunk/phase3/languages/messages/MessagesEn.php      2009-09-14 17:57:04 UTC 
(rev 56316)
+++ trunk/phase3/languages/messages/MessagesEn.php      2009-09-14 18:10:13 UTC 
(rev 56317)
@@ -1342,8 +1342,6 @@
 The deletion and move log for this page are provided here for convenience:",
 'moveddeleted-notice'              => 'This page has been deleted.
 The deletion and move log for the page are provided below for reference.',
-'renamed-notice'                   => 'This user has been renamed.
-The rename log is provided below for reference.',
 'log-fulllog'                      => 'View full log',
 'edit-hook-aborted'                => 'Edit aborted by hook.
 It gave no explanation.',

Modified: trunk/phase3/maintenance/language/messages.inc
===================================================================
--- trunk/phase3/maintenance/language/messages.inc      2009-09-14 17:57:04 UTC 
(rev 56316)
+++ trunk/phase3/maintenance/language/messages.inc      2009-09-14 18:10:13 UTC 
(rev 56317)
@@ -589,7 +589,6 @@
                'permissionserrorstext-withaction',
                'recreate-moveddeleted-warn',
                'moveddeleted-notice',
-               'renamed-notice',
                'log-fulllog',
                'edit-hook-aborted',
                'edit-gone-missing',



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

Reply via email to