X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FEditPage.php;h=cfb78cd78d834d09c36c541f1990d08659da287e;hb=590f1bd8c261c882f23c2a404fbcc40ae4e5d460;hp=e3b7a10b7b863e2e64212554e409ce5148bc5dfa;hpb=a8dcb178c7e347ef56bef1e36bb4a26a61a1d82b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index e3b7a10b7b..cfb78cd78d 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1698,7 +1698,7 @@ class EditPage { global $wgParser; if ( $this->sectiontitle !== '' ) { - $sectionanchor = $wgParser->guessLegacySectionNameFromWikiText( $this->sectiontitle ); + $sectionanchor = $this->guessSectionName( $this->sectiontitle ); // If no edit summary was specified, create one automatically from the section // title and have it link to the new section. Otherwise, respect the summary as // passed. @@ -1708,7 +1708,7 @@ class EditPage { ->rawParams( $cleanSectionTitle )->inContentLanguage()->text(); } } elseif ( $this->summary !== '' ) { - $sectionanchor = $wgParser->guessLegacySectionNameFromWikiText( $this->summary ); + $sectionanchor = $this->guessSectionName( $this->summary ); # This is a new section, so create a link to the new section # in the revision summary. $cleanSummary = $wgParser->stripSectionName( $this->summary ); @@ -1743,7 +1743,7 @@ class EditPage { * time. */ public function internalAttemptSave( &$result, $bot = false ) { - global $wgUser, $wgRequest, $wgParser, $wgMaxArticleSize; + global $wgUser, $wgRequest, $wgMaxArticleSize; global $wgContentHandlerUseDB; $status = Status::newGood(); @@ -2117,7 +2117,7 @@ class EditPage { # We can't deal with anchors, includes, html etc in the header for now, # headline would need to be parsed to improve this. if ( $hasmatch && strlen( $matches[2] ) > 0 ) { - $sectionanchor = $wgParser->guessLegacySectionNameFromWikiText( $matches[2] ); + $sectionanchor = $this->guessSectionName( $matches[2] ); } } $result['sectionanchor'] = $sectionanchor; @@ -3076,7 +3076,7 @@ class EditPage { 'tabindex' => 1, 'size' => 60, 'spellcheck' => 'true', - ] + Linker::tooltipAndAccesskeyAttribs( 'summary' ); + ]; } /** @@ -3097,6 +3097,7 @@ class EditPage { $inputAttrs = null, $spanLabelAttrs = null ) { $inputAttrs = $this->getSummaryInputAttributes( $inputAttrs ); + $inputAttrs += Linker::tooltipAndAccesskeyAttribs( 'summary' ); $spanLabelAttrs = ( is_array( $spanLabelAttrs ) ? $spanLabelAttrs : [] ) + [ 'class' => $this->missingSummary ? 'mw-summarymissed' : 'mw-summary', @@ -3132,6 +3133,10 @@ class EditPage { $inputAttrs = OOUI\Element::configFromHtmlAttributes( $this->getSummaryInputAttributes( $inputAttrs ) ); + $inputAttrs += [ + 'title' => Linker::titleAttrib( 'summary' ), + 'accessKey' => Linker::accesskey( 'summary' ), + ]; // For compatibility with old scripts and extensions, we want the legacy 'id' on the `` $inputAttrs['inputId'] = $inputAttrs['id']; @@ -3220,16 +3225,13 @@ class EditPage { protected function showFormBeforeText() { global $wgOut; - $section = htmlspecialchars( $this->section ); - $wgOut->addHTML( <<
- - - - - -HTML - ); + + $wgOut->addHTML( Html::hidden( 'wpSection', htmlspecialchars( $this->section ) ) ); + $wgOut->addHTML( Html::hidden( 'wpStarttime', $this->starttime ) ); + $wgOut->addHTML( Html::hidden( 'wpEdittime', $this->edittime ) ); + $wgOut->addHTML( Html::hidden( 'editRevId', $this->editRevId ) ); + $wgOut->addHTML( Html::hidden( 'wpScrolltop', $this->scrolltop ) ); + if ( !$this->checkUnicodeCompliantBrowser() ) { $wgOut->addHTML( Html::hidden( 'safemode', '1' ) ); } @@ -3492,6 +3494,10 @@ HTML } } + /** + * Inserts optional text shown below edit and upload forms. Can be used to offer special + * characters not present on most keyboards for copying/pasting. + */ protected function showEditTools() { global $wgOut; $wgOut->addHTML( '