X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2FEditPage.php;h=3c109f63c19599dba4a83b4c64788ecc7189c65e;hb=bdf062a8e9f351d3b94f99f2cbe9f7176f0b8801;hp=a07a236cafaf3051f7f9ee29e85a90843d36ce73;hpb=3f88e0c7bf6cdc604041db1c54d8f7be15ceccf8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index a07a236caf..3c109f63c1 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2408,6 +2408,7 @@ class EditPage { $out->addModules( 'mediawiki.action.edit' ); $out->addModuleStyles( 'mediawiki.action.edit.styles' ); + $out->addModuleStyles( 'mediawiki.editfont.styles' ); $user = $this->context->getUser(); if ( $user->getOption( 'showtoolbar' ) ) { @@ -2860,7 +2861,14 @@ class EditPage { // and fallback to the raw wpTextbox1 since editconflicts can't be // resolved between page source edits and custom ui edits using the // custom edit ui. - $this->showTextbox1(); + $conflictTextBoxAttribs = []; + if ( $this->wasDeletedSinceLastEdit() ) { + $conflictTextBoxAttribs['style'] = 'display:none;'; + } elseif ( $this->isOldRev ) { + $conflictTextBoxAttribs['class'] = 'mw-textarea-oldrev'; + } + + $out->addHTML( $editConflictHelper->getEditConflictMainTextBox( $conflictTextBoxAttribs ) ); $out->addHTML( $editConflictHelper->getEditFormHtmlAfterContent() ); } else { $this->showContentForm(); @@ -3287,7 +3295,7 @@ class EditPage { protected function showFormBeforeText() { $out = $this->context->getOutput(); - $out->addHTML( Html::hidden( 'wpSection', htmlspecialchars( $this->section ) ) ); + $out->addHTML( Html::hidden( 'wpSection', $this->section ) ); $out->addHTML( Html::hidden( 'wpStarttime', $this->starttime ) ); $out->addHTML( Html::hidden( 'wpEdittime', $this->edittime ) ); $out->addHTML( Html::hidden( 'editRevId', $this->editRevId ) ); @@ -3338,22 +3346,9 @@ class EditPage { if ( $this->wasDeletedSinceLastEdit() && $this->formtype == 'save' ) { $attribs = [ 'style' => 'display:none;' ]; } else { - $classes = []; // Textarea CSS - if ( $this->mTitle->isProtected( 'edit' ) && - MWNamespace::getRestrictionLevels( $this->mTitle->getNamespace() ) !== [ '' ] - ) { - # Is the title semi-protected? - if ( $this->mTitle->isSemiProtected() ) { - $classes[] = 'mw-textarea-sprotected'; - } else { - # Then it must be protected based on static groups (regular) - $classes[] = 'mw-textarea-protected'; - } - # Is the title cascade-protected? - if ( $this->mTitle->isCascadeProtected() ) { - $classes[] = 'mw-textarea-cprotected'; - } - } + $builder = new TextboxBuilder(); + $classes = $builder->getTextboxProtectionCSSClasses( $this->getTitle() ); + # Is an old revision being edited? if ( $this->isOldRev ) { $classes[] = 'mw-textarea-oldrev'; @@ -3365,12 +3360,7 @@ class EditPage { $attribs += $customAttribs; } - if ( count( $classes ) ) { - if ( isset( $attribs['class'] ) ) { - $classes[] = $attribs['class']; - } - $attribs['class'] = implode( ' ', $classes ); - } + $attribs = $builder->mergeClassesIntoAttributes( $classes, $attribs ); } $this->showTextbox( @@ -4011,7 +4001,10 @@ class EditPage { $parserOutput->setEditSectionTokens( false ); // no section edit links return [ 'parserOutput' => $parserOutput, - 'html' => $parserOutput->getText() ]; + 'html' => $parserOutput->getText( [ + 'enableSectionEditLinks' => false + ] ) + ]; } /**