126 $this->stats->increment(
'edit.failures.conflict' );
129 $this->title->getNamespace() >=
NS_MAIN &&
132 $this->stats->increment(
133 'edit.failures.conflict.byNamespaceId.' . $this->title->getNamespace()
142 $this->stats->increment(
'edit.failures.conflict.resolved' );
145 $this->title->getNamespace() >=
NS_MAIN &&
148 $this->stats->increment(
149 'edit.failures.conflict.resolved.byNamespaceId.' . $this->title->getNamespace()
158 return Html::rawElement(
160 [
'class' =>
'mw-explainconflict' ],
161 $this->out->msg(
'explainconflict', $this->out->msg( $this->submitLabel )->text() )->parse()
172 $classes = $builder->getTextboxProtectionCSSClasses( $this->title );
174 $attribs = [
'tabindex' => 1 ];
175 $attribs += $customAttribs;
177 $attribs = $builder->mergeClassesIntoAttributes( $classes, $attribs );
179 $attribs = $builder->buildTextboxAttribs(
182 $this->out->getUser(),
187 Html::textarea(
'wpTextbox1', $builder->addNewLineAtEnd( $this->storedversion ), $attribs )
216 $this->out->wrapWikiMsg(
'<h2>$1</h2>',
"yourdiff" );
219 $storedContent = $this->
toEditContent( $this->storedversion );
221 $diffEngine = $handler->createDifferenceEngine( $this->out );
223 $diffEngine->setContent( $yourContent, $storedContent );
224 $diffEngine->showDiff(
225 $this->out->msg(
'yourtext' )->parse(),
226 $this->out->msg(
'storedversion' )->text()
229 $this->out->wrapWikiMsg(
'<h2>$1</h2>',
"yourtext" );
232 $attribs = $builder->buildTextboxAttribs(
234 [
'tabindex' => 6,
'readonly' ],
235 $this->out->getUser(),
240 Html::textarea(
'wpTextbox2', $builder->addNewLineAtEnd( $this->yourtext ), $attribs )
A content handler knows how do deal with a specific type of content on a wiki page.
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
static getForModelID( $modelId)
Returns the ContentHandler singleton for the given model ID.
This class is a collection of static functions that serve two purposes:
Helper for displaying edit conflicts in text content models to users.
null string $contentModel
getEditFormHtmlAfterContent()
Content to go in the edit form after textbox1.
getEditConflictMainTextBox(array $customAttribs=[])
HTML to build the textbox1 on edit conflicts.
incrementConflictStats()
Record a user encountering an edit conflict.
showEditFormTextAfterFooters()
Content to go in the edit form after the footers (templates on this page, hidden categories,...
null string $contentFormat
IBufferingStatsdDataFactory $stats
incrementResolvedStats()
Record when a user has resolved an edit conflict.
setContentFormat( $contentFormat)
setContentModel( $contentModel)
__construct(Title $title, OutputPage $out, IBufferingStatsdDataFactory $stats, $submitLabel)
setTextboxes( $yourtext, $storedversion)
string $submitLabel
Message key for submit button's label.
getEditFormHtmlBeforeContent()
Content to go in the edit form before textbox1.
Helps EditPage build textboxes.
This is one of the Core classes and should be read at least once by any new developers.
Represents a title within MediaWiki.
getContentModel( $flags=0)
Get the page's content model id, see the CONTENT_MODEL_XXX constants.
Base interface for content objects.
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.