r24503 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24502‎ | r24503 | r24504 >
Date:00:10, 1 August 2007
Author:david
Status:old
Tags:
Comment:
TYPE_MOVED threads shown decently
Modified paths:
  • /branches/liquidthreads/extensions/LqtExtension.php (modified) (history)
  • /branches/liquidthreads/extensions/LqtModel.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtExtension.php
@@ -513,8 +513,25 @@
514514 }
515515
516516 function showThread( $thread ) {
 517+ global $wgLang; # TODO global.
 518+
517519 $this->showThreadHeading( $thread );
518520
 521+ if ($thread->type() == Threads::TYPE_MOVED) {
 522+ $revision = Revision::newFromTitle( $thread->title() );
 523+ $target = Title::newFromRedirect( $revision->getText() );
 524+ $t_thread = Threads::withRoot( new Article( $target ) );
 525+ $p = new Parser(); $sig = $p->getUserSig( $thread->root()->originalAuthor() );
 526+
 527+ $this->output->addHTML( "This thread is a placeholder indicating that a thread, <a href=\"{$target->getFullURL()}\">{$target->getText()}</a>, was removed from this page to another talk page. This move was made by " );
 528+ $this->output->addWikitext( $sig, false );
 529+ $this->output->addHTML( " at " );
 530+ $this->output->addHTML( $wgLang->timeanddate($thread->timestamp()) );
 531+ $this->output->addHTML( "." );
 532+
 533+ return;
 534+ }
 535+
519536 $timestamp = new Date($thread->timestamp());
520537 if( $thread->summary() ) {
521538 $this->showSummary($thread);
Index: branches/liquidthreads/extensions/LqtModel.php
@@ -170,6 +170,7 @@
171171
172172 protected $id;
173173 protected $revisionNumber;
 174+ protected $type;
174175
175176 /* Only used by $double to be saved into a historical thread. */
176177 protected $rootRevision;
@@ -327,7 +328,9 @@
328329 $this->path = $line->thread_path;
329330 $this->timestamp = $line->thread_timestamp;
330331 $this->revisionNumber = $line->thread_revision;
 332+ $this->type = $line->thread_type;
331333 $this->replies = $children;
 334+
332335
333336 $this->double = clone $this;
334337
@@ -500,6 +503,10 @@
501504 function timestamp() {
502505 return $this->timestamp;
503506 }
 507+
 508+ function type() {
 509+ return $this->type;
 510+ }
504511 }
505512
506513 /** Module of factory methods. */

Status & tagging log