r26517 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26516‎ | r26517 | r26518 >
Date:23:52, 8 October 2007
Author:david
Status:old
Tags:
Comment:
Moved the hack in ChangesList into a hook.
Modified paths:
  • /branches/liquidthreads/extensions/LqtBaseView.php (modified) (history)
  • /branches/liquidthreads/includes/ChangesList.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtBaseView.php
@@ -47,6 +47,7 @@
4848 $wgHooks['MediaWikiPerformAction'][] = array('LqtDispatch::tryPage');
4949 $wgHooks['SpecialMovepageAfterMove'][] = array('LqtDispatch::onPageMove');
5050 $wgHooks['LinkerMakeLinkObj'][] = array('LqtDispatch::makeLinkObj');
 51+$wgHooks['ChangesListInsertArticleLink'][] = array('LqtDispatch::changesListArticleLink');
5152
5253 class LqtDispatch {
5354 public static $views = array(
@@ -147,8 +148,6 @@
148149 }
149150
150151 static function makeLinkObj( &$returnValue, &$linker, $nt, $text, $query, $trail, $prefix ) {
151 -// var_dump(array($nt, $text,$query,$trail, $prefix));
152 -
153152 if( ! $nt->isTalkPage() )
154153 return true;
155154
@@ -175,6 +174,17 @@
176175 }
177176 return false;
178177 }
 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+ }
179189 }
180190
181191
Index: branches/liquidthreads/includes/ChangesList.php
@@ -176,13 +176,9 @@
177177 global $wgContLang;
178178 $articlelink .= $wgContLang->getDirMark();
179179
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+
187183 $s .= ' '.$articlelink;
188184 }
189185

Status & tagging log