http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63591

Revision: 63591
Author:   werdna
Date:     2010-03-11 11:16:28 +0000 (Thu, 11 Mar 2010)

Log Message:
-----------
LiquidThreads: Fix issues with previews and reply forms not appearing under all 
circumstances. Patch does not apply to SVN HEAD, as this has significant 
inferface changes in it

Modified Paths:
--------------
    branches/wmf-deployment/extensions/LiquidThreads/classes/View.php
    branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/View.php

Modified: branches/wmf-deployment/extensions/LiquidThreads/classes/View.php
===================================================================
--- branches/wmf-deployment/extensions/LiquidThreads/classes/View.php   
2010-03-11 09:58:47 UTC (rev 63590)
+++ branches/wmf-deployment/extensions/LiquidThreads/classes/View.php   
2010-03-11 11:16:28 UTC (rev 63591)
@@ -301,11 +301,15 @@
        }
 
        function showReplyForm( $thread ) {
+               $html = Xml::openElement( 'div',
+                                       array( 'class' => 'lqt-reply-form' ) );
+               $this->output->addHTML( $html );
                if ( $thread->root()->getTitle()->userCan( 'edit' ) ) {
-                       $this->showEditingFormInGeneral( null, 'reply', $thread 
);
+                       $this->showEditingFormInGeneral( null, 'reply', $thread 
);
                } else {
                        $this->showReplyProtectedNotice( $thread );
                }
+               $this->output->addHTML('</div>');
        }
 
        function showSummarizeForm( $thread ) {
@@ -1558,6 +1562,10 @@
                        $this->showThreadReplies( $thread, $startAt, $maxCount, 
$showThreads,
                                $cascadeOptions );
                } elseif ( $hasSubthreads && !$showThreads ) {
+                       if ($replyTo) {
+                               $this->showReplyForm( $thread );
+                       }
+                       
                        // Add a "show subthreads" link.
                        $link = $this->getShowReplies( $thread );
 
@@ -1575,10 +1583,8 @@
                                $class = 'lqt-thread-replies 
lqt-thread-replies-'.
                                                $this->threadNestingLevel;
                                $html = Xml::openElement( 'div', array( 'class' 
=> $class ) );
-                               $html .= Xml::openElement( 'div',
-                                                       array( 'class' => 
'lqt-reply-form' ) );
                                $this->output->addHTML( $html );
-
+                               
                                $this->showReplyForm( $thread );
 
                                $finishDiv = Xml::tags( 'div',
@@ -1594,6 +1600,22 @@
                                $finishHTML .= Xml::closeElement( 'div' ); // 
lqt-thread-replies
                                $this->output->addHTML( $finishHTML );
                        }
+               } elseif ( !$hasSubthreads && $replyTo ) {
+                       $class = 'lqt-thread-replies lqt-thread-replies-'.
+                                       $this->threadNestingLevel;
+                       $html = Xml::openElement( 'div', array( 'class' => 
$class ) );
+                       $this->output->addHTML( $html );
+                       
+                       $this->showReplyForm( $thread );
+                       
+                       $html = Xml::tags( 'div',
+                                       array( 'class' => 'lqt-replies-finish' 
),
+                                       Xml::tags( 'div',
+                                               array( 'class' =>
+                                                       
'lqt-replies-finish-corner'
+                                               ), '&nbsp;' ) );
+                       $html .= Xml::closeElement( 'div' );
+                       $this->output->addHTML( $html );
                }
 
                if ( $this->threadNestingLevel == 1 ) {
@@ -1616,10 +1638,7 @@
                // Check if we're actually replying to this thread.
                if ( $this->methodAppliesToThread( 'reply', $thread ) ) {
                        // As with above, flush HTML to avoid refactoring 
EditPage.
-                       $this->output->addHTML( Xml::openElement( 'div',
-                               array( 'class' => 'lqt-reply-form' ) ) );
                        $this->showReplyForm( $thread );
-                       $this->output->addHTML( Xml::closeElement( 'div' ) );
                        return;
                } elseif ( !$thread->canUserReply( $this->user ) ) {
                        return;

Modified: 
branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/View.php
===================================================================
--- branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/View.php     
2010-03-11 09:58:47 UTC (rev 63590)
+++ branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/View.php     
2010-03-11 11:16:28 UTC (rev 63591)
@@ -307,11 +307,15 @@
        }
 
        function showReplyForm( $thread ) {
+               $html = Xml::openElement( 'div',
+                                       array( 'class' => 'lqt-reply-form' ) );
+               $this->output->addHTML( $html );
                if ( $thread->root()->getTitle()->userCan( 'edit' ) ) {
-                       $this->showEditingFormInGeneral( null, 'reply', $thread 
);
+                       $this->showEditingFormInGeneral( null, 'reply', $thread 
);
                } else {
                        $this->showReplyProtectedNotice( $thread );
                }
+               $this->output->addHTML('</div>');
        }
 
        function showSummarizeForm( $thread ) {
@@ -1605,6 +1609,10 @@
                        $this->showThreadReplies( $thread, $startAt, $maxCount, 
$showThreads,
                                $cascadeOptions );
                } elseif ( $hasSubthreads && !$showThreads ) {
+                       if ($replyTo) {
+                               $this->showReplyForm( $thread );
+                       }
+                       
                        // Add a "show subthreads" link.
                        $link = $this->getShowReplies( $thread );
 
@@ -1622,10 +1630,8 @@
                                $class = 'lqt-thread-replies 
lqt-thread-replies-' .
                                                $this->threadNestingLevel;
                                $html = Xml::openElement( 'div', array( 'class' 
=> $class ) );
-                               $html .= Xml::openElement( 'div',
-                                                       array( 'class' => 
'lqt-reply-form' ) );
                                $this->output->addHTML( $html );
-
+                               
                                $this->showReplyForm( $thread );
 
                                $finishDiv = Xml::tags( 'div',
@@ -1641,6 +1647,22 @@
                                $finishHTML .= Xml::closeElement( 'div' ); // 
lqt-thread-replies
                                $this->output->addHTML( $finishHTML );
                        }
+               } elseif ( !$hasSubthreads && $replyTo ) {
+                       $class = 'lqt-thread-replies lqt-thread-replies-'.
+                                       $this->threadNestingLevel;
+                       $html = Xml::openElement( 'div', array( 'class' => 
$class ) );
+                       $this->output->addHTML( $html );
+                       
+                       $this->showReplyForm( $thread );
+                       
+                       $html = Xml::tags( 'div',
+                                       array( 'class' => 'lqt-replies-finish' 
),
+                                       Xml::tags( 'div',
+                                               array( 'class' =>
+                                                       
'lqt-replies-finish-corner'
+                                               ), '&nbsp;' ) );
+                       $html .= Xml::closeElement( 'div' );
+                       $this->output->addHTML( $html );
                }
 
                if ( $this->threadNestingLevel == 1 ) {
@@ -1663,10 +1685,7 @@
                // Check if we're actually replying to this thread.
                if ( $this->methodAppliesToThread( 'reply', $thread ) ) {
                        // As with above, flush HTML to avoid refactoring 
EditPage.
-                       $this->output->addHTML( Xml::openElement( 'div',
-                               array( 'class' => 'lqt-reply-form' ) ) );
                        $this->showReplyForm( $thread );
-                       $this->output->addHTML( Xml::closeElement( 'div' ) );
                        return;
                } elseif ( !$thread->canUserReply( $this->user ) ) {
                        return;



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to