From 30879325eba768c1fd0bf170f6dc6b35906f0d90 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Thu, 28 Aug 2008 11:55:43 +0000 Subject: [PATCH] Modernize the email user form to our actual standards: * Add fieldset * RTL compatability * CSS classes/IDs --- includes/DefaultSettings.php | 2 +- includes/specials/SpecialEmailuser.php | 92 +++++++++++++++----------- languages/messages/MessagesEn.php | 1 + maintenance/language/messages.inc | 1 + skins/common/shared.css | 9 +++ 5 files changed, 67 insertions(+), 38 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 617662b243..1eb755cd1b 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1382,7 +1382,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '169'; +$wgStyleVersion = '170'; # Server-side caching: diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index 9dcf8955c9..318b1c619a 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -98,46 +98,64 @@ class EmailUserForm { $this->subject = wfMsgExt( 'defemailsubject', array( 'content', 'parsemag' ) ); } - $emf = wfMsg( "emailfrom" ); - $senderLink = $skin->makeLinkObj( - $wgUser->getUserPage(), htmlspecialchars( $wgUser->getName() ) ); - $emt = wfMsg( "emailto" ); - $recipientLink = $skin->makeLinkObj( - $this->target->getUserPage(), htmlspecialchars( $this->target->getName() ) ); - $emr = wfMsg( "emailsubject" ); - $emm = wfMsg( "emailmessage" ); - $ems = wfMsg( "emailsend" ); - $emc = wfMsg( "emailccme" ); - $encSubject = htmlspecialchars( $this->subject ); - $titleObj = SpecialPage::getTitleFor( "Emailuser" ); - $action = $titleObj->escapeLocalURL( "target=" . + $action = $titleObj->getLocalURL( "target=" . urlencode( $this->target->getName() ) . "&action=submit" ); - $token = htmlspecialchars( $wgUser->editToken() ); - - $wgOut->addHTML( " -
- - - - - - - - - - -
{$emf}:{$senderLink}
{$emt}:{$recipientLink}
{$emr}: - -
-
- -" . wfCheckLabel( $emc, 'wpCCMe', 'wpCCMe', $wgUser->getBoolOption( 'ccmeonemails' ) ) . "
- - -
\n" ); + $wgOut->addHTML( + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'emailuser' ) ) . + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, wfMsg( 'email-legend' ) ) . + Xml::openElement( 'table', array( 'class' => 'mw-emailuser-table' ) ) . + " + " . + Xml::label( wfMsg( 'emailfrom' ), 'emailfrom' ) . + " + " . + $skin->link( $wgUser->getUserPage(), htmlspecialchars( $wgUser->getName() ) ) . + " + + + " . + Xml::label( wfMsg( 'emailto' ), 'emailto' ) . + " + " . + $skin->link( $this->target->getUserPage(), htmlspecialchars( $this->target->getName() ) ) . + " + + + " . + Xml::label( wfMsg( 'emailsubject' ), 'wpSubject' ) . + " + " . + Xml::input( 'wpSubject', 60, $this->subject, array( 'type' => 'text', 'maxlength' => 200 ) ) . + " + + + " . + Xml::label( wfMsg( 'emailmessage' ), 'wpText' ) . + " + " . + Xml::textarea( 'wpText', $this->text, 80, 20, array( 'id' => 'wpText' ) ) . + " + + + + " . + Xml::checkLabel( wfMsg( 'emailccme' ), 'wpCCMe', 'wpCCMe', $wgUser->getBoolOption( 'ccmeonemails' ) ) . + " + + + + " . + Xml::submitButton( wfMsg( 'emailsend' ), array( 'name' => 'wpSend', 'accesskey' => 's' ) ) . + " + " . + Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . + Xml::closeElement( 'table' ) . + Xml::closeElement( 'fieldset' ) . + Xml::closeElement( 'form' ) + ); } /* diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 1c337e02c8..f318dbb08d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2117,6 +2117,7 @@ The e-mail address you entered in [[Special:Preferences|your user preferences]] 'defemailsubject' => '{{SITENAME}} e-mail', 'noemailtitle' => 'No e-mail address', 'noemailtext' => 'This user has not specified a valid e-mail address, or has chosen not to receive e-mail from other users.', +'email-legend' => 'Send an e-mail to another {{SITENAME}} user', 'emailfrom' => 'From:', 'emailto' => 'To:', 'emailsubject' => 'Subject:', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index cfb5c9cd56..bce227c05e 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1390,6 +1390,7 @@ $wgMessageStructure = array( 'defemailsubject', 'noemailtitle', 'noemailtext', + 'email-legend', 'emailfrom', 'emailto', 'emailsubject', diff --git a/skins/common/shared.css b/skins/common/shared.css index d42fc1c0df..a357e6d393 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -247,3 +247,12 @@ h4.mw-specialpagesgroup { #shared-image-dup, #shared-image-conflict { font-style: italic; } + +/* Special:EmailUser styling */ +table.mw-emailuser-table { + width: 98%; +} +td#mw-emailuser-sender, td#mw-emailuser-recipient { + font-weight: bold; +} + -- 2.20.1