r93887 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93886‎ | r93887 | r93888 >
Date:13:51, 4 August 2011
Author:flohack
Status:deferred
Tags:
Comment:
Updated to be compatible with trunk revision 93885
Modified paths:
  • /trunk/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php (modified) (history)
  • /trunk/extensions/CollabWatchlist/mediawiki_core.patch (deleted) (history)
  • /trunk/extensions/CollabWatchlist/mediawiki_core.patch.90542 (added) (history)
  • /trunk/extensions/CollabWatchlist/mediawiki_core.patch.93885 (added) (history)

Diff [purge]

Index: trunk/extensions/CollabWatchlist/mediawiki_core.patch
@@ -1,144 +0,0 @@
2 -Index: includes/ChangesList.php
3 -===================================================================
4 -+++ includes/ChangesList.php (working copy)
5 -@@ -801,6 +801,45 @@
6 - return $ret;
7 - }
8 -
9 -+ protected function insertDiffAndHistLinks( &$s, &$rc ) {
10 -+ $s .= ' ('. $rc->difflink;
11 -+ $this->insertHistLink($s, $rc, $rc->getTitle());
12 -+ $s .= ')';
13 -+ }
14 -+
15 -+ protected function insertHistLink( &$s, &$rc, $title, $params = array(), $sep = NULL ) {
16 -+ $params['action'] = 'history';
17 -+ $s .= isset($sep) ? $sep : $this->message['pipe-separator'] .
18 -+ $this->skin->link(
19 -+ $title,
20 -+ $this->message['hist'],
21 -+ array(),
22 -+ $params,
23 -+ array( 'known', 'noclasses' )
24 -+ );
25 -+ }
26 -+
27 -+ protected function insertBeforeRCFlags( &$r, &$rcObj ) {
28 -+
29 -+ }
30 -+
31 -+ protected function insertBeforeRCFlagsBlock( &$r, &$block ) {
32 -+
33 -+ }
34 -+
35 -+ protected function insertCurrAndLastLinks( &$s, &$rc ) {
36 -+ $s .= ' (';
37 -+ $s .= $rc->curlink;
38 -+ $s .= $this->message['pipe-separator'];
39 -+ $s .= $rc->lastlink;
40 -+ $s .= ')';
41 -+ }
42 -+
43 -+ protected function insertUserAndTalkLinks( &$s, &$rc ) {
44 -+ $s .= $rc->userlink;
45 -+ $s .= $rc->usertalklink;
46 -+ }
47 -+
48 - /**
49 - * Enhanced RC group
50 - */
51 -@@ -888,7 +927,7 @@
52 - . "<a href='#' title='$closeTitle'>{$this->downArrow()}</a>"
53 - . "</span></span>";
54 - $r .= "<td>$tl</td>";
55 --
56 -+ $this->insertBeforeRCFlagsBlock($r, $block);
57 - # Main line
58 - $r .= '<td class="mw-enhanced-rc">' . $this->recentChangesFlags( array(
59 - 'newpage' => $isnew,
60 -@@ -948,16 +987,9 @@
61 - $r .= $this->message['pipe-separator'] . $this->message['hist'] . ')';
62 - } else {
63 - $params = $queryParams;
64 -- $params['action'] = 'history';
65 -
66 -- $r .= $this->message['pipe-separator'] .
67 -- $this->skin->link(
68 -- $block[0]->getTitle(),
69 -- $this->message['hist'],
70 -- array(),
71 -- $params,
72 -- array( 'known', 'noclasses' )
73 -- ) . ')';
74 -+ $this->insertHistLink($r, $rcObj, $block[0]->getTitle(), $params);
75 -+ $r .= ')';
76 - }
77 - $r .= ' . . ';
78 -
79 -@@ -994,6 +1026,7 @@
80 -
81 - #$r .= '<tr><td valign="top">'.$this->spacerArrow();
82 - $r .= '<tr><td></td><td class="mw-enhanced-rc">';
83 -+ $this->insertBeforeRCFlags( $r, $rcObj );
84 - $r .= $this->recentChangesFlags( array(
85 - 'newpage' => $rcObj->mAttribs['rc_new'],
86 - 'minor' => $rcObj->mAttribs['rc_minor'],
87 -@@ -1032,11 +1065,7 @@
88 - $r .= $link . '</span>';
89 -
90 - if ( !$type == RC_LOG || $type == RC_NEW ) {
91 -- $r .= ' (';
92 -- $r .= $rcObj->curlink;
93 -- $r .= $this->message['pipe-separator'];
94 -- $r .= $rcObj->lastlink;
95 -- $r .= ')';
96 -+ $this->insertCurrAndLastLinks( $r, $rcObj );
97 - }
98 - $r .= ' . . ';
99 -
100 -@@ -1046,8 +1075,7 @@
101 - }
102 -
103 - # User links
104 -- $r .= $rcObj->userlink;
105 -- $r .= $rcObj->usertalklink;
106 -+ $this->insertUserAndTalkLinks( $r, $rcObj );
107 - // log action
108 - $this->insertAction( $r, $rcObj );
109 - // log comment
110 -@@ -1135,6 +1163,7 @@
111 - Html::openElement( 'tr' );
112 -
113 - $r .= '<td class="mw-enhanced-rc">' . $this->spacerArrow();
114 -+ $this->insertBeforeRCFlags( $r, $rcObj );
115 - # Flag and Timestamp
116 - if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
117 - $r .= '&#160;&#160;&#160;&#160;'; // 4 flags -> 4 spaces
118 -@@ -1163,15 +1192,7 @@
119 - }
120 - # Diff and hist links
121 - if ( $type != RC_LOG ) {
122 -- $r .= ' ('. $rcObj->difflink . $this->message['pipe-separator'];
123 -- $query['action'] = 'history';
124 -- $r .= $this->skin->link(
125 -- $rcObj->getTitle(),
126 -- $this->message['hist'],
127 -- array(),
128 -- $query,
129 -- array( 'known', 'noclasses' )
130 -- ) . ')';
131 -+ $this->insertDiffAndHistLinks( $r, $rcObj);
132 - }
133 - $r .= ' . . ';
134 - # Character diff
135 -@@ -1179,7 +1200,8 @@
136 - $r .= "$cd . . ";
137 - }
138 - # User/talk
139 -- $r .= ' '.$rcObj->userlink . $rcObj->usertalklink;
140 -+ $r .= ' ';
141 -+ $this->insertUserAndTalkLinks($r, $rcObj);
142 - # Log action (if any)
143 - if( $logType ) {
144 - if( $this->isDeleted($rcObj,LogPage::DELETED_ACTION) ) {
Index: trunk/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php
@@ -318,20 +318,20 @@
319319 ) . '<br />';
320320 }
321321
322 - $cutofflinks = "\n" . self::cutoffLinks( $days, 'CollabWatchlist', $nondefaults ) . "<br />\n";
 322+ $cutofflinks = "\n" . $this->cutoffLinks( $days, 'CollabWatchlist', $nondefaults ) . "<br />\n";
323323
324324 $thisTitle = SpecialPage::getTitleFor( 'CollabWatchlist' );
325325
326326 # Spit out some control panel links
327 - $links[] = self::showHideLink( $nondefaults, 'rcshowhideminor', 'hideMinor', $hideMinor );
328 - $links[] = self::showHideLink( $nondefaults, 'rcshowhidebots', 'hideBots', $hideBots );
329 - $links[] = self::showHideLink( $nondefaults, 'rcshowhideanons', 'hideAnons', $hideAnons );
330 - $links[] = self::showHideLink( $nondefaults, 'rcshowhideliu', 'hideLiu', $hideLiu );
331 - $links[] = self::showHideLink( $nondefaults, 'rcshowhidemine', 'hideOwn', $hideOwn );
332 - $links[] = self::showHideLink( $nondefaults, 'collabwatchlistshowhidelistusers', 'hideListUser', $hideListUser );
 327+ $links[] = $this->showHideLink( $nondefaults, 'rcshowhideminor', 'hideMinor', $hideMinor );
 328+ $links[] = $this->showHideLink( $nondefaults, 'rcshowhidebots', 'hideBots', $hideBots );
 329+ $links[] = $this->showHideLink( $nondefaults, 'rcshowhideanons', 'hideAnons', $hideAnons );
 330+ $links[] = $this->showHideLink( $nondefaults, 'rcshowhideliu', 'hideLiu', $hideLiu );
 331+ $links[] = $this->showHideLink( $nondefaults, 'rcshowhidemine', 'hideOwn', $hideOwn );
 332+ $links[] = $this->showHideLink( $nondefaults, 'collabwatchlistshowhidelistusers', 'hideListUser', $hideListUser );
333333
334334 if ( $wgUser->useRCPatrol() ) {
335 - $links[] = self::showHideLink( $nondefaults, 'rcshowhidepatr', 'hidePatrolled', $hidePatrolled );
 335+ $links[] = $this->showHideLink( $nondefaults, 'rcshowhidepatr', 'hidePatrolled', $hidePatrolled );
336336 }
337337
338338 # Namespace filter and put the whole form together.
@@ -452,7 +452,7 @@
453453 *
454454 * @return string
455455 */
456 - protected static function cutoffLinks( $days, $page = 'Watchlist', $options = array() ) {
 456+ protected function cutoffLinks( $days, $page = 'Watchlist', $options = array() ) {
457457 return SpecialWatchlist::cutoffLinks( $days, $page, $options );
458458 }
459459
@@ -574,7 +574,7 @@
575575 }
576576
577577 //XXX SpecialWatchlist should let us pass the page title
578 - public static function showHideLink( $options, $message, $name, $value ) {
 578+ public function showHideLink( $options, $message, $name, $value ) {
579579 global $wgUser;
580580
581581 $showLinktext = wfMsgHtml( 'show' );
Index: trunk/extensions/CollabWatchlist/mediawiki_core.patch.93885
@@ -0,0 +1,125 @@
 2+Index: includes/ChangesList.php
 3+===================================================================
 4+--- includes/ChangesList.php (revision 93885)
 5+@@ -797,6 +797,44 @@
 6+ return $ret;
 7+ }
 8+
 9++ protected function insertDiffAndHistLinks( &$s, &$rc ) {
 10++ $s .= ' ('. $rc->difflink;
 11++ $this->insertHistLink($s, $rc, $rc->getTitle());
 12++ $s .= ')';
 13++ }
 14++
 15++ protected function insertHistLink( &$s, &$rc, $title, $params = array(), $sep = NULL ) {
 16++ $params['action'] = 'history';
 17++ $s .= isset($sep) ? $sep : $this->message['pipe-separator'] .
 18++ Linker::linkKnown(
 19++ $title,
 20++ $this->message['hist'],
 21++ array(),
 22++ $params
 23++ );
 24++ }
 25++
 26++ protected function insertBeforeRCFlags( &$r, &$rcObj ) {
 27++
 28++ }
 29++
 30++ protected function insertBeforeRCFlagsBlock( &$r, &$block ) {
 31++
 32++ }
 33++
 34++ protected function insertCurrAndLastLinks( &$s, &$rc ) {
 35++ $s .= ' (';
 36++ $s .= $rc->curlink;
 37++ $s .= $this->message['pipe-separator'];
 38++ $s .= $rc->lastlink;
 39++ $s .= ')';
 40++ }
 41++
 42++ protected function insertUserAndTalkLinks( &$s, &$rc ) {
 43++ $s .= $rc->userlink;
 44++ $s .= $rc->usertalklink;
 45++ }
 46++
 47+ /**
 48+ * Enhanced RC group
 49+ */
 50+@@ -884,7 +922,7 @@
 51+ . "<a href='#' title='$closeTitle'>{$this->downArrow()}</a>"
 52+ . "</span></span>";
 53+ $r .= "<td>$tl</td>";
 54+-
 55++ $this->insertBeforeRCFlagsBlock($r, $block);
 56+ # Main line
 57+ $r .= '<td class="mw-enhanced-rc">' . $this->recentChangesFlags( array(
 58+ 'newpage' => $isnew,
 59+@@ -944,15 +982,8 @@
 60+ $r .= $this->message['pipe-separator'] . $this->message['hist'] . ')';
 61+ } else {
 62+ $params = $queryParams;
 63+- $params['action'] = 'history';
 64+-
 65+- $r .= $this->message['pipe-separator'] .
 66+- Linker::linkKnown(
 67+- $block[0]->getTitle(),
 68+- $this->message['hist'],
 69+- array(),
 70+- $params
 71+- ) . ')';
 72++ $this->insertHistLink($r, $rcObj, $block[0]->getTitle(), $params);
 73++ $r .= ')';
 74+ }
 75+ $r .= ' . . ';
 76+
 77+@@ -989,6 +1020,7 @@
 78+
 79+ #$r .= '<tr><td valign="top">'.$this->spacerArrow();
 80+ $r .= '<tr><td></td><td class="mw-enhanced-rc">';
 81++ $this->insertBeforeRCFlags( $r, $rcObj );
 82+ $r .= $this->recentChangesFlags( array(
 83+ 'newpage' => $rcObj->mAttribs['rc_new'],
 84+ 'minor' => $rcObj->mAttribs['rc_minor'],
 85+@@ -1026,11 +1058,7 @@
 86+ $r .= $link . '</span>';
 87+
 88+ if ( !$type == RC_LOG || $type == RC_NEW ) {
 89+- $r .= ' (';
 90+- $r .= $rcObj->curlink;
 91+- $r .= $this->message['pipe-separator'];
 92+- $r .= $rcObj->lastlink;
 93+- $r .= ')';
 94++ $this->insertCurrAndLastLinks( $r, $rcObj );
 95+ }
 96+ $r .= ' . . ';
 97+
 98+@@ -1040,8 +1068,7 @@
 99+ }
 100+
 101+ # User links
 102+- $r .= $rcObj->userlink;
 103+- $r .= $rcObj->usertalklink;
 104++ $this->insertUserAndTalkLinks( $r, $rcObj );
 105+ // log action
 106+ $this->insertAction( $r, $rcObj );
 107+ // log comment
 108+@@ -1129,6 +1156,7 @@
 109+ Html::openElement( 'tr' );
 110+
 111+ $r .= '<td class="mw-enhanced-rc">' . $this->spacerArrow();
 112++ $this->insertBeforeRCFlags( $r, $rcObj );
 113+ # Flag and Timestamp
 114+ if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
 115+ $r .= '&#160;&#160;&#160;&#160;'; // 4 flags -> 4 spaces
 116+@@ -1166,7 +1194,8 @@
 117+ $r .= "$cd . . ";
 118+ }
 119+ # User/talk
 120+- $r .= ' '.$rcObj->userlink . $rcObj->usertalklink;
 121++ $r .= ' ';
 122++ $this->insertUserAndTalkLinks($r, $rcObj);
 123+ # Log action (if any)
 124+ if( $logType ) {
 125+ if( $this->isDeleted($rcObj,LogPage::DELETED_ACTION) ) {
Index: trunk/extensions/CollabWatchlist/mediawiki_core.patch.90542
@@ -0,0 +1,144 @@
 2+Index: includes/ChangesList.php
 3+===================================================================
 4+--- includes/ChangesList.php (revision 90542)
 5+@@ -801,6 +801,45 @@
 6+ return $ret;
 7+ }
 8+
 9++ protected function insertDiffAndHistLinks( &$s, &$rc ) {
 10++ $s .= ' ('. $rc->difflink;
 11++ $this->insertHistLink($s, $rc, $rc->getTitle());
 12++ $s .= ')';
 13++ }
 14++
 15++ protected function insertHistLink( &$s, &$rc, $title, $params = array(), $sep = NULL ) {
 16++ $params['action'] = 'history';
 17++ $s .= isset($sep) ? $sep : $this->message['pipe-separator'] .
 18++ $this->skin->link(
 19++ $title,
 20++ $this->message['hist'],
 21++ array(),
 22++ $params,
 23++ array( 'known', 'noclasses' )
 24++ );
 25++ }
 26++
 27++ protected function insertBeforeRCFlags( &$r, &$rcObj ) {
 28++
 29++ }
 30++
 31++ protected function insertBeforeRCFlagsBlock( &$r, &$block ) {
 32++
 33++ }
 34++
 35++ protected function insertCurrAndLastLinks( &$s, &$rc ) {
 36++ $s .= ' (';
 37++ $s .= $rc->curlink;
 38++ $s .= $this->message['pipe-separator'];
 39++ $s .= $rc->lastlink;
 40++ $s .= ')';
 41++ }
 42++
 43++ protected function insertUserAndTalkLinks( &$s, &$rc ) {
 44++ $s .= $rc->userlink;
 45++ $s .= $rc->usertalklink;
 46++ }
 47++
 48+ /**
 49+ * Enhanced RC group
 50+ */
 51+@@ -888,7 +927,7 @@
 52+ . "<a href='#' title='$closeTitle'>{$this->downArrow()}</a>"
 53+ . "</span></span>";
 54+ $r .= "<td>$tl</td>";
 55+-
 56++ $this->insertBeforeRCFlagsBlock($r, $block);
 57+ # Main line
 58+ $r .= '<td class="mw-enhanced-rc">' . $this->recentChangesFlags( array(
 59+ 'newpage' => $isnew,
 60+@@ -948,16 +987,9 @@
 61+ $r .= $this->message['pipe-separator'] . $this->message['hist'] . ')';
 62+ } else {
 63+ $params = $queryParams;
 64+- $params['action'] = 'history';
 65+
 66+- $r .= $this->message['pipe-separator'] .
 67+- $this->skin->link(
 68+- $block[0]->getTitle(),
 69+- $this->message['hist'],
 70+- array(),
 71+- $params,
 72+- array( 'known', 'noclasses' )
 73+- ) . ')';
 74++ $this->insertHistLink($r, $rcObj, $block[0]->getTitle(), $params);
 75++ $r .= ')';
 76+ }
 77+ $r .= ' . . ';
 78+
 79+@@ -994,6 +1026,7 @@
 80+
 81+ #$r .= '<tr><td valign="top">'.$this->spacerArrow();
 82+ $r .= '<tr><td></td><td class="mw-enhanced-rc">';
 83++ $this->insertBeforeRCFlags( $r, $rcObj );
 84+ $r .= $this->recentChangesFlags( array(
 85+ 'newpage' => $rcObj->mAttribs['rc_new'],
 86+ 'minor' => $rcObj->mAttribs['rc_minor'],
 87+@@ -1032,11 +1065,7 @@
 88+ $r .= $link . '</span>';
 89+
 90+ if ( !$type == RC_LOG || $type == RC_NEW ) {
 91+- $r .= ' (';
 92+- $r .= $rcObj->curlink;
 93+- $r .= $this->message['pipe-separator'];
 94+- $r .= $rcObj->lastlink;
 95+- $r .= ')';
 96++ $this->insertCurrAndLastLinks( $r, $rcObj );
 97+ }
 98+ $r .= ' . . ';
 99+
 100+@@ -1046,8 +1075,7 @@
 101+ }
 102+
 103+ # User links
 104+- $r .= $rcObj->userlink;
 105+- $r .= $rcObj->usertalklink;
 106++ $this->insertUserAndTalkLinks( $r, $rcObj );
 107+ // log action
 108+ $this->insertAction( $r, $rcObj );
 109+ // log comment
 110+@@ -1135,6 +1163,7 @@
 111+ Html::openElement( 'tr' );
 112+
 113+ $r .= '<td class="mw-enhanced-rc">' . $this->spacerArrow();
 114++ $this->insertBeforeRCFlags( $r, $rcObj );
 115+ # Flag and Timestamp
 116+ if( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
 117+ $r .= '&#160;&#160;&#160;&#160;'; // 4 flags -> 4 spaces
 118+@@ -1163,15 +1192,7 @@
 119+ }
 120+ # Diff and hist links
 121+ if ( $type != RC_LOG ) {
 122+- $r .= ' ('. $rcObj->difflink . $this->message['pipe-separator'];
 123+- $query['action'] = 'history';
 124+- $r .= $this->skin->link(
 125+- $rcObj->getTitle(),
 126+- $this->message['hist'],
 127+- array(),
 128+- $query,
 129+- array( 'known', 'noclasses' )
 130+- ) . ')';
 131++ $this->insertDiffAndHistLinks( $r, $rcObj);
 132+ }
 133+ $r .= ' . . ';
 134+ # Character diff
 135+@@ -1179,7 +1200,8 @@
 136+ $r .= "$cd . . ";
 137+ }
 138+ # User/talk
 139+- $r .= ' '.$rcObj->userlink . $rcObj->usertalklink;
 140++ $r .= ' ';
 141++ $this->insertUserAndTalkLinks($r, $rcObj);
 142+ # Log action (if any)
 143+ if( $logType ) {
 144+ if( $this->isDeleted($rcObj,LogPage::DELETED_ACTION) ) {
Property changes on: trunk/extensions/CollabWatchlist/mediawiki_core.patch.90542
___________________________________________________________________
Added: svn:eol-style
1145 + native

Status & tagging log