r22443 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22442‎ | r22443 | r22444 >
Date:00:04, 26 May 2007
Author:david
Status:old
Tags:
Comment:
Removed some hacks from editpage now that we have the two seperate titles. mAction is no longer needed.
Modified paths:
  • /branches/liquidthreads/extensions/LqtExtension.php (modified) (history)
  • /branches/liquidthreads/includes/EditPage.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtExtension.php
@@ -129,7 +129,8 @@
130130 // this only works for editing because we refer to the article directly.
131131
132132 $e = new EditPage($pp->article);
133 - $e->setAction( $this->title->getFullURL( "lqt_edit_post={$pp->article->getID()}" ) );
 133+ $e->editFormTextBottom .= "<input type=\"hidden\" name=\"lqt_edit_post\" value=\"{$pp->article->getID()}\">";
 134+// $e->setAction( $this->title->getFullURL( "lqt_edit_post={$pp->article->getID()}" ) );
134135
135136 /* if ( $p->thread()->firstPost()->getID() == $p->getID() ) {
136137 // This is the thread's root post; display topic field.
@@ -204,7 +205,6 @@
205206 }
206207
207208 function showPost( $post ) {
208 -
209209 $this->openDiv( 'lqt_post' );
210210
211211 if( $this->commandApplies( LQT_COMMAND_EDIT_POST, $post ) ) {
@@ -224,14 +224,11 @@
225225 }
226226
227227 function showThreadHeading( $thread ) {
228 -
229228 if ( $thread->hasSubject() )
230229 $this->output->addHTML( wfElement( "h{$this->headerLevel}", null, $thread->subject() ) );
231230 }
232231
233232 function showThread( $thread ) {
234 -
235 -
236233 $this->showThreadHeading( $thread );
237234 $this->showPost( $thread->rootPost() );
238235 $this->indent();
@@ -242,13 +239,11 @@
243240 }
244241
245242 function indent() {
246 -
247243 $this->output->addHTML( wfOpenElement( 'dl', array('class'=>'lqt_replies') ) );
248244 $this->output->addHTML( wfOpenElement( 'dd') );
249245 $this->headerLevel += 1;
250246 }
251247 function unindent() {
252 -
253248 $this->output->addHTML( wfCloseElement( 'dd') );
254249 $this->output->addHTML( wfCloseElement( 'dl') );
255250 $this->headerLevel -= 1;
Index: branches/liquidthreads/includes/EditPage.php
@@ -45,35 +45,17 @@
4646 public $editFormTextAfterTools;
4747 public $editFormTextBottom;
4848
49 -
50 - ##### LQT HACK
51 -
52 - var $didRedirect = false;
53 - var $didSave = false;
54 -
55 - /** @param $action string URL that the form will submit to. */
56 - function setAction($action) {
57 - $this->mAction = $action;
58 - }
59 -
60 - ##### END
6149
62 -
6350 /**
6451 * @todo document
6552 * @param $article
6653 */
6754 function EditPage( $article ) {
6855 $this->mArticle =& $article;
69 -// if( $article ) {
70 -// $this->mTitle =& $article->getTitle(); ### LQT HACK.
71 -// }
72 -// else { # non-existant article; shouldn't affect LQT so leave it this way.
73 - global $wgTitle;
74 - $this->mTitle =& $wgTitle;
75 -// }
76 -
7756
 57+ global $wgTitle;
 58+ $this->mTitle =& $wgTitle;
 59+
7860 # Placeholders for text injection by hooks (empty per default)
7961 $this->editFormPageTop =
8062 $this->editFormTextTop =
@@ -1054,15 +1036,10 @@
10551037 if ( $ew ) $ew = " style=\"width:100%\"";
10561038 else $ew = '';
10571039
1058 - if ($this->mAction) {
1059 - $action = $this->mAction; ### LQT HACK
1060 - } else {
1061 - $q = 'action=submit';
1062 - #if ( "no" == $redirect ) { $q .= "&redirect=no"; }
1063 - $action = $this->mTitle->escapeLocalURL( $q );
1064 - }
 1040+ $q = 'action=submit';
 1041+ #if ( "no" == $redirect ) { $q .= "&redirect=no"; }
 1042+ $action = $this->mTitle->escapeLocalURL( $q );
10651043
1066 -
10671044 $summary = wfMsg('summary');
10681045 $subject = wfMsg('subject');
10691046