From 3833566d151b8dce9640753eb4f10efc8b436009 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Thu, 12 Feb 2009 23:42:33 +0000 Subject: [PATCH] Trying to make the EditPage code a bit more readable by breaking lines and converting some of the more egregious offenders into using the Xml:: functions. I tested editing and so on, but do tell me if there's some automated test that I'm supposed to run it through. --- includes/EditPage.php | 50 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 80bc5e44ae..2b45444865 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1341,7 +1341,22 @@ class EditPage { $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary ); $summaryhiddens .= Xml::hidden( 'wpAutoSummary', $autosumm ); if ( $this->section == 'new' ) { - $commentsubject = $wgRequest->getBool( 'nosummary' ) ? '' : "\n{$summaryhiddens}
"; + $commentsubject = ''; + if ( !$wgRequest->getBool( 'nosummary' ) ) { + $commentsubject = + Xml::label( $subject, 'wpSummary' ); + $commentsubject = + Xml::tags( 'span', array( 'id' => 'wpSummaryLabel' ), $commentsubject ); + $commentsubject .= ' '; + $commentsubject .= Xml::input( 'wpSummary', + 60, + $summarytext, + array( + 'id' => 'wpSummary', + 'maxlength' => '200', + 'tabindex' => '1' + ) ); + } $editsummary = "
\n"; global $wgParser; $formattedSummary = wfMsgForContent( 'newsectionsummary', $wgParser->stripSectionName( $this->summary ) ); @@ -1349,8 +1364,33 @@ class EditPage { $summarypreview = ''; } else { $commentsubject = ''; - $editsummary="
\n\n{$summaryhiddens}
"; - $summarypreview = $summarytext && $this->preview ? "
". wfMsg('summary-preview') .$sk->commentBlock( $this->summary, $this->mTitle )."
\n" : ''; + + $editsummary = Xml::label( $summary, 'wpSummary' ); + $editsummary = + Xml::tags( 'span', array( 'id' => 'wpSummaryLabel' ), $editsummary ); + + $editsummary .= Xml::input( 'wpSummary', + 60, + $summarytext, + array( + 'id' => 'wpSummary', + 'maxlength' => '200', + 'tabindex' => '1' + ) ); + + // No idea where this is closed. + $editsummary = Xml::openElement( 'div', array( 'class' => 'editOptions' ) ) + . $editsummary . '
'; + + $summarypreview = ''; + if ( $summarytext && $this->preview ) { + $summarypreview = + Xml::tags( 'div', + array( 'class' => 'mw-summary-preview' ), + wfMsg( 'summary-preview' ) . + $sk->commentBlock( $this->summary, $this->mTitle ) + ); + } $subjectpreview = ''; } @@ -1382,7 +1422,9 @@ class EditPage { $recreate = ''; if ( $this->wasDeletedSinceLastEdit() ) { if ( 'save' != $this->formtype ) { - $wgOut->wrapWikiMsg( '
$1
', 'deletedwhileediting' ); + $wgOut->wrapWikiMsg( + '
$1
', + 'deletedwhileediting' ); } else { // Hide the toolbar and edit area, user can click preview to get it back // Add an confirmation checkbox and explanation. -- 2.20.1