r47469 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47468‎ | r47469 | r47470 >
Date:21:46, 18 February 2009
Author:ialex
Status:resolved (Comments)
Tags:
Comment:
(bug 16762) Special:Movepage now shows a list of subpages when possible
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMovepage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -68,6 +68,7 @@
6969 * Juliano F. Ravasi
7070 * Lucas Garczewski
7171 * Louperivois
 72+* Manuel Menal
7273 * Marcin Cieślak
7374 * Marooned
7475 * Max Semenik
Index: trunk/phase3/includes/specials/SpecialMovepage.php
@@ -284,6 +284,7 @@
285285 );
286286
287287 $this->showLogFragment( $this->oldTitle, $wgOut );
 288+ $this->showSubpages( $this->oldTitle, $wgOut );
288289
289290 }
290291
@@ -497,4 +498,32 @@
498499 LogEventsList::showLogExtract( $out, 'move', $title->getPrefixedText() );
499500 }
500501
 502+ function showSubpages( $title, $out ) {
 503+ global $wgUser;
 504+
 505+ if( !MWNamespace::hasSubpages( $title->getNamespace() ) )
 506+ return;
 507+
 508+ $out->wrapWikiMsg( '== $1 ==', 'movesubpage' );
 509+ $subpages = $title->getSubpages();
 510+
 511+ # No subpages.
 512+ if ( !( $subpages instanceof TitleArray ) || $subpages->count() == 0 ) {
 513+ $out->addWikiMsg( 'movenosubpage' );
 514+ return;
 515+ }
 516+
 517+ $skin = $wgUser->getSkin();
 518+ $out->addHTML( "<ul>\n" );
 519+
 520+ foreach( $subpages as $subpage ) {
 521+ $link = $skin->link( $subpage );
 522+ if ( $subpage->isRedirect() )
 523+ $link = '<div class="allpagesredirect">' . $link . '</div>' ;
 524+
 525+ $out->addHTML( "<li>$link</li>\n" );
 526+ }
 527+ $out->addHTML( "</ul>\n" );
 528+ }
501529 }
 530+
Index: trunk/phase3/RELEASE-NOTES
@@ -111,6 +111,7 @@
112112 Mediawiki:Shared-repo-name-REPONAME, where REPONAME is the name in
113113 $wgForeignFileRepos
114114 * Special:ListUsers: Sort list of usergroups by alphabet
 115+* (bug 16762) Special:Movepage now shows a list of subpages when possible
115116
116117 === Bug fixes in 1.15 ===
117118 * (bug 16968) Special:Upload no longer throws useless warnings.

Follow-up revisions

RevisionCommit summaryAuthorDate
r47535OOPS, completely forgot to add new messages in r47469ialex10:02, 20 February 2009

Comments

#Comment by Aaron Schulz (talk | contribs)   09:07, 24 February 2009

Whats with the 'allpagesredirect' class/div?

#Comment by Nikerabbit (talk | contribs)   11:40, 24 February 2009

It is used to mark redirect pages in allpages. Now when it is used elsewhere, the name sucks. This is basically a problem with every class and id we have. They are named way too specific compared to where they could be used.

#Comment by Brion VIBBER (talk | contribs)   22:39, 3 March 2009

Call me crazy, but how about class="redirect" and fixing the styles? :)

#Comment by Aaron Schulz (talk | contribs)   22:56, 3 March 2009

Fixed in r47998

#Comment by Werdna (talk | contribs)   02:41, 25 March 2009

You just removed the class altogether.

#Comment by Brion VIBBER (talk | contribs)   08:25, 25 March 2009

Actually those are now including mw-redirect on the actual link, since the redirect flag is available. Handy!

Status & tagging log