Index: branches/liquidthreads/extensions/LqtPages.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | /** |
5 | 5 | * @package MediaWiki |
6 | | -* @subpackage Extensions |
| 6 | +* @subpackage LiquidThreads |
7 | 7 | * @author David McCabe <davemccabe@gmail.com> |
8 | 8 | * @licence GPL2 |
9 | 9 | */ |
— | — | @@ -581,44 +581,44 @@ |
582 | 582 | |
583 | 583 | class ThreadHistoricalRevisionView extends ThreadPermalinkView { |
584 | 584 | |
585 | | - /* TOOD: customize tabs so that History is highlighted. */ |
| 585 | + /* TOOD: customize tabs so that History is highlighted. */ |
586 | 586 | |
587 | | - function postDivClass($thread) { |
588 | | - $is_changed_thread = $thread->changeObject() && |
589 | | - $thread->changeObject()->id() == $thread->id(); |
590 | | - if ( $is_changed_thread ) |
591 | | - return 'lqt_post_changed_by_history'; |
592 | | - else |
593 | | - return 'lqt_post'; |
| 587 | + function postDivClass($thread) { |
| 588 | + $is_changed_thread = $thread->changeObject() && |
| 589 | + $thread->changeObject()->id() == $thread->id(); |
| 590 | + if ( $is_changed_thread ) |
| 591 | + return 'lqt_post_changed_by_history'; |
| 592 | + else |
| 593 | + return 'lqt_post'; |
| 594 | + } |
| 595 | + |
| 596 | + |
| 597 | + function showHistoryInfo() { |
| 598 | + global $wgLang; // TODO global. |
| 599 | + $this->openDiv('lqt_history_info'); |
| 600 | + $this->output->addHTML('Revision as of ' . $wgLang->timeanddate($this->thread->timestamp()) . '.<br>' ); |
| 601 | + if( $this->thread->changeType() == Threads::CHANGE_NEW_THREAD ) { |
| 602 | + $this->output->addHTML('This is the thread\'s initial revision.'); |
594 | 603 | } |
595 | | - |
596 | | - |
597 | | - function showHistoryInfo() { |
598 | | - global $wgLang; // TODO global. |
599 | | - $this->openDiv('lqt_history_info'); |
600 | | - $this->output->addHTML('Revision as of ' . $wgLang->timeanddate($this->thread->timestamp()) . '.<br>' ); |
601 | | - if( $this->thread->changeType() == Threads::CHANGE_NEW_THREAD ) { |
602 | | - $this->output->addHTML('This is the thread\'s initial revision.'); |
603 | | - } |
604 | | - else if( $this->thread->changeType() == Threads::CHANGE_REPLY_CREATED ) { |
605 | | - $this->output->addHTML('The highlighted comment was created in this revision.'); |
606 | | - } else if( $this->thread->changeType() == Threads::CHANGE_EDITED_ROOT ) { |
607 | | - $diff_url = $this->permalinkUrlWithDiff($this->thread); |
608 | | - $this->output->addHTML('The highlighted comment was edited in this revision. '); |
609 | | - $this->output->addHTML( "[<a href=\"$diff_url\">show diffs</a>]" ); |
610 | | - } |
611 | | - $this->closeDiv(); |
| 604 | + else if( $this->thread->changeType() == Threads::CHANGE_REPLY_CREATED ) { |
| 605 | + $this->output->addHTML('The highlighted comment was created in this revision.'); |
| 606 | + } else if( $this->thread->changeType() == Threads::CHANGE_EDITED_ROOT ) { |
| 607 | + $diff_url = $this->permalinkUrlWithDiff($this->thread); |
| 608 | + $this->output->addHTML('The highlighted comment was edited in this revision. '); |
| 609 | + $this->output->addHTML( "[<a href=\"$diff_url\">show diffs</a>]" ); |
612 | 610 | } |
613 | | - |
614 | | - function show() { |
615 | | - if( ! $this->thread ) { |
616 | | - $this->showMissingThreadPage(); |
617 | | - return false; |
618 | | - } |
619 | | - $this->showHistoryInfo(); |
620 | | - parent::show(); |
| 611 | + $this->closeDiv(); |
| 612 | + } |
| 613 | + |
| 614 | + function show() { |
| 615 | + if( ! $this->thread ) { |
| 616 | + $this->showMissingThreadPage(); |
621 | 617 | return false; |
622 | | - } |
| 618 | + } |
| 619 | + $this->showHistoryInfo(); |
| 620 | + parent::show(); |
| 621 | + return false; |
| 622 | + } |
623 | 623 | } |
624 | 624 | |
625 | 625 | |
Index: branches/liquidthreads/extensions/LqtModel.php |
— | — | @@ -1,5 +1,17 @@ |
2 | 2 | <?php |
3 | 3 | |
| 4 | +/** |
| 5 | +* @package MediaWiki |
| 6 | +* @subpackage LiquidThreads |
| 7 | +* @author David McCabe <davemccabe@gmail.com> |
| 8 | +* @licence GPL2 |
| 9 | +*/ |
| 10 | + |
| 11 | +if( !defined( 'MEDIAWIKI' ) ) { |
| 12 | + echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); |
| 13 | + die( -1 ); |
| 14 | +} |
| 15 | + |
4 | 16 | require_once('Article.php'); |
5 | 17 | |
6 | 18 | $wgHooks['TitleGetRestrictions'][] = array('Thread::getRestrictionsForTitle'); |
Index: branches/liquidthreads/extensions/LqtBaseView.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | /** |
5 | 5 | * @package MediaWiki |
6 | | -* @subpackage Extensions |
| 6 | +* @subpackage LiquidThreads |
7 | 7 | * @author David McCabe <davemccabe@gmail.com> |
8 | 8 | * @licence GPL2 |
9 | 9 | */ |
— | — | @@ -231,8 +231,8 @@ |
232 | 232 | |
233 | 233 | /************************************************************* |
234 | 234 | * Editing methods (here be dragons) * |
235 | | - * Forget dragons: This section distorts the rest of the code * |
236 | | - * like a star bending spacetime around itself. * |
| 235 | + * Forget dragons: This section distorts the rest of the code * |
| 236 | + * like a star bending spacetime around itself. * |
237 | 237 | *************************************************************/ |
238 | 238 | |
239 | 239 | /** |
— | — | @@ -249,7 +249,6 @@ |
250 | 250 | } |
251 | 251 | |
252 | 252 | function showReplyProtectedNotice($thread) { |
253 | | - // http://localhost:8000/lqt07/index.php?title=Special%3ALog&type=protect&user=&page=Thread%3ADiscussion+noveu+%281%29 |
254 | 253 | $log_url = SpecialPage::getPage('Log')->getTitle()->getFullURL( |
255 | 254 | "type=protect&user=&page={$thread->title()->getPrefixedURL()}"); |
256 | 255 | $this->output->addHTML("<p>This thread has been <a href=\"$log_url\">protected</a> from being replied to."); |
— | — | @@ -553,9 +552,7 @@ |
554 | 553 | $post = $thread->root(); |
555 | 554 | |
556 | 555 | $oldid = $thread->isHistorical() ? $thread->rootRevision() : null; |
557 | | - |
558 | | -/* $color_number = $this->selectNewUserColor( $thread->root()->originalAuthor() ); |
559 | | - $this->openDiv( "lqt_post lqt_post_color_$color_number" );*/ |
| 556 | + |
560 | 557 | $this->openDiv( $this->postDivClass($thread) ); |
561 | 558 | |
562 | 559 | if( $this->methodAppliesToThread( 'edit', $thread ) ) { |