Index: branches/liquidthreads/extensions/LqtBaseView.php |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | $wgHooks['MediaWikiPerformAction'][] = array('LqtDispatch::tryPage'); |
49 | 49 | $wgHooks['SpecialMovepageAfterMove'][] = array('LqtDispatch::onPageMove'); |
50 | 50 | $wgHooks['LinkerMakeLinkObj'][] = array('LqtDispatch::makeLinkObj'); |
| 51 | +$wgHooks['ChangesListInsertArticleLink'][] = array('LqtDispatch::changesListArticleLink'); |
51 | 52 | |
52 | 53 | class LqtDispatch { |
53 | 54 | public static $views = array( |
— | — | @@ -147,8 +148,6 @@ |
148 | 149 | } |
149 | 150 | |
150 | 151 | static function makeLinkObj( &$returnValue, &$linker, $nt, $text, $query, $trail, $prefix ) { |
151 | | -// var_dump(array($nt, $text,$query,$trail, $prefix)); |
152 | | - |
153 | 152 | if( ! $nt->isTalkPage() ) |
154 | 153 | return true; |
155 | 154 | |
— | — | @@ -175,6 +174,17 @@ |
176 | 175 | } |
177 | 176 | return false; |
178 | 177 | } |
| 178 | + |
| 179 | + static function changesListArticleLink(&$changeslist, &$articlelink, &$s, &$rc, $unpatrolled, $watched) { |
| 180 | + if( $rc->getTitle()->getNamespace() == NS_LQT_THREAD ) { |
| 181 | + $thread = Threads::withRoot(new Post( $rc->getTitle() )); |
| 182 | + if($thread) { |
| 183 | + $articlelink .= ' from ' . $changeslist->skin->makeKnownLinkObj( |
| 184 | + $thread->article()->getTitle()->getTalkPage() ); |
| 185 | + } |
| 186 | + } |
| 187 | + return true; |
| 188 | + } |
179 | 189 | } |
180 | 190 | |
181 | 191 | |
Index: branches/liquidthreads/includes/ChangesList.php |
— | — | @@ -176,13 +176,9 @@ |
177 | 177 | global $wgContLang; |
178 | 178 | $articlelink .= $wgContLang->getDirMark(); |
179 | 179 | |
180 | | - // LQT HACK. |
181 | | - $thread = Threads::withRoot(new Post( $rc->getTitle() )); |
182 | | - if ($thread) { |
183 | | - $articlelink .= ' from ' . $this->skin->makeKnownLinkObj( |
184 | | - $thread->article()->getTitle()->getTalkPage() ); |
185 | | - } |
186 | | - |
| 180 | + wfRunHooks('ChangesListInsertArticleLink', |
| 181 | + array(&$this, &$articlelink, &$s, &$rc, $unpatrolled, $watched)); |
| 182 | + |
187 | 183 | $s .= ' '.$articlelink; |
188 | 184 | } |
189 | 185 | |