MediaWiki REL1_34
InputBox Class Reference

InputBox class. More...

Public Member Functions

 __construct ( $parser)
 
 extractOptions ( $text)
 Extract options from a blob of text.
 
 getCommentForm ()
 Generate new section form.
 
 getCreateForm ()
 Generate create page form.
 
 getMoveForm ()
 Generate move page form.
 
 getSearchForm ( $type)
 Generate search form.
 
 getSearchForm2 ()
 Generate search form version 2.
 
 isValidColor ( $color)
 Do a security check on the bgcolor parameter.
 
 render ()
 

Private Member Functions

 bgColorStyle ()
 
 getEditActionArgs ()
 Returns the action name and value to use in inputboxes which redirects to edit pages.
 
 getLinebreakClasses ()
 Get common classes, that could be added and depend on, if a line break between a button and an input field is added or not.
 
 languageConvert ( $text)
 For compatability with pre T119158 behaviour.
 
 shouldUseVE ()
 Returns true, if the VisualEditor is requested from the inputbox wikitext definition and if the VisualEditor extension is actually installed or not, false otherwise.
 

Private Attributes

 $mBGColor = 'transparent'
 
 $mBR = 'yes'
 
 $mButtonLabel = ''
 
 $mDefaultText = ''
 
 $mDir = ''
 
 $mEditIntro = null
 
 $mFullTextButton = ''
 
 $mHidden = ''
 
 $mID = ''
 
 $mInline = false
 
 $mLabelText = ''
 
 $mMinor = null
 
 $mNamespaces = ''
 
 $mNosummary = null
 
 $mPage = ''
 
 $mParser
 
 $mPlaceholderText = ''
 
 $mPrefix = ''
 
 $mPreload = null
 
 $mPreloadparams = null
 
 $mSearchButtonLabel = ''
 
 $mSearchFilter = ''
 
 $mSummary = null
 
 $mTour = ''
 
 $mType = ''
 
 $mUseVE = null
 
 $mWidth = 50
 

Detailed Description

InputBox class.

Definition at line 14 of file InputBox.php.

Constructor & Destructor Documentation

◆ __construct()

InputBox::__construct ( $parser)
Parameters
Parser$parser

Definition at line 51 of file InputBox.php.

Member Function Documentation

◆ bgColorStyle()

InputBox::bgColorStyle ( )
private

◆ extractOptions()

InputBox::extractOptions ( $text)

Extract options from a blob of text.

Parameters
string$textTag contents

Definition at line 595 of file InputBox.php.

References $line, isValidColor(), languageConvert(), and true.

◆ getCommentForm()

InputBox::getCommentForm ( )

Generate new section form.

Returns
string

Definition at line 525 of file InputBox.php.

References $mBR, $mDefaultText, $mDir, $mPlaceholderText, $mWidth, $wgScript, bgColorStyle(), getEditActionArgs(), getLinebreakClasses(), and wfMessage().

Referenced by render().

◆ getCreateForm()

InputBox::getCreateForm ( )

Generate create page form.

Returns
string

Definition at line 379 of file InputBox.php.

References $mBR, $mDefaultText, $mDir, $mPlaceholderText, $mWidth, $wgScript, bgColorStyle(), getEditActionArgs(), getLinebreakClasses(), and wfMessage().

Referenced by render().

◆ getEditActionArgs()

InputBox::getEditActionArgs ( )
private

Returns the action name and value to use in inputboxes which redirects to edit pages.

Decides, if the link should redirect to VE edit page (veaction=edit) or to wikitext editor (action=edit).

Returns
Array Array with name and value data

Definition at line 101 of file InputBox.php.

References $args, and shouldUseVE().

Referenced by getCommentForm(), and getCreateForm().

◆ getLinebreakClasses()

InputBox::getLinebreakClasses ( )
private

Get common classes, that could be added and depend on, if a line break between a button and an input field is added or not.

Returns
String

Definition at line 123 of file InputBox.php.

Referenced by getCommentForm(), getCreateForm(), getMoveForm(), and getSearchForm().

◆ getMoveForm()

InputBox::getMoveForm ( )

Generate move page form.

Returns
string

Definition at line 468 of file InputBox.php.

References $mBR, $mDefaultText, $mDir, $mPlaceholderText, $mWidth, $wgScript, bgColorStyle(), getLinebreakClasses(), and wfMessage().

Referenced by render().

◆ getSearchForm()

InputBox::getSearchForm ( $type)

Generate search form.

Parameters
string$type
Returns
string HTML

Definition at line 132 of file InputBox.php.

References $mBR, $mDefaultText, $mDir, $mPlaceholderText, $mWidth, $type, $wgNamespaceAliases, bgColorStyle(), getLinebreakClasses(), wfMessage(), and wfRandom().

Referenced by render().

◆ getSearchForm2()

InputBox::getSearchForm2 ( )

Generate search form version 2.

Returns
string

Definition at line 301 of file InputBox.php.

References $mDir, $mID, $mWidth, bgColorStyle(), wfMessage(), and wfRandom().

Referenced by render().

◆ isValidColor()

InputBox::isValidColor ( $color)

Do a security check on the bgcolor parameter.

Parameters
string$color
Returns
bool

Definition at line 679 of file InputBox.php.

Referenced by extractOptions().

◆ languageConvert()

InputBox::languageConvert ( $text)
private

For compatability with pre T119158 behaviour.

If a field that is going to be used as an attribute and it contains "-{" in it, run it through language converter.

Its not really clear if it would make more sense to always convert instead of only if -{ is present. This function just more or less restores the previous accidental behaviour.

See also
https://phabricator.wikimedia.org/T180485
Parameters
string$text
Returns
string

Definition at line 727 of file InputBox.php.

References $lang.

Referenced by extractOptions().

◆ render()

InputBox::render ( )

◆ shouldUseVE()

InputBox::shouldUseVE ( )
private

Returns true, if the VisualEditor is requested from the inputbox wikitext definition and if the VisualEditor extension is actually installed or not, false otherwise.

Returns
bool

Definition at line 707 of file InputBox.php.

Referenced by getEditActionArgs().

Member Data Documentation

◆ $mBGColor

InputBox::$mBGColor = 'transparent'
private

Definition at line 32 of file InputBox.php.

◆ $mBR

InputBox::$mBR = 'yes'
private

Definition at line 29 of file InputBox.php.

Referenced by getCommentForm(), getCreateForm(), getMoveForm(), and getSearchForm().

◆ $mButtonLabel

InputBox::$mButtonLabel = ''
private

Definition at line 33 of file InputBox.php.

◆ $mDefaultText

InputBox::$mDefaultText = ''
private

Definition at line 30 of file InputBox.php.

Referenced by getCommentForm(), getCreateForm(), getMoveForm(), and getSearchForm().

◆ $mDir

InputBox::$mDir = ''
private

◆ $mEditIntro

InputBox::$mEditIntro = null
private

Definition at line 23 of file InputBox.php.

◆ $mFullTextButton

InputBox::$mFullTextButton = ''
private

Definition at line 35 of file InputBox.php.

◆ $mHidden

InputBox::$mHidden = ''
private

Definition at line 37 of file InputBox.php.

◆ $mID

InputBox::$mID = ''
private

Definition at line 39 of file InputBox.php.

Referenced by getSearchForm2().

◆ $mInline

InputBox::$mInline = false
private

Definition at line 40 of file InputBox.php.

◆ $mLabelText

InputBox::$mLabelText = ''
private

Definition at line 36 of file InputBox.php.

◆ $mMinor

InputBox::$mMinor = null
private

Definition at line 27 of file InputBox.php.

◆ $mNamespaces

InputBox::$mNamespaces = ''
private

Definition at line 38 of file InputBox.php.

◆ $mNosummary

InputBox::$mNosummary = null
private

Definition at line 26 of file InputBox.php.

◆ $mPage

InputBox::$mPage = ''
private

Definition at line 28 of file InputBox.php.

◆ $mParser

InputBox::$mParser
private

Definition at line 18 of file InputBox.php.

◆ $mPlaceholderText

InputBox::$mPlaceholderText = ''
private

Definition at line 31 of file InputBox.php.

Referenced by getCommentForm(), getCreateForm(), getMoveForm(), and getSearchForm().

◆ $mPrefix

InputBox::$mPrefix = ''
private

Definition at line 41 of file InputBox.php.

◆ $mPreload

InputBox::$mPreload = null
private

Definition at line 21 of file InputBox.php.

◆ $mPreloadparams

InputBox::$mPreloadparams = null
private

Definition at line 22 of file InputBox.php.

◆ $mSearchButtonLabel

InputBox::$mSearchButtonLabel = ''
private

Definition at line 34 of file InputBox.php.

◆ $mSearchFilter

InputBox::$mSearchFilter = ''
private

Definition at line 43 of file InputBox.php.

◆ $mSummary

InputBox::$mSummary = null
private

Definition at line 25 of file InputBox.php.

◆ $mTour

InputBox::$mTour = ''
private

Definition at line 44 of file InputBox.php.

◆ $mType

InputBox::$mType = ''
private

Definition at line 19 of file InputBox.php.

◆ $mUseVE

InputBox::$mUseVE = null
private

Definition at line 24 of file InputBox.php.

◆ $mWidth

InputBox::$mWidth = 50
private

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