MediaWiki master
MediaWiki\EditPage\TextConflictHelper Class Reference

Helper for displaying edit conflicts in text content models to users. More...

Collaboration diagram for MediaWiki\EditPage\TextConflictHelper:

Public Member Functions

 __construct (Title $title, OutputPage $out, $stats, $submitLabel, IContentHandlerFactory $contentHandlerFactory)
 
 getEditConflictMainTextBox (array $customAttribs=[])
 HTML to build the textbox1 on edit conflicts.
 
 getEditFormHtmlAfterContent ()
 Content to go in the edit form after textbox1.
 
 getEditFormHtmlBeforeContent ()
 Content to go in the edit form before textbox1.
 
 getExplainHeader ()
 
 incrementConflictStats (User $user=null)
 Record a user encountering an edit conflict.
 
 incrementResolvedStats (User $user=null)
 Record when a user has resolved an edit conflict.
 
 setContentFormat ( $contentFormat)
 
 setContentModel ( $contentModel)
 
 setTextboxes ( $yourtext, $storedversion)
 
 showEditFormTextAfterFooters ()
 Content to go in the edit form after the footers (templates on this page, hidden categories, limit report)
 

Public Attributes

null string $contentFormat
 
null string $contentModel
 

Protected Member Functions

 getUserBucket (?int $userEdits)
 
 incrementStatsByUserEdits ( $userEdits, $keyPrefixBase)
 Retained temporarily for backwards-compatibility.
 

Protected Attributes

OutputPage $out
 
IBufferingStatsdDataFactory StatsFactory $stats
 
string $storedversion = ''
 
string $submitLabel
 Message key for submit button's label.
 
Title $title
 
string $yourtext = ''
 

Detailed Description

Helper for displaying edit conflicts in text content models to users.

Since
1.31
Author
Kunal Mehta legok.nosp@m.tm@d.nosp@m.ebian.nosp@m..org

Definition at line 40 of file TextConflictHelper.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\EditPage\TextConflictHelper::__construct ( Title  $title,
OutputPage  $out,
  $stats,
  $submitLabel,
IContentHandlerFactory  $contentHandlerFactory 
)

Member Function Documentation

◆ getEditConflictMainTextBox()

MediaWiki\EditPage\TextConflictHelper::getEditConflictMainTextBox ( array  $customAttribs = [])

HTML to build the textbox1 on edit conflicts.

Parameters
array$customAttribs
Returns
string HTML

Definition at line 263 of file TextConflictHelper.php.

Referenced by MediaWiki\EditPage\EditPage\showEditForm().

◆ getEditFormHtmlAfterContent()

MediaWiki\EditPage\TextConflictHelper::getEditFormHtmlAfterContent ( )

Content to go in the edit form after textbox1.

See also
EditPage::$editFormTextAfterContent
Returns
string HTML

Definition at line 305 of file TextConflictHelper.php.

Referenced by MediaWiki\EditPage\EditPage\showEditForm().

◆ getEditFormHtmlBeforeContent()

MediaWiki\EditPage\TextConflictHelper::getEditFormHtmlBeforeContent ( )

Content to go in the edit form before textbox1.

See also
EditPage::$editFormTextBeforeContent
Returns
string HTML

Definition at line 295 of file TextConflictHelper.php.

Referenced by MediaWiki\EditPage\EditPage\showEditForm().

◆ getExplainHeader()

MediaWiki\EditPage\TextConflictHelper::getExplainHeader ( )
Returns
string HTML

Definition at line 249 of file TextConflictHelper.php.

◆ getUserBucket()

MediaWiki\EditPage\TextConflictHelper::getUserBucket ( ?int  $userEdits)
protected

◆ incrementConflictStats()

MediaWiki\EditPage\TextConflictHelper::incrementConflictStats ( User  $user = null)

Record a user encountering an edit conflict.

Parameters
User | null$user

Definition at line 139 of file TextConflictHelper.php.

References MediaWiki\EditPage\TextConflictHelper\getUserBucket(), NS_CATEGORY_TALK, and NS_MAIN.

◆ incrementResolvedStats()

MediaWiki\EditPage\TextConflictHelper::incrementResolvedStats ( User  $user = null)

Record when a user has resolved an edit conflict.

Parameters
User | null$user

Definition at line 177 of file TextConflictHelper.php.

References MediaWiki\EditPage\TextConflictHelper\getUserBucket(), NS_CATEGORY_TALK, and NS_MAIN.

◆ incrementStatsByUserEdits()

MediaWiki\EditPage\TextConflictHelper::incrementStatsByUserEdits (   $userEdits,
  $keyPrefixBase 
)
protected

Retained temporarily for backwards-compatibility.

This action should be moved into incrementConflictStats, incrementResolvedStats.

Deprecated:
since 1.42, do not use
Parameters
int | null$userEdits
string$keyPrefixBase

Definition at line 222 of file TextConflictHelper.php.

References MediaWiki\EditPage\TextConflictHelper\getUserBucket().

◆ setContentFormat()

MediaWiki\EditPage\TextConflictHelper::setContentFormat (   $contentFormat)
Parameters
string$contentFormat

Definition at line 131 of file TextConflictHelper.php.

References MediaWiki\EditPage\TextConflictHelper\$contentFormat.

Referenced by MediaWiki\EditPage\EditPage\showEditForm().

◆ setContentModel()

MediaWiki\EditPage\TextConflictHelper::setContentModel (   $contentModel)
Parameters
string$contentModel

Definition at line 124 of file TextConflictHelper.php.

References MediaWiki\EditPage\TextConflictHelper\$contentModel.

Referenced by MediaWiki\EditPage\EditPage\showEditForm().

◆ setTextboxes()

MediaWiki\EditPage\TextConflictHelper::setTextboxes (   $yourtext,
  $storedversion 
)
Parameters
string$yourtext
string$storedversion

Definition at line 116 of file TextConflictHelper.php.

References MediaWiki\EditPage\TextConflictHelper\$storedversion, and MediaWiki\EditPage\TextConflictHelper\$yourtext.

Referenced by MediaWiki\EditPage\EditPage\showEditForm().

◆ showEditFormTextAfterFooters()

MediaWiki\EditPage\TextConflictHelper::showEditFormTextAfterFooters ( )

Content to go in the edit form after the footers (templates on this page, hidden categories, limit report)

Definition at line 313 of file TextConflictHelper.php.

Member Data Documentation

◆ $contentFormat

null string MediaWiki\EditPage\TextConflictHelper::$contentFormat

◆ $contentModel

null string MediaWiki\EditPage\TextConflictHelper::$contentModel

◆ $out

OutputPage MediaWiki\EditPage\TextConflictHelper::$out
protected

◆ $stats

IBufferingStatsdDataFactory StatsFactory MediaWiki\EditPage\TextConflictHelper::$stats
protected

◆ $storedversion

string MediaWiki\EditPage\TextConflictHelper::$storedversion = ''
protected

◆ $submitLabel

string MediaWiki\EditPage\TextConflictHelper::$submitLabel
protected

Message key for submit button's label.

Definition at line 70 of file TextConflictHelper.php.

Referenced by MediaWiki\EditPage\TextConflictHelper\__construct().

◆ $title

Title MediaWiki\EditPage\TextConflictHelper::$title
protected

◆ $yourtext

string MediaWiki\EditPage\TextConflictHelper::$yourtext = ''
protected

The documentation for this class was generated from the following file: