r23897 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23896‎ | r23897 | r23898 >
Date:12:04, 9 July 2007
Author:robchurch
Status:old
Tags:
Comment:
Add some navigation between watchlist modes
Modified paths:
  • /trunk/phase3/includes/SpecialWatchlist.php (modified) (history)
  • /trunk/phase3/includes/WatchlistEditor.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -2145,7 +2145,13 @@
21462146 'watchlistedit-raw-done',
21472147 'watchlistedit-raw-added',
21482148 'watchlistedit-raw-removed',
2149 - ),
 2149+ ),
 2150+ 'watchlisttools' => array(
 2151+ 'watchlisttools-view',
 2152+ 'watchlisttools-edit',
 2153+ 'watchlisttools-raw',
 2154+ 'watchlisttools-clear',
 2155+ ),
21502156 );
21512157 /** Comments for each block */
21522158 $wgBlockComments = array(
@@ -2313,6 +2319,7 @@
23142320 'livepreview' => 'Live preview',
23152321 'lagwarning' => 'Friendlier slave lag warnings',
23162322 'watchlisteditor' => 'Watchlist editor',
 2323+ 'watchlisttools' => 'Watchlist editing tools',
23172324 );
23182325
23192326 /** Short comments for standalone messages */
Index: trunk/phase3/includes/WatchlistEditor.php
@@ -467,5 +467,23 @@
468468 return false;
469469 }
470470 }
 471+
 472+ /**
 473+ * Build a set of links for convenient navigation
 474+ * between watchlist viewing and editing modes
 475+ *
 476+ * @param Skin $skin Skin to use
 477+ * @return string
 478+ */
 479+ public static function buildTools( $skin ) {
 480+ $tools = array();
 481+ $self = SpecialPage::getTitleFor( 'Watchlist' );
 482+ $modes = array( 'view' => '', 'edit' => 'edit', 'raw' => 'raw', 'clear' => 'clear' );
 483+ foreach( $modes as $mode => $action ) {
 484+ $action = $action ? "action={$action}" : '';
 485+ $tools[] = $skin->makeKnownLinkObj( $self, wfMsgHtml( "watchlisttools-{$mode}" ), $action );
 486+ }
 487+ return implode( ' | ', $tools );
 488+ }
471489
472490 }
Index: trunk/phase3/includes/SpecialWatchlist.php
@@ -30,17 +30,20 @@
3131 $llink = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ), wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() );
3232 $wgOut->addHtml( wfMsgWikiHtml( 'watchlistanontext', $llink ) );
3333 return;
34 - } else {
35 - $wgOut->setPageTitle( wfMsg( 'watchlist' ) );
36 - $wgOut->setSubtitle( wfMsgWikiHtml( 'watchlistfor', htmlspecialchars( $wgUser->getName() ) ) );
3734 }
 35+
 36+ $wgOut->setPageTitle( wfMsg( 'watchlist' ) );
 37+
 38+ $sub = wfMsgExt( 'watchlistfor', 'parseinline', $wgUser->getName() );
 39+ $sub .= '<br />' . WatchlistEditor::buildTools( $wgUser->getSkin() );
 40+ $wgOut->setSubtitle( $sub );
3841
3942 if( ( $mode = WatchlistEditor::getMode( $wgRequest, $par ) ) !== false ) {
4043 $editor = new WatchlistEditor();
4144 $editor->execute( $wgUser, $wgOut, $wgRequest, $mode );
4245 return;
4346 }
44 -
 47+
4548 $uid = $wgUser->getId();
4649 if( $wgEnotifWatchlist && $wgRequest->getVal( 'reset' ) && $wgRequest->wasPosted() ) {
4750 $wgUser->clearAllNotifications( $uid );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2914,4 +2914,10 @@
29152915 'watchlistedit-raw-added' => '{{PLURAL:$1|1 title was|$1 titles were}} added:',
29162916 'watchlistedit-raw-removed' => '{{PLURAL:$1|1 title was|$1 titles were}} removed:',
29172917
 2918+# Watchlist editing tools
 2919+'watchlisttools-view' => 'View watchlist',
 2920+'watchlisttools-edit' => 'Edit watchlist',
 2921+'watchlisttools-raw' => 'Edit raw watchlist',
 2922+'watchlisttools-clear' => 'Clear watchlist',
 2923+
29182924 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r23912Merged revisions 23662-23909 via svnmerge from...david18:11, 9 July 2007

Status & tagging log