r13431 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13430‎ | r13431 | r13432 >
Date:15:42, 2 April 2006
Author:robchurch
Status:old
Tags:
Comment:
(bug 2871) Links to talk pages in watchlist editing view
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialWatchlist.php
@@ -155,6 +155,15 @@
156156 $sql = "SELECT wl_namespace,wl_title FROM $watchlist WHERE wl_user=$uid";
157157
158158 $res = $dbr->query( $sql, $fname );
 159+
 160+ # Batch existence check
 161+ $linkBatch = new LinkBatch();
 162+ while( $row = $dbr->fetchObject( $res ) )
 163+ $linkBatch->addObj( Title::makeTitleSafe( $row->wl_namespace, $row->wl_title ) );
 164+ $linkBatch->execute();
 165+ if( $dbr->numRows( $res ) > 0 )
 166+ $dbr->dataSeek( $res, 0 ); # Let's do the time warp again!
 167+
159168 $sk = $wgUser->getSkin();
160169
161170 $list = array();
@@ -170,19 +179,19 @@
171180 $wgOut->addHTML( '<h2>' . $wgContLang->getFormattedNsText( $ns ) . '</h2>' );
172181 $wgOut->addHTML( '<ul>' );
173182 foreach($titles as $title) {
174 - $t = Title::makeTitle( $ns, $title );
175 - if( is_null( $t ) ) {
 183+ $titleObj = Title::makeTitle( $ns, $title );
 184+ if( is_null( $titleObj ) ) {
176185 $wgOut->addHTML(
177186 '<!-- bad title "' .
178187 htmlspecialchars( $s->wl_title ) . '" in namespace ' . $s->wl_namespace . " -->\n"
179188 );
180189 } else {
181190 global $wgContLang;
182 - $t = $t->getPrefixedText();
 191+ $titleText = $titleObj->getPrefixedText();
 192+ $talkLink = $sk->makeLinkObj( $titleObj->getTalkPage(), $wgLang->getNsText( NS_TALK ) );
183193 $wgOut->addHTML(
184 - '<li><input type="checkbox" name="id[]" value="' . htmlspecialchars($t) . '" />' . ' ' . ($wgContLang->isRTL() ? '&rlm;' : '&lrm;') .
185 - $sk->makeLink( $t, $t ) .
186 - "</li>\n"
 194+ '<li><input type="checkbox" name="id[]" value="' . htmlspecialchars( $titleObj->getPrefixedText() ) . '" />' . ' ' . ( $wgContLang->isRTL() ? '&rlm;' : '&lrm;' ) .
 195+ $sk->makeLinkObj( $titleObj ) . " ({$talkLink}) </li>\n"
187196 );
188197 }
189198 }
Index: trunk/phase3/RELEASE-NOTES
@@ -392,6 +392,7 @@
393393 * Show links to user page, talk page and contributions page on Special:Newpages
394394 * Special:Export can now export a list of all contributors to an article (off by default)
395395 * (bug 5372) Add number of files to Special:Statistics
 396+* (bug 2871) Links to talk pages in watchlist editing view
396397
397398 Misc.:
398399 * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect

Status & tagging log