Reduce code duplication by adding conditions to $conds directly, rather than adding...
[lhc/web/wiklou.git] / includes / specials / SpecialConfirmemail.php
index 56eda6f..372a574 100644 (file)
@@ -34,9 +34,13 @@ class EmailConfirmation extends UnlistedSpecialPage {
                                }
                        } else {
                                $title = SpecialPage::getTitleFor( 'Userlogin' );
-                               $self = SpecialPage::getTitleFor( 'Confirmemail' );
                                $skin = $wgUser->getSkin();
-                               $llink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $self->getPrefixedUrl() );
+                               $llink = $skin->linkKnown(
+                                       $title,
+                                       wfMsgHtml( 'loginreqlink' ),
+                                       array(),
+                                       array( 'returnto' => $this->getTitle()->getPrefixedText() )
+                               );
                                $wgOut->addHTML( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) );
                        }
                } else {
@@ -67,13 +71,12 @@ class EmailConfirmation extends UnlistedSpecialPage {
                                $wgOut->addWikiMsg( 'emailauthenticated', $time, $d, $t );
                        }
                        if( $wgUser->isEmailConfirmationPending() ) {
-                               $wgOut->addWikiMsg( 'confirmemail_pending' );
+                               $wgOut->wrapWikiMsg( "<div class=\"error mw-confirmemail-pending\">\n$1</div>", 'confirmemail_pending' );
                        }
                        $wgOut->addWikiMsg( 'confirmemail_text' );
-                       $self = SpecialPage::getTitleFor( 'Confirmemail' );
-                       $form  = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) );
+                       $form  = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl() ) );
                        $form .= Xml::hidden( 'token', $wgUser->editToken() );
-                       $form .= Xml::submitButton( wfMsgHtml( 'confirmemail_send' ) );
+                       $form .= Xml::submitButton( wfMsg( 'confirmemail_send' ) );
                        $form .= Xml::closeElement( 'form' );
                        $wgOut->addHTML( $form );
                }