r47532 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47531‎ | r47532 | r47533 >
Date:08:43, 20 February 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* move some formatting from code paramters into messages
* merge some messages that used unnecessary substitution
* separate date/time in 'lqt_revision_as_of', and kept it backward compat
* some minor code formatting changes
* removed some commented out code
* bump version
* add some FIXMEs
Modified paths:
  • /trunk/extensions/LiquidThreads/LiquidThreads.php (modified) (history)
  • /trunk/extensions/LiquidThreads/Lqt.i18n.php (modified) (history)
  • /trunk/extensions/LiquidThreads/LqtBaseView.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/LqtThread.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/SpecialDeleteThread.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/SpecialMoveThread.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/TalkpageView.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/ThreadHistoricalRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/LiquidThreads.php
@@ -5,7 +5,7 @@
66
77 $wgExtensionCredits['other'][] = array(
88 'name' => 'Liquid Threads',
9 - 'version' => '1.1',
 9+ 'version' => '1.2',
1010 'url' => 'http://www.mediawiki.org/wiki/Extension:LiquidThreads',
1111 'author' => 'David McCabe',
1212 'description' => 'Add threading discussions to talk pages',
@@ -22,11 +22,13 @@
2323 define( 'LQT_NEWEST_THREADS', 2 );
2424 define( 'LQT_OLDEST_THREADS', 3 );
2525
 26+// FIXME: would be neat if it was possible to somehow localise this.
2627 $wgCanonicalNamespaceNames[NS_LQT_THREAD] = 'Thread';
2728 $wgCanonicalNamespaceNames[NS_LQT_THREAD_TALK] = 'Thread_talk';
2829 $wgCanonicalNamespaceNames[NS_LQT_SUMMARY] = 'Summary';
2930 $wgCanonicalNamespaceNames[NS_LQT_SUMMARY_TALK] = 'Summary_talk';
3031
 32+// FIXME: would be neat if it was possible to somehow localise this.
3133 $wgExtraNamespaces[NS_LQT_THREAD] = 'Thread';
3234 $wgExtraNamespaces[NS_LQT_THREAD_TALK] = 'Thread_talk';
3335 $wgExtraNamespaces[NS_LQT_SUMMARY] = 'Summary';
Index: trunk/extensions/LiquidThreads/classes/LqtThread.php
@@ -76,16 +76,7 @@
7777 }
7878 return $results;
7979 }
80 -/*
81 - function ancestors() {
82 - $id_clauses = array();
83 - foreach( explode('.', $this->path) as $id ) {
84 - $id_clauses[] = "thread_id = $id";
85 - }
86 - $where = implode(' OR ', $id_clauses);
87 - return Threads::where($where);
88 - }
89 -*/
 80+
9081 private function bumpRevisionsOnAncestors( $change_type, $change_object, $change_reason, $timestamp ) {
9182 global $wgUser; // TODO global.
9283
@@ -247,7 +238,7 @@
248239
249240 # Purge old title from squid
250241 # The new title, and links to the new title, are purged in Article::onArticleCreate()
251 -# $this-->purgeSquid();
 242+ # $this-->purgeSquid();
252243 }
253244
254245
Index: trunk/extensions/LiquidThreads/pages/SpecialDeleteThread.php
@@ -30,13 +30,12 @@
3131 $deleting = $this->thread->type() != Threads::TYPE_DELETED;
3232
3333 $operation_message = $deleting ?
34 - wfMsg( 'lqt_delete_deleting', "<b>$thread_name</b>", '<b>' . wfMsg( 'lqt_delete_deleting_allreplies' ) . '</b>' )
35 - // "Deleting <b>$thread_name</b> and <b>all replies</b> to it."
36 - : wfMsg( 'lqt_delete_undeleting', "<b>$thread_name</b>" );
 34+ wfMsg( 'lqt_delete_deleting', $thread_name )
 35+ : wfMsg( 'lqt_delete_undeleting', $thread_name );
3736 $button_label = $deleting ?
38 - wfMsg( 'lqt_delete_deletethread' )
39 - : wfMsg( 'lqt_delete_undeletethread' );
40 - $part_of = wfMsg( 'lqt_delete_partof', '<b>' . $article_name . '</b>' );
 37+ wfMsg( 'lqt_delete_deletethread' )
 38+ : wfMsg( 'lqt_delete_undeletethread' );
 39+ $part_of = wfMsg( 'lqt_delete_partof', $article_name );
4140 $reason = wfMsg( 'movereason' ); // XXX arguably wrong to use movereason.
4241
4342 $this->output->addHTML( <<<HTML
@@ -95,7 +94,7 @@
9695 // TODO talkpageUrl should accept threads, and look up their talk pages.
9796 $talkpage_url = LqtView::talkpageUrl( $this->thread->article()->getTitle()->getTalkpage() );
9897 $message = $is_deleted_already ? wfMsg( 'lqt_delete_undeleted' ) : wfMsg( 'lqt_delete_deleted' );
99 - $message .= ' ';
 98+ $message .= wfMsg( 'word-separator' );
10099 $message .= wfMsg( 'lqt_delete_return', '<a href="' . $talkpage_url . '">' . wfMsg( 'lqt_delete_return_link' ) . '</a>' );
101100 $this->output->addHTML( $message );
102101 }
Index: trunk/extensions/LiquidThreads/pages/SpecialMoveThread.php
@@ -25,6 +25,8 @@
2626 $article_name = $this->thread->article()->getTitle()->getTalkPage()->getPrefixedText();
2727 $edit_url = LqtView::permalinkUrl( $this->thread, 'edit', $this->thread );
2828 $wfMsg = 'wfMsg'; // functions can only be called within string expansion by variable name.
 29+ // FIXME: awkward message usage and fixed parameter formatting. Would be nicer if all formatting
 30+ // was done in the message itself, and the below code would be deweirded.
2931 $this->output->addHTML( <<<HTML
3032 <p>{$wfMsg('lqt_move_movingthread', "<b>$thread_name</b>", "<b>$article_name</b>")}</p>
3133 <p>{$wfMsg('lqt_move_torename', "<a href=\"$edit_url\">{$wfMsg('lqt_move_torename_edit')}</a>")}</p>
Index: trunk/extensions/LiquidThreads/pages/TalkpageView.php
@@ -102,7 +102,6 @@
103103 if ( count( $threadlinks ) > 0 ) {
104104 $this->openDiv( 'lqt_archive_teaser' );
105105 $this->output->addHTML( '<h2 class="lqt_recently_archived">' . wfMsg( 'lqt_recently_archived' ) . '</h2>' );
106 - // $this->output->addHTML("<span class=\"lqt_browse_archive\">[<a href=\"$url\">".wfMsg('lqt_browse_archive_with_recent')."</a>]</span></h2>");
107106 $this->outputList( 'ul', '', '', $threadlinks );
108107 $this->closeDiv();
109108 } else {
Index: trunk/extensions/LiquidThreads/pages/ThreadHistoricalRevisionView.php
@@ -19,12 +19,17 @@
2020 global $wgLang; // TODO global.
2121 wfLoadExtensionMessages( 'LiquidThreads' );
2222 $this->openDiv( 'lqt_history_info' );
23 - $this->output->addHTML( wfMsg( 'lqt_revision_as_of', $wgLang->timeanddate( $this->thread->modified() ) ) . '<br />' );
 23+ $this->output->addHTML( wfMsg( 'lqt_revision_as_of',
 24+ $wgLang->timeanddate( $this->thread->modified() ),
 25+ $wgLang->date( $this->thread->modified() ),
 26+ $wgLang->time( $this->thread->modified() ) ) . '<br />' );
2427
2528 $ct = $this->thread->changeType();
26 - if ( $ct == Threads::CHANGE_NEW_THREAD ) $msg = wfMsg( 'lqt_change_new_thread' );
27 - else if ( $ct == Threads::CHANGE_REPLY_CREATED ) $msg = wfMsg( 'lqt_change_reply_created' );
28 - else if ( $ct == Threads::CHANGE_EDITED_ROOT ) {
 29+ if ( $ct == Threads::CHANGE_NEW_THREAD ) {
 30+ $msg = wfMsg( 'lqt_change_new_thread' );
 31+ } else if ( $ct == Threads::CHANGE_REPLY_CREATED ) {
 32+ $msg = wfMsg( 'lqt_change_reply_created' );
 33+ } else if ( $ct == Threads::CHANGE_EDITED_ROOT ) {
2934 $diff_url = $this->permalinkUrlWithDiff( $this->thread );
3035 $msg = wfMsg( 'lqt_change_edited_root' ) . " [<a href=\"$diff_url\">" . wfMsg( 'diff' ) . '</a>]';
3136 }
Index: trunk/extensions/LiquidThreads/Lqt.i18n.php
@@ -50,7 +50,7 @@
5151 'lqt_hist_past_last_page_error' => 'You are beyond the number of pages of history that exist.',
5252 'lqt_hist_tooltip_newer_disabled' => 'This link is disabled because you are on the first page.',
5353 'lqt_hist_tooltip_older_disabled' => 'This link is disabled because you are on the last page.',
54 - 'lqt_revision_as_of' => "Revision as of $1.",
 54+ 'lqt_revision_as_of' => "Revision as of $2 at $3.",
5555 'lqt_change_new_thread' => 'This is the thread\'s initial revision.',
5656 'lqt_change_reply_created' => 'The highlighted comment was created in this revision.',
5757 'lqt_change_edited_root' => 'The highlighted comment was edited in this revision.',
@@ -62,8 +62,7 @@
6363 'lqt_noreason' => 'No reason given.',
6464 'lqt_move_placeholder' => 'This thread is a placeholder indicating that a thread, $1, was removed from this page to another talk page.
6565 This move was made by $2 on $3 at $4.',
66 - 'lqt_thread_deleted_for_sysops' => 'This thread has been $1 and is only visible to administrators.',
67 - 'lqt_thread_deleted_for_sysops_deleted' => 'deleted', // substituted above in bold
 66+ 'lqt_thread_deleted_for_sysops' => 'This thread has been \'\'\'deleted\'\'\' and is only visible to administrators.',
6867 'lqt_thread_deleted' => 'This thread has been deleted.',
6968 'lqt_summary_notice' => 'There have been no changes to this discussion for at least $2 days.
7069 If it is concluded, you may want to $1.',
@@ -77,24 +76,23 @@
7877 This thread is part of $2.',
7978 'lqt_move_torename' => 'To rename this thread, $1 and change the \'Subject\' field.',
8079 'lqt_move_torename_edit' => 'edit it', // substituted above as a link
81 - 'lqt_move_destinationtitle' => 'Title of destination talkpage:',
 80+ 'lqt_move_destinationtitle' => 'Title of destination talk page:',
8281 'lqt_move_move' => 'Move',
8382 'lqt_move_nodestination' => 'You must specify a destination.',
8483 'lqt_move_noreason' => 'No reason given.',
8584 'lqt_move_success' => 'The thread was moved to $1.',
86 - 'lqt_delete_undeleting' => 'Undeleting $1.',
 85+ 'lqt_delete_undeleting' => 'Undeleting \'\'\'$1\'\'\'.',
8786 'lqt_delete_undeletethread' => 'Undelete thread',
88 - 'lqt_delete_partof' => 'This thread is part of $1.',
89 - 'lqt_delete_deleting' => 'Deleting $1 and $2 to it.',
90 - 'lqt_delete_deleting_allreplies' => 'all replies', // subst above in bold
 87+ 'lqt_delete_partof' => 'This thread is part of \'\'\'$1\'\'\'.',
 88+ 'lqt_delete_deleting' => 'Deleting \'\'\'$1\'\'\' and \'\'\'all replies\'\'\' to it.',
9189 'lqt_delete_deletethread' => 'Delete thread and replies',
9290 'lqt_delete_deleted' => 'The thread was deleted.',
9391 'lqt_delete_undeleted' => 'The thread was undeleted.',
9492 'lqt_delete_return' => 'Return to $1.',
95 - 'lqt_delete_return_link' => 'the talkpage', // subst above
 93+ 'lqt_delete_return_link' => 'the talk page', // subst above
9694 'lqt_delete_unallowed' => 'You are not allowed to delete threads.',
9795 'lqt_delete_show_checkbox' => 'Show deleted threads',
98 - 'lqt_talkpage_autocreate_summary' => 'Talkpage autocreated when first thread was posted.',
 96+ 'lqt_talkpage_autocreate_summary' => 'Talk page autocreated when first thread was posted.',
9997 'lqt_header_warning_before_big' => '',
10098 'lqt_header_warning_big' => 'You are editing a $1.',
10199 'lqt_header_warning_after_big' => 'Headers are for announcements and prefaces.
Index: trunk/extensions/LiquidThreads/LqtBaseView.php
@@ -943,8 +943,7 @@
944944 if ( $thread->type() == Threads::TYPE_DELETED ) {
945945 wfLoadExtensionMessages( 'LiquidThreads' );
946946 if ( in_array( 'deletedhistory', $this->user->getRights() ) ) {
947 - $this->output->addHTML( '<p>' . wfMsg( 'lqt_thread_deleted_for_sysops',
948 - '<b>' . wfMsg( 'lqt_thread_deleted_for_sysops_deleted' ) . '</b>' ) . '</p>' );
 947+ $this->output->addHTML( '<p>' . wfMsg( 'lqt_thread_deleted_for_sysops' ) . '</p>' );
949948 }
950949 else {
951950 $this->output->addHTML( '<p><em>' . wfMsg( 'lqt_thread_deleted' ) . '</em></p>' );

Status & tagging log