X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FEditPage.php;h=fc770068f5640ec0272c43cac9d02dc5c2ca6dc8;hp=6be8771121f9aa79ba941ded413f32512d9943d7;hb=4838f88d844056d475967a96d592f1271cc987bf;hpb=38a2a5661e1c7a3ac3f2a5688a806ed4b67c757f diff --git a/includes/EditPage.php b/includes/EditPage.php index 6be8771121..fc770068f5 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -422,8 +422,6 @@ class EditPage { * @param Article $article */ public function __construct( Article $article ) { - global $wgOOUIEditPage; - $this->mArticle = $article; $this->page = $article->getPage(); // model object $this->mTitle = $article->getTitle(); @@ -434,7 +432,7 @@ class EditPage { $handler = ContentHandler::getForModelID( $this->contentModel ); $this->contentFormat = $handler->getDefaultFormat(); - $this->oouiEnabled = $wgOOUIEditPage; + $this->oouiEnabled = $this->context->getConfig()->get( 'OOUIEditPage' ); } /** @@ -1493,6 +1491,20 @@ class EditPage { return $status; } + /** + * Log when a page was successfully saved after the edit conflict view + */ + private function incrementResolvedConflicts() { + global $wgRequest; + + if ( $wgRequest->getText( 'mode' ) !== 'conflict' ) { + return; + } + + $stats = MediaWikiServices::getInstance()->getStatsdDataFactory(); + $stats->increment( 'edit.failures.conflict.resolved' ); + } + /** * Handle status, such as after attempt save * @@ -1512,6 +1524,8 @@ class EditPage { if ( $status->value == self::AS_SUCCESS_UPDATE || $status->value == self::AS_SUCCESS_NEW_ARTICLE ) { + $this->incrementResolvedConflicts(); + $this->didSave = true; if ( !$resultDetails['nullEdit'] ) { $this->setPostEditCookie( $status->value ); @@ -2769,7 +2783,7 @@ class EditPage { $wgOut->addHTML( $this->editFormTextBeforeContent ); if ( !$this->isCssJsSubpage && $showToolbar && $wgUser->getOption( 'showtoolbar' ) ) { - $wgOut->addHTML( EditPage::getEditToolbar( $this->mTitle ) ); + $wgOut->addHTML( self::getEditToolbar( $this->mTitle ) ); } if ( $this->blankArticle ) { @@ -3062,7 +3076,7 @@ class EditPage { 'tabindex' => 1, 'size' => 60, 'spellcheck' => 'true', - ] + Linker::tooltipAndAccesskeyAttribs( 'summary' ); + ]; } /** @@ -3083,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', @@ -3118,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']; @@ -3478,6 +3497,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( '