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, IBufferingStatsdDataFactory $stats, $submitLabel, ?IContentHandlerFactory $contentHandlerFactory=null)
 
 getEditConflictMainTextBox (array $customAttribs=[])
 HTML to build the textbox1 on edit conflicts. More...
 
 getEditFormHtmlAfterContent ()
 Content to go in the edit form after textbox1. More...
 
 getEditFormHtmlBeforeContent ()
 Content to go in the edit form before textbox1. More...
 
 getExplainHeader ()
 
 incrementConflictStats (User $user=null)
 Record a user encountering an edit conflict. More...
 
 incrementResolvedStats (User $user=null)
 Record when a user has resolved an edit conflict. More...
 
 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) More...
 

Public Attributes

null string $contentFormat
 
null string $contentModel
 

Protected Member Functions

 incrementStatsByUserEdits ( $userEdits, $keyPrefixBase)
 

Protected Attributes

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

Private Member Functions

 toEditContent ( $text)
 

Private Attributes

IContentHandlerFactory $contentHandlerFactory
 

Detailed Description

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

Since
1.31

Definition at line 44 of file TextConflictHelper.php.

Constructor & Destructor Documentation

◆ __construct()

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 222 of file TextConflictHelper.php.

References Html\textarea().

Referenced by 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 264 of file TextConflictHelper.php.

Referenced by 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 254 of file TextConflictHelper.php.

Referenced by EditPage\showEditForm().

◆ getExplainHeader()

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

Definition at line 208 of file TextConflictHelper.php.

References Html\rawElement().

◆ incrementConflictStats()

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

Record a user encountering an edit conflict.

Parameters
User | null$user

Definition at line 147 of file TextConflictHelper.php.

References MediaWiki\EditPage\TextConflictHelper\incrementStatsByUserEdits(), 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 167 of file TextConflictHelper.php.

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

◆ incrementStatsByUserEdits()

MediaWiki\EditPage\TextConflictHelper::incrementStatsByUserEdits (   $userEdits,
  $keyPrefixBase 
)
protected
Parameters
int | null$userEdits
string$keyPrefixBase

Definition at line 190 of file TextConflictHelper.php.

Referenced by MediaWiki\EditPage\TextConflictHelper\incrementConflictStats(), and MediaWiki\EditPage\TextConflictHelper\incrementResolvedStats().

◆ setContentFormat()

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

Definition at line 139 of file TextConflictHelper.php.

References MediaWiki\EditPage\TextConflictHelper\$contentFormat.

Referenced by EditPage\showEditForm().

◆ setContentModel()

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

Definition at line 132 of file TextConflictHelper.php.

References MediaWiki\EditPage\TextConflictHelper\$contentModel.

Referenced by EditPage\showEditForm().

◆ setTextboxes()

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

Definition at line 124 of file TextConflictHelper.php.

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

Referenced by 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 272 of file TextConflictHelper.php.

References Html\textarea(), and MediaWiki\EditPage\TextConflictHelper\toEditContent().

◆ toEditContent()

MediaWiki\EditPage\TextConflictHelper::toEditContent (   $text)
private
Parameters
string$text
Returns
Content

Definition at line 305 of file TextConflictHelper.php.

References ContentHandler\makeContent().

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

Member Data Documentation

◆ $contentFormat

null string MediaWiki\EditPage\TextConflictHelper::$contentFormat

◆ $contentHandlerFactory

IContentHandlerFactory MediaWiki\EditPage\TextConflictHelper::$contentHandlerFactory
private

◆ $contentModel

null string MediaWiki\EditPage\TextConflictHelper::$contentModel

◆ $out

OutputPage MediaWiki\EditPage\TextConflictHelper::$out
protected

◆ $stats

IBufferingStatsdDataFactory 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 74 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: