Index: trunk/extensions/ContactPage/SpecialContact.php |
— | — | @@ -121,11 +121,11 @@ |
122 | 122 | function __construct( $target, $par ) { |
123 | 123 | global $wgRequest, $wgUser; |
124 | 124 | |
125 | | - $formType = $wgRequest->getText( 'type', $par ); |
| 125 | + $this->formType = $wgRequest->getText( 'formtype', $par ); |
126 | 126 | |
127 | 127 | # Check for type in [[Special:Contact/type]]: change pagetext and prefill form fields |
128 | | - if ( $formType != '' ) { |
129 | | - $message = 'contactpage-pagetext-' . $formType; |
| 128 | + if ( $this->formType != '' ) { |
| 129 | + $message = 'contactpage-pagetext-' . $this->formType; |
130 | 130 | $text = wfMsgExt( $message, 'parse' ); |
131 | 131 | if ( !wfEmptyMsg( $message, $text ) ) { |
132 | 132 | $this->formularText = $text; |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | $this->formularText = wfMsgExt( 'contactpage-pagetext', 'parse' ); |
135 | 135 | } |
136 | 136 | |
137 | | - $message = 'contactpage-subject-' . $formType; |
| 137 | + $message = 'contactpage-subject-' . $this->formType; |
138 | 138 | $text = wfMsgForContentNoTrans( $message ); |
139 | 139 | if ( !wfEmptyMsg( $message, $text ) ) { |
140 | 140 | $this->subject = $wgRequest->getText( 'wpSubject', $text ); |
— | — | @@ -141,7 +141,7 @@ |
142 | 142 | $this->subject = $wgRequest->getText( 'wpSubject' ); |
143 | 143 | } |
144 | 144 | |
145 | | - $message = 'contactpage-text-' . $formType; |
| 145 | + $message = 'contactpage-text-' . $this->formType; |
146 | 146 | $text = wfMsgForContentNoTrans( $message ); |
147 | 147 | if ( !wfEmptyMsg( $message, $text ) ) { |
148 | 148 | $this->text = $wgRequest->getText( 'wpText', $text ); |
— | — | @@ -301,6 +301,7 @@ |
302 | 302 | '</td> |
303 | 303 | </tr>' . |
304 | 304 | Html::hidden( 'wpEditToken', $token ) . |
| 305 | + Html::hidden( 'formtype', $this->formType ) . |
305 | 306 | Xml::closeElement( 'table' ) . |
306 | 307 | Xml::closeElement( 'fieldset' ) . |
307 | 308 | Xml::closeElement( 'form' ); |
— | — | @@ -394,7 +395,7 @@ |
395 | 396 | $subject = wfMsgForContent( 'contactpage-subject-and-sender', $subject, $senderIP ); |
396 | 397 | } |
397 | 398 | |
398 | | - if( !wfRunHooks( 'ContactForm', array( &$targetAddress, &$replyto, &$subject, &$this->text ) ) ) { |
| 399 | + if( !wfRunHooks( 'ContactForm', array( &$targetAddress, &$replyto, &$subject, &$this->text, $this->formType ) ) ) { |
399 | 400 | wfDebug( __METHOD__ . ": aborted by hook\n" ); |
400 | 401 | return; |
401 | 402 | } |
— | — | @@ -415,7 +416,7 @@ |
416 | 417 | // unless they are emailing themselves, in which case one copy of the message is sufficient. |
417 | 418 | if( $this->cc_me && $this->fromaddress ) { |
418 | 419 | $cc_subject = wfMsg( 'emailccsubject', $this->target->getName(), $subject ); |
419 | | - if( wfRunHooks( 'ContactForm', array( &$submitterAddress, &$contactSender, &$cc_subject, &$this->text ) ) ) { |
| 420 | + if( wfRunHooks( 'ContactForm', array( &$submitterAddress, &$contactSender, &$cc_subject, &$this->text, $this->formType ) ) ) { |
420 | 421 | wfDebug( __METHOD__ . ": sending cc mail from " . $contactSender->toString() . |
421 | 422 | " to " . $submitterAddress->toString() . "\n" ); |
422 | 423 | $ccResult = UserMailer::send( $submitterAddress, $contactSender, $cc_subject, $this->text ); |