r25824 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25823‎ | r25824 | r25825 >
Date:09:07, 13 September 2007
Author:david
Status:old
Tags:
Comment:
a bit more work on watches
Modified paths:
  • /branches/liquidthreads/extensions/LqtBaseView.php (modified) (history)
  • /branches/liquidthreads/extensions/LqtPages.php (modified) (history)
  • /branches/liquidthreads/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: branches/liquidthreads/skins/monobook/main.css
@@ -31,6 +31,10 @@
3232 margin-bottom: .1em;
3333 }*/
3434
 35+.lqt_newmessages_section {
 36+ border-bottom: 0px;
 37+}
 38+
3539 .lqt_disabled_link {
3640 color: #999;
3741 }
Index: branches/liquidthreads/extensions/LqtPages.php
@@ -905,6 +905,31 @@
906906 $this->output->addScript($s);
907907 }
908908
 909+ function preShowThread($t) {
 910+ $this->output->addHTML(<<<HTML
 911+ <table ><tr>
 912+ <td style="padding-right: 1em; vertical-align: top; padding-top: 1em;" >
 913+ <form method="POST">
 914+ <input type="submit" value="Read" title="Remove this thread from New Messages." />
 915+ </form>
 916+ </td>
 917+ <td>
 918+HTML
 919+ );
 920+ }
 921+
 922+ function postShowThread($t) {
 923+ $this->output->addHTML(<<<HTML
 924+ </td>
 925+ </tr></table>
 926+HTML
 927+ );
 928+ }
 929+
 930+ private function showClearButtonForThread($thread) {
 931+ $this->output->addHTML('<input type="submit">');
 932+ }
 933+
909934 function postDivClass($thread) {
910935
911936 }
@@ -914,7 +939,9 @@
915940
916941 $threads = NewMessages::newUserMessages($this->user);
917942 foreach($threads as $t) {
 943+ $this->preShowThread($t);
918944 $this->showThread($t);
 945+ $this->postShowThread($t);
919946 }
920947 return false;
921948 }
@@ -928,6 +955,7 @@
929956 $wgMessageCache->addMessage( 'newmessages', 'New Messages' );
930957
931958 class SpecialNewMessages extends SpecialPage {
 959+ private $user, $output, $request, $title;
932960
933961 function __construct() {
934962 SpecialPage::SpecialPage( 'Newmessages' );
@@ -935,17 +963,24 @@
936964 $this->includable( true );
937965 }
938966
939 -
940967 function execute( $par = null ) {
941 - global $wgOut, $wgRequest, $wgUser;
 968+ global $wgOut, $wgRequest, $wgTitle, $wgUser;
 969+ $this->user = $wgUser;
 970+ $this->output = $wgOut;
 971+ $this->request = $wgRequest;
 972+ $this->title = $wgTitle;
942973
943974 $this->setHeaders();
944975
945 - $title = $this->getTitle();
946 - $view = new NewUserMessagesView( $wgOut, new Article($title), $title, $wgUser, $wgRequest );
947 - return $view->show();
 976+ $this->output->addHTML('<h2 class="lqt_newmessages_section">Messages sent to you:</h2>');
948977
 978+ $view = new NewUserMessagesView( $this->output, new Article($this->title),
 979+ $this->title, $this->user, $this->request );
 980+ $view->setHeaderLevel(3);
 981+ $view->show();
 982+
949983 // and then the same for the other talkpage messagess.
 984+ $this->output->addHTML('<h2 class="lqt_newmessages_section">Messages on other talkpages:</h2>');
950985 }
951986 }
952987
Index: branches/liquidthreads/extensions/LqtBaseView.php
@@ -149,6 +149,10 @@
150150 $this->queries = $this->initializeQueries();
151151 }
152152
 153+ function setHeaderLevel($int) {
 154+ $this->headerLevel = $int;
 155+ }
 156+
153157 function initializeQueries() {
154158 $g = new QueryGroup();
155159 $startdate = Date::now()->nDaysAgo($this->archive_start_days)->midnight();

Status & tagging log