MediaWiki  1.33.0
InputBox Class Reference

InputBox class. More...

Public Member Functions

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

Private Member Functions

 bgColorStyle ()
 
 getEditActionArgs ()
 Returns the action name and value to use in inputboxes which redirects to edit pages. More...
 
 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. More...
 
 languageConvert ( $text)
 For compatability with pre T119158 behaviour. More...
 
 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. More...
 

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 12 of file InputBox.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 49 of file InputBox.php.

References $parser.

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 592 of file InputBox.php.

References $line, $name, $options, $value, as, isValidColor(), languageConvert(), list, and true.

◆ getCommentForm()

InputBox::getCommentForm ( )

Generate new section form.

Returns
string

Definition at line 522 of file InputBox.php.

References $mBR, $wgScript, as, bgColorStyle(), Xml\closeElement(), getEditActionArgs(), getLinebreakClasses(), Xml\openElement(), and wfMessage().

Referenced by render().

◆ getCreateForm()

InputBox::getCreateForm ( )

Generate create page form.

Returns
string

Definition at line 376 of file InputBox.php.

References $mBR, $wgScript, as, bgColorStyle(), Xml\closeElement(), getEditActionArgs(), getLinebreakClasses(), Xml\openElement(), 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 99 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 121 of file InputBox.php.

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

◆ getMoveForm()

InputBox::getMoveForm ( )

Generate move page form.

Returns
string

Definition at line 465 of file InputBox.php.

References $mBR, $wgScript, bgColorStyle(), Xml\closeElement(), getLinebreakClasses(), SpecialPage\getTitleFor(), Xml\openElement(), and wfMessage().

Referenced by render().

◆ getSearchForm()

InputBox::getSearchForm (   $type)

Generate search form.

Parameters
string$type
Returns
string HTML

Definition at line 130 of file InputBox.php.

References $mBR, $name, $namespaces, $type, $wgContLang, $wgNamespaceAliases, as, bgColorStyle(), Xml\closeElement(), captcha-old\count, Xml\element(), getLinebreakClasses(), SpecialPage\getTitleFor(), Xml\label(), Xml\openElement(), wfMessage(), and wfRandom().

Referenced by render().

◆ getSearchForm2()

InputBox::getSearchForm2 ( )

Generate search form version 2.

Returns
string

Definition at line 298 of file InputBox.php.

References $mID, bgColorStyle(), Xml\closeElement(), Xml\element(), SpecialPage\getTitleFor(), Xml\openElement(), 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 676 of file InputBox.php.

References a, color, and names.

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 724 of file InputBox.php.

References $lang, and false.

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 704 of file InputBox.php.

References ExtensionRegistry\getInstance().

Referenced by getEditActionArgs().

Member Data Documentation

◆ $mBGColor

InputBox::$mBGColor = 'transparent'
private

Definition at line 30 of file InputBox.php.

◆ $mBR

InputBox::$mBR = 'yes'
private

Definition at line 27 of file InputBox.php.

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

◆ $mButtonLabel

InputBox::$mButtonLabel = ''
private

Definition at line 31 of file InputBox.php.

◆ $mDefaultText

InputBox::$mDefaultText = ''
private

Definition at line 28 of file InputBox.php.

◆ $mDir

InputBox::$mDir = ''
private

Definition at line 40 of file InputBox.php.

◆ $mEditIntro

InputBox::$mEditIntro = null
private

Definition at line 21 of file InputBox.php.

◆ $mFullTextButton

InputBox::$mFullTextButton = ''
private

Definition at line 33 of file InputBox.php.

◆ $mHidden

InputBox::$mHidden = ''
private

Definition at line 35 of file InputBox.php.

◆ $mID

InputBox::$mID = ''
private

Definition at line 37 of file InputBox.php.

Referenced by getSearchForm2().

◆ $mInline

InputBox::$mInline = false
private

Definition at line 38 of file InputBox.php.

◆ $mLabelText

InputBox::$mLabelText = ''
private

Definition at line 34 of file InputBox.php.

◆ $mMinor

InputBox::$mMinor = null
private

Definition at line 25 of file InputBox.php.

◆ $mNamespaces

InputBox::$mNamespaces = ''
private

Definition at line 36 of file InputBox.php.

◆ $mNosummary

InputBox::$mNosummary = null
private

Definition at line 24 of file InputBox.php.

◆ $mPage

InputBox::$mPage = ''
private

Definition at line 26 of file InputBox.php.

◆ $mParser

InputBox::$mParser
private

Definition at line 16 of file InputBox.php.

◆ $mPlaceholderText

InputBox::$mPlaceholderText = ''
private

Definition at line 29 of file InputBox.php.

◆ $mPrefix

InputBox::$mPrefix = ''
private

Definition at line 39 of file InputBox.php.

◆ $mPreload

InputBox::$mPreload = null
private

Definition at line 19 of file InputBox.php.

◆ $mPreloadparams

InputBox::$mPreloadparams = null
private

Definition at line 20 of file InputBox.php.

◆ $mSearchButtonLabel

InputBox::$mSearchButtonLabel = ''
private

Definition at line 32 of file InputBox.php.

◆ $mSearchFilter

InputBox::$mSearchFilter = ''
private

Definition at line 41 of file InputBox.php.

◆ $mSummary

InputBox::$mSummary = null
private

Definition at line 23 of file InputBox.php.

◆ $mTour

InputBox::$mTour = ''
private

Definition at line 42 of file InputBox.php.

◆ $mType

InputBox::$mType = ''
private

Definition at line 17 of file InputBox.php.

◆ $mUseVE

InputBox::$mUseVE = null
private

Definition at line 22 of file InputBox.php.

◆ $mWidth

InputBox::$mWidth = 50
private

Definition at line 18 of file InputBox.php.


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