r25385 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25384‎ | r25385 | r25386 >
Date:06:48, 1 September 2007
Author:david
Status:old
Tags:
Comment:
misc. cleanup of tabs and comments
Modified paths:
  • /branches/liquidthreads/extensions/LqtBaseView.php (modified) (history)
  • /branches/liquidthreads/extensions/LqtModel.php (modified) (history)
  • /branches/liquidthreads/extensions/LqtPages.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtPages.php
@@ -2,7 +2,7 @@
33
44 /**
55 * @package MediaWiki
6 -* @subpackage Extensions
 6+* @subpackage LiquidThreads
77 * @author David McCabe <davemccabe@gmail.com>
88 * @licence GPL2
99 */
@@ -581,44 +581,44 @@
582582
583583 class ThreadHistoricalRevisionView extends ThreadPermalinkView {
584584
585 - /* TOOD: customize tabs so that History is highlighted. */
 585+ /* TOOD: customize tabs so that History is highlighted. */
586586
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.');
594603 }
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>]" );
612610 }
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();
621617 return false;
622 - }
 618+ }
 619+ $this->showHistoryInfo();
 620+ parent::show();
 621+ return false;
 622+ }
623623 }
624624
625625
Index: branches/liquidthreads/extensions/LqtModel.php
@@ -1,5 +1,17 @@
22 <?php
33
 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+
416 require_once('Article.php');
517
618 $wgHooks['TitleGetRestrictions'][] = array('Thread::getRestrictionsForTitle');
Index: branches/liquidthreads/extensions/LqtBaseView.php
@@ -2,7 +2,7 @@
33
44 /**
55 * @package MediaWiki
6 -* @subpackage Extensions
 6+* @subpackage LiquidThreads
77 * @author David McCabe <davemccabe@gmail.com>
88 * @licence GPL2
99 */
@@ -231,8 +231,8 @@
232232
233233 /*************************************************************
234234 * 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. *
237237 *************************************************************/
238238
239239 /**
@@ -249,7 +249,6 @@
250250 }
251251
252252 function showReplyProtectedNotice($thread) {
253 - // http://localhost:8000/lqt07/index.php?title=Special%3ALog&type=protect&user=&page=Thread%3ADiscussion+noveu+%281%29
254253 $log_url = SpecialPage::getPage('Log')->getTitle()->getFullURL(
255254 "type=protect&user=&page={$thread->title()->getPrefixedURL()}");
256255 $this->output->addHTML("<p>This thread has been <a href=\"$log_url\">protected</a> from being replied to.");
@@ -553,9 +552,7 @@
554553 $post = $thread->root();
555554
556555 $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+
560557 $this->openDiv( $this->postDivClass($thread) );
561558
562559 if( $this->methodAppliesToThread( 'edit', $thread ) ) {

Status & tagging log