MediaWiki
1.23.2
|
Module of static functions for generating XML. More...
Static Public Member Functions | |
static | attrib ( $name, $present=true) |
Internal function for use in checkboxes and radio buttons and such. More... | |
static | buildForm ( $fields, $submitLabel=null, $submitAttribs=array()) |
Generate a form (without the opening form element). More... | |
static | buildTable ( $rows, $attribs=array(), $headers=null) |
Build a table of data. More... | |
static | buildTableRow ( $attribs, $cells) |
Build a row for a table. More... | |
static | check ( $name, $checked=false, $attribs=array()) |
Convenience function to build an HTML checkbox. More... | |
static | checkLabel ( $label, $name, $id, $checked=false, $attribs=array()) |
Convenience function to build an HTML checkbox with a label. More... | |
static | closeElement ( $element) |
Shortcut to close an XML element. More... | |
static | dateMenu ( $year, $month) |
static | element ( $element, $attribs=null, $contents='', $allowShortTag=true) |
Format an XML element with given attributes and, optionally, text content. More... | |
static | elementClean ( $element, $attribs=array(), $contents='') |
Format an XML element as with self::element(), but run text through the $wgContLang->normalize() validator first to ensure that no invalid UTF-8 is passed. More... | |
static | encodeJsCall ( $name, $args, $pretty=false) |
Create a call to a JavaScript function. More... | |
static | encodeJsVar ( $value, $pretty=false) |
Encode a variable of arbitrary type to JavaScript. More... | |
static | escapeJsString ( $string) |
Returns an escaped string suitable for inclusion in a string literal for JavaScript source code. More... | |
static | escapeTagsOnly ( $in) |
Replace " > and < with their respective HTML entities ( ", >, <) More... | |
static | expandAttributes ( $attribs) |
Given an array of ('attributename' => 'value'), it generates the code to set the XML attributes : attributename="value". More... | |
static | fieldset ( $legend=false, $content=false, $attribs=array()) |
Shortcut for creating fieldsets. More... | |
static | input ( $name, $size=false, $value=false, $attribs=array()) |
Convenience function to build an HTML text input field. More... | |
static | inputLabel ( $label, $name, $id, $size=false, $value=false, $attribs=array()) |
Convenience function to build an HTML text input field with a label. More... | |
static | inputLabelSep ( $label, $name, $id, $size=false, $value=false, $attribs=array()) |
Same as Xml::inputLabel() but return input and label in an array. More... | |
static | isWellFormed ( $text) |
Check if a string is well-formed XML. More... | |
static | isWellFormedXmlFragment ( $text) |
Check if a string is a well-formed XML fragment. More... | |
static | label ( $label, $id, $attribs=array()) |
Convenience function to build an HTML form label. More... | |
static | languageSelector ( $selected, $customisedOnly=true, $inLanguage=null, $overrideAttrs=array(), Message $msg=null) |
Construct a language selector appropriate for use in a form or preferences. More... | |
static | listDropDown ( $name='', $list='', $other='', $selected='', $class='', $tabindex=null) |
Build a drop-down box from a textual list. More... | |
static | monthSelector ( $selected='', $allmonths=null, $id='month') |
Create a date selector. More... | |
static | namespaceSelector ( $selected='', $all=null, $element_name='namespace', $label=null) |
Build a drop-down box for selecting a namespace. More... | |
static | openElement ( $element, $attribs=null) |
This opens an XML element. More... | |
static | option ( $text, $value=null, $selected=false, $attribs=array()) |
Convenience function to build an HTML drop-down list item. More... | |
static | password ( $name, $size=false, $value=false, $attribs=array()) |
Convenience function to build an HTML password input field. More... | |
static | radio ( $name, $value, $checked=false, $attribs=array()) |
Convenience function to build an HTML radio button. More... | |
static | radioLabel ( $label, $name, $value, $id, $checked=false, $attribs=array()) |
Convenience function to build an HTML radio button with a label. More... | |
static | span ( $text, $class, $attribs=array()) |
Shortcut to make a span element. More... | |
static | submitButton ( $value, $attribs=array()) |
Convenience function to build an HTML submit button. More... | |
static | tags ( $element, $attribs=null, $contents) |
Same as Xml::element(), but does not escape contents. More... | |
static | textarea ( $name, $content, $cols=40, $rows=5, $attribs=array()) |
Shortcut for creating textareas. More... | |
static | wrapClass ( $text, $class, $tag='span', $attribs=array()) |
Shortcut to make a specific element with a class attribute. More... | |
|
static |
|
static |
Generate a form (without the opening form element).
Output optionally includes a submit button.
array | $fields | Associative array, key is the name of a message that contains a description for the field, value is an HTML string containing the appropriate input. |
string | $submitLabel | The name of a message containing a label for the submit button. |
array | $submitAttribs | The attributes to add to the submit button |
Definition at line 748 of file Xml.php.
Referenced by ImageListPager\getForm().
|
static |
|
static |
Convenience function to build an HTML checkbox.
string | $name | value of the name attribute |
bool | $checked | Whether the checkbox is checked or not |
array | $attribs | other attributes |
Definition at line 339 of file Xml.php.
References $attribs, $name, array(), and element().
Referenced by checkLabel(), SpecialUndelete\formatFileRow(), HTMLMultiSelectField\formatOptions(), SpecialUndelete\formatRevisionRow(), WebInstaller\getCheckBox(), SpecialRecentChangesLinked\getExtraOptions(), HTMLCheckField\getInputHTML(), HTMLCheckMatrix\getInputHTML(), LogEventsList\getShowHideLinks(), HistoryPager\historyLine(), and MovePageForm\showForm().
Convenience function to build an HTML checkbox with a label.
$label | |
$name | |
$id | |
$checked | bool |
$attribs | array |
Definition at line 433 of file Xml.php.
References $attribs, $name, array(), check(), and label().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), ProtectionForm\buildForm(), SpecialRecentChanges\categoryFilterForm(), Article\confirmDelete(), SpecialWatchlist\doHeader(), SpecialExport\execute(), SpecialNewpages\form(), SpecialProtectedpages\getCascadeCheck(), SpecialProtectedpages\getExpiryCheck(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), SpecialProtectedpages\getRedirectCheck(), LogEventsList\getTitlePattern(), UserrightsPage\groupCheckboxes(), SpecialExpandTemplates\makeForm(), SpecialRecentChanges\namespaceFilterForm(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), HistoryAction\onView(), SpecialSearch\powerSearchBox(), MovePageForm\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), and SpecialUndelete\showHistory().
|
static |
Shortcut to close an XML element.
string | $element | element name |
Definition at line 118 of file Xml.php.
Referenced by AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), ProtectionForm\buildSelector(), Article\confirmDelete(), SpecialRecentChanges\doHeader(), SpecialWatchlist\doHeader(), SpecialStatistics\execute(), SpecialExport\execute(), SpecialListGroupRights\execute(), MIMEsearchPage\execute(), QueryPage\execute(), fieldset(), SpecialNewpages\form(), SpecialStatistics\formatRowHeader(), SpecialSearch\formHeader(), SpecialStatistics\getEditStats(), SpecialVersion\getExtensionCredits(), SpecialStatistics\getMostViewedPages(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), SpecialStatistics\getPageStats(), MysqlInstaller\getSettingsForm(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), UserrightsPage\groupCheckboxes(), listDropDown(), SpecialWhatLinksHere\listEnd(), SpecialExpandTemplates\makeForm(), ChangesListSpecialPage\makeLegend(), monthSelector(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), ImagePage\openShowImage(), SpecialListGroupRights\outputNamespaceProtectionInfo(), SpecialSearch\powerSearchBox(), SpecialWatchlist\setTopText(), SpecialAllpages\showChunk(), UserrightsPage\showEditUserGroupsForm(), MovePageForm\showForm(), SpecialChangeEmail\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), SpecialWhatLinksHere\showIndirectLinks(), SpecialMergeHistory\showMergeForm(), SpecialProtectedpages\showOptions(), SpecialPrefixindex\showPrefixChunk(), SpecialSearch\showResults(), SpecialUndelete\showRevision(), SpecialUndelete\showSearchForm(), SpecialAllpages\showToplevel(), SpecialVersion\softwareInformation(), XmlTest\testCloseElement(), SpecialEmailUser\userForm(), ImagePage\view(), and SpecialWhatLinksHere\whatlinkshereForm().
|
static |
$year | Integer |
$month | Integer |
Definition at line 188 of file Xml.php.
References $timestamp, array(), MWTimestamp\getInstance(), Html\input(), label(), monthSelector(), text, and wfMessage().
Referenced by HistoryAction\onView(), LogEventsList\showOptions(), and XmlTest\testDateMenu().
|
static |
Format an XML element with given attributes and, optionally, text content.
Element and attribute names are assumed to be ready for literal inclusion. Strings are assumed to not contain XML-illegal characters; special characters (<, >, &) are escaped but illegals are not touched.
string | $element | element name |
array | $attribs | Name=>value pairs. Values will be escaped. |
string | $contents | NULL to make an open tag only; '' for a contentless closed tag (default) |
bool | $allowShortTag | whether '' in $contents will result in a contentless closed tag |
Definition at line 39 of file Xml.php.
References $attribs, $out, and expandAttributes().
Referenced by ProtectionForm\buildForm(), ChangeTags\buildTagFilterSelector(), XmlDumpWriter\caseSetting(), check(), TextPassDumper\clearOpenElement(), Article\confirmDelete(), Preferences\datetimePreferences(), Article\delete(), HistoryPager\diffButtons(), Article\doDelete(), SpecialTags\doTagRow(), elementClean(), escapeJsString(), SpecialExport\execute(), SpecialListGroupRights\execute(), MIMEsearchPage\execute(), fieldset(), SpecialStatistics\formatRow(), ImageListPager\formatValue(), SpecialSearch\formHeader(), XmlDumpWriter\generator(), SpecialVersion\getExtensionCredits(), SpecialVersion\getMediaWikiCredits(), Skin\getNewtalks(), UserrightsPage\groupCheckboxes(), XmlDumpWriter\homelink(), input(), ChangesList\insertDateHeader(), label(), ChangesListSpecialPage\makeLegend(), OutputPage\makeResourceLoaderLink(), SpecialSearch\makeSearchLink(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), XmlDumpWriter\namespaces(), XmlDumpWriter\openPage(), XmlDumpWriter\openStream(), Licenses\outputOption(), SpecialSearch\powerSearchBox(), radio(), EnhancedChangesList\recentChangesLine(), UserrightsPage\showEditUserGroupsForm(), MovePageForm\showForm(), FileDeleteForm\showForm(), SpecialUndelete\showHistory(), ProtectionForm\showLogExtract(), MovePageForm\showLogFragment(), UserrightsPage\showLogFragment(), SpecialMergeHistory\showMergeForm(), SpecialProtectedpages\showOptions(), SpecialProtectedtitles\showOptions(), SpecialSearch\showResults(), SpecialUndelete\showRevision(), XmlDumpWriter\sitename(), SpecialVersion\softwareInformation(), span(), XmlTest\testElementAttributes(), XmlTest\testElementEmpty(), XmlTest\testElementEscaping(), XmlTest\testElementOpen(), textarea(), ThumbnailImage\toHtml(), Preferences\validateSignature(), ImagePage\view(), XmlDumpWriter\writeContributor(), XmlDumpWriter\writeLogItem(), XmlDumpWriter\writeRevision(), XmlDumpWriter\writeTimestamp(), and XmlDumpWriter\writeUpload().
|
static |
Format an XML element as with self::element(), but run text through the $wgContLang->normalize() validator first to ensure that no invalid UTF-8 is passed.
$element | String: | |
array | $attribs | Name=>value pairs. Values will be escaped. |
string | $contents | NULL to make an open tag only; '' for a contentless closed tag (default) |
Definition at line 89 of file Xml.php.
References $attribs, $wgContLang, array(), element(), global, wfProfileIn(), and wfProfileOut().
Referenced by XmlDumpWriter\openPage(), XmlDumpWriter\writeContributor(), XmlDumpWriter\writeLogItem(), XmlDumpWriter\writeRevision(), and XmlDumpWriter\writeUpload().
|
static |
Create a call to a JavaScript function.
The supplied arguments will be encoded using Xml::encodeJsVar().
string | $name | The name of the function to call, or a JavaScript expression which evaluates to a function object which is called. |
array | $args | The arguments to pass to the function. |
bool | $pretty | If true, add non-significant whitespace to improve readability. |
Definition at line 665 of file Xml.php.
Referenced by ProtectionForm\buildCleanupScript(), OutputPage\getHeadScripts(), ResourceLoaderUserTokensModule\getScript(), ResourceLoaderUserOptionsModule\getScript(), ResourceLoaderLanguageDataModule\getScript(), ResourceLoaderStartUpModule\getScript(), OutputPage\getScriptsForBottomQueue(), ResourceLoader\makeConfigSetScript(), ResourceLoader\makeCustomLoaderScript(), ResourceLoader\makeLoaderImplementScript(), ResourceLoader\makeLoaderRegisterScript(), ResourceLoader\makeLoaderSourcesScript(), ResourceLoader\makeLoaderStateScript(), ResourceLoader\makeMessageSetScript(), and OutputPage\makeResourceLoaderLink().
|
static |
Encode a variable of arbitrary type to JavaScript.
If the value is an XmlJsCode object, pass through the object's value verbatim.
mixed | $value | The value being encoded. Can be any type except a resource. |
bool | $pretty | If true, add non-significant whitespace to improve readability. |
Definition at line 647 of file Xml.php.
Referenced by XmlTest\testEncodeJsVarArray(), XmlTest\testEncodeJsVarBoolean(), XmlTest\testEncodeJsVarFloat(), XmlTest\testEncodeJsVarFloatString(), XmlTest\testEncodeJsVarInt(), XmlTest\testEncodeJsVarIntString(), XmlTest\testEncodeJsVarNull(), XmlTest\testEncodeJsVarObject(), and ResourceLoaderModule\validateScriptFile().
|
static |
Returns an escaped string suitable for inclusion in a string literal for JavaScript source code.
Illegal control characters are assumed not to be present.
string | $string | to escape |
Definition at line 609 of file Xml.php.
References array(), element(), https, of, section, and so().
Referenced by XmlTest\testEscapeJsStringSpecialChars().
|
static |
Replace " > and < with their respective HTML entities ( ", >, <)
string | $in | text that might contain HTML tags. |
Definition at line 733 of file Xml.php.
Referenced by CoreTagHooks\nowiki(), CoreTagHooks\pre(), and XmlTest\testEscapeTagsOnly().
|
static |
Given an array of ('attributename' => 'value'), it generates the code to set the XML attributes : attributename="value".
The values are passed to Sanitizer::encodeAttribute. Return null if no attributes given.
array | $attribs | of attributes for an XML element |
MWException |
Definition at line 65 of file Xml.php.
References $attribs, $name, $out, as, and Sanitizer\encodeAttribute().
Referenced by element(), VectorTemplate\execute(), openElement(), XmlTest\testExpandAttributes(), XmlTest\testExpandAttributesException(), and Linker\tooltip().
Shortcut for creating fieldsets.
string | bool | $legend | Legend of the fieldset. If evaluates to false, legend is not added. |
string | $content | Pre-escaped content for the fieldset. If false, only open fieldset is returned. |
array | $attribs | Any attributes to fieldset-element. |
Definition at line 563 of file Xml.php.
References $attribs, $s, closeElement(), element(), and openElement().
Referenced by AllmessagesTablePager\buildForm(), HTMLForm\displaySection(), SpecialRecentChanges\doHeader(), SpecialNewpages\form(), SpecialWhatLinksHere\getFilterPanel(), ImageListPager\getForm(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), CategoryPager\getStartForm(), HistoryAction\onView(), SpecialWatchlist\setTopText(), SpecialChangeEmail\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialUndelete\showHistory(), LogEventsList\showOptions(), SpecialUndelete\showSearchForm(), UserrightsPage\switchForm(), SpecialWhatLinksHere\whatlinkshereForm(), and HTMLForm\wrapForm().
Convenience function to build an HTML text input field.
string | $name | value of the name attribute |
int | $size | value of the size attribute |
$value | mixed value of the value attribute | |
array | $attribs | other attributes |
Definition at line 294 of file Xml.php.
References $attribs, $name, $size, $value, array(), and element().
Referenced by AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), ChangeTags\buildTagFilterSelector(), SpecialNewpages\form(), SpecialRecentChangesLinked\getExtraOptions(), SpecialProtectedpages\getSizeLimit(), WebInstaller\getTextBox(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), password(), UserrightsPage\showEditUserGroupsForm(), MovePageForm\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), SpecialMergeHistory\showMergeForm(), SpecialUndelete\showSearchForm(), and XmlTest\testElementInputCanHaveAValueOfZero().
|
static |
Convenience function to build an HTML text input field with a label.
string | $label | text of the label |
string | $name | value of the name attribute |
string | $id | id of the input |
int | Bool | $size | value of the size attribute |
string | Bool | $value | value of the value attribute |
array | $attribs | other attributes |
Definition at line 398 of file Xml.php.
References $attribs, $name, $size, $value, inputLabelSep(), and list.
Referenced by SpecialExport\execute(), LinkSearchPage\execute(), FileDuplicateSearchPage\execute(), MIMEsearchPage\execute(), LogEventsList\getExtraInputs(), WithoutInterwikiPage\getPageHeader(), ActiveUsersPager\getPageHeader(), CategoryPager\getStartForm(), LogEventsList\getTitleInput(), LogEventsList\getUserInput(), SpecialBookSources\makeForm(), SpecialExpandTemplates\makeForm(), UserrightsPage\switchForm(), SpecialEmailUser\userForm(), and SpecialWhatLinksHere\whatlinkshereForm().
|
static |
Same as Xml::inputLabel() but return input and label in an array.
$label | String |
$name | String |
$id | String |
$size | Int|Bool |
$value | String|Bool |
$attribs | array |
Definition at line 415 of file Xml.php.
References $attribs, $name, $size, $value, array(), and label().
Referenced by SpecialRecentChanges\categoryFilterForm(), and inputLabel().
|
static |
|
static |
|
static |
Convenience function to build an HTML form label.
string | $label | text of the label |
$id | ||
array | $attribs | an attribute array. This will usually be the same array as is passed to the corresponding input element, so this function will cherry-pick appropriate attributes to apply to the label as well; only class and title are applied. |
Definition at line 374 of file Xml.php.
References $attribs, array(), and element().
Referenced by AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), checkLabel(), Article\confirmDelete(), dateMenu(), SpecialNewpages\form(), SpecialRecentChangesLinked\getExtraOptions(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), UsersPager\getPageHeader(), SpecialProtectedpages\getSizeLimit(), SpecialProtectedpages\getTypeMenu(), inputLabelSep(), languageSelector(), SpecialExpandTemplates\makeForm(), SpecialRecentChanges\namespaceFilterForm(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), SpecialChangeEmail\pretty(), radioLabel(), UserrightsPage\showEditUserGroupsForm(), MovePageForm\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), SpecialMergeHistory\showMergeForm(), XmlTest\testLabelAttributeCanOnlyBeClassOrTitle(), and XmlTest\testLabelCreation().
|
static |
Construct a language selector appropriate for use in a form or preferences.
string | $selected | The language code of the selected language |
boolean | $customisedOnly | If true only languages which have some content are listed |
string | $inLanguage | The ISO code of the language to display the select list in (optional) |
array | $overrideAttrs | Override the attributes of the select tag (since 1.20) |
Message | null | $msg | Label message key (since 1.20) |
Definition at line 225 of file Xml.php.
References $languages, $name, $options, array(), as, Language\fetchLanguageNames(), global, label(), option(), tags(), and wfMessage().
Referenced by AllmessagesTablePager\buildForm(), and XmlTest\testLanguageSelector().
|
static |
Build a drop-down box from a textual list.
$name | Mixed: Name and id for the drop-down |
$list | Mixed: Correctly formatted text (newline delimited) to be used to generate the options |
$other | Mixed: Text for the "Other reasons" option |
$selected | Mixed: Option which should be pre-selected |
$class | Mixed: CSS classes for the drop-down |
$tabindex | Mixed: Value of the tabindex attribute |
Definition at line 497 of file Xml.php.
References $attribs, $name, $options, $tabindex, $value, array(), as, closeElement(), openElement(), and option().
Referenced by ProtectionForm\buildForm(), Article\confirmDelete(), FileDeleteForm\showForm(), and SpecialRevisionDelete\showForm().
|
static |
Create a date selector.
$selected | Mixed: the month which should be selected, default '' | |
string | $allmonths | value of a special item denoting all month. Null to not include (default) |
string | $id | Element identifier |
Definition at line 166 of file Xml.php.
References $options, $wgLang, array(), closeElement(), global, openElement(), option(), text, and wfMessage().
Referenced by dateMenu().
|
static |
Build a drop-down box for selecting a namespace.
$selected | Mixed: Namespace which should be pre-selected | |
$all | Mixed: Value of an item denoting all namespaces, or null to omit | |
$element_name | String: value of the "name" attribute of the select tag | |
string | $label | optional label to add to the field |
Definition at line 145 of file Xml.php.
References array(), Html\namespaceSelector(), and wfDeprecated().
|
static |
This opens an XML element.
string | $element | name of the element |
array | $attribs | of attributes, see Xml::expandAttributes() |
Definition at line 109 of file Xml.php.
References $attribs, and expandAttributes().
Referenced by AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), ProtectionForm\buildSelector(), Article\confirmDelete(), SpecialRecentChanges\doHeader(), SpecialStatistics\execute(), SpecialExport\execute(), SpecialListGroupRights\execute(), MIMEsearchPage\execute(), QueryPage\execute(), fieldset(), SpecialNewpages\form(), AllmessagesTablePager\formatRow(), SpecialStatistics\formatRowHeader(), SpecialSearch\formHeader(), SpecialStatistics\getEditStats(), SpecialVersion\getExtensionCredits(), SpecialStatistics\getMostViewedPages(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), SpecialStatistics\getPageStats(), MysqlInstaller\getSettingsForm(), AllmessagesTablePager\getStartBody(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), UserrightsPage\groupCheckboxes(), listDropDown(), SpecialWhatLinksHere\listItem(), SpecialWhatLinksHere\listStart(), SpecialExpandTemplates\makeForm(), ChangesListSpecialPage\makeLegend(), monthSelector(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), ImagePage\openShowImage(), SpecialListGroupRights\outputNamespaceProtectionInfo(), SpecialSearch\powerSearchBox(), CoreTagHooks\pre(), SpecialWatchlist\setTopText(), SpecialAllpages\showChunk(), UserrightsPage\showEditUserGroupsForm(), SpecialUndelete\showFileConfirmationForm(), MovePageForm\showForm(), SpecialChangeEmail\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), LogEventsList\showLogExtract(), SpecialMergeHistory\showMergeForm(), SpecialProtectedpages\showOptions(), SpecialPrefixindex\showPrefixChunk(), SpecialSearch\showResults(), SpecialUndelete\showRevision(), SpecialUndelete\showSearchForm(), SpecialAllpages\showToplevel(), SpecialVersion\softwareInformation(), tags(), XmlTest\testOpenElement(), TraditionalImageGallery\toHTML(), SpecialRevisionDelete\tryShowFile(), SpecialEmailUser\userForm(), ImagePage\view(), and SpecialWhatLinksHere\whatlinkshereForm().
Convenience function to build an HTML drop-down list item.
string | $text | text for this item. Will be HTML escaped |
string | $value | form submission value; if empty, use text |
$selected | boolean: if true, will be the default selected item | |
array | $attribs | optional additional HTML attributes |
Definition at line 475 of file Xml.php.
References $attribs, $value, and Html\element().
Referenced by ProtectionForm\buildForm(), ProtectionForm\buildSelector(), ImagePage\doRenderLangOpt(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), UsersPager\getPageHeader(), SpecialProtectedpages\getTypeMenu(), languageSelector(), listDropDown(), monthSelector(), ImagePage\openShowImage(), and SpecialImport\showForm().
Convenience function to build an HTML password input field.
string | $name | value of the name attribute |
int | $size | value of the size attribute |
$value | mixed value of the value attribute | |
array | $attribs | other attributes |
Definition at line 316 of file Xml.php.
References $attribs, $name, $size, $value, array(), and input().
Convenience function to build an HTML radio button.
string | $name | value of the name attribute |
string | $value | value of the value attribute |
bool | $checked | Whether the checkbox is checked or not |
array | $attribs | other attributes |
Definition at line 357 of file Xml.php.
References $attribs, $name, $value, array(), and element().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), HTMLRadioField\formatOptions(), SpecialMergeHistory\formatRevisionRow(), WebInstaller\getRadioSet(), and radioLabel().
Convenience function to build an HTML radio button with a label.
$label | |
$name | |
$value | |
$id | |
$checked | bool |
$attribs | array |
Definition at line 451 of file Xml.php.
References $attribs, $name, $value, array(), label(), and radio().
Referenced by AllmessagesTablePager\buildForm(), and SpecialProtectedpages\getSizeLimit().
|
static |
|
static |
Convenience function to build an HTML submit button.
string | $value | label text for the button |
array | $attribs | optional custom attributes |
Definition at line 463 of file Xml.php.
References $attribs, $value, array(), and Html\element().
Referenced by AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), Article\confirmDelete(), SpecialWatchlist\doHeader(), ImagePage\doRenderLangOpt(), SpecialExport\execute(), LinkSearchPage\execute(), FileDuplicateSearchPage\execute(), MIMEsearchPage\execute(), SpecialNewpages\form(), HTMLForm\getButtons(), WithoutInterwikiPage\getPageHeader(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), CategoryPager\getStartForm(), SpecialBookSources\makeForm(), SpecialExpandTemplates\makeForm(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), HistoryAction\onView(), ImagePage\openShowImage(), SpecialWatchlist\setTopText(), SpecialSearch\shortDialog(), UserrightsPage\showEditUserGroupsForm(), SpecialUndelete\showFileConfirmationForm(), MovePageForm\showForm(), SpecialChangeEmail\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), SpecialMergeHistory\showMergeForm(), LogEventsList\showOptions(), SpecialProtectedpages\showOptions(), SpecialProtectedtitles\showOptions(), EmailConfirmation\showRequestForm(), SpecialUndelete\showSearchForm(), HistoryPager\submitButton(), UserrightsPage\switchForm(), SpecialRevisionDelete\tryShowFile(), SpecialEmailUser\userForm(), and SpecialWhatLinksHere\whatlinkshereForm().
|
static |
Same as Xml::element(), but does not escape contents.
Handy when the content you have is already valid xml.
string | $element | element name |
array | $attribs | of attributes |
string | $contents | content of the element |
Definition at line 131 of file Xml.php.
References $attribs, and openElement().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), ProtectionForm\buildForm(), ChangeTags\buildTagFilterSelector(), ImportReporter\close(), Article\confirmDelete(), SpecialRecentChanges\doHeader(), SpecialTags\doTagRow(), SpecialTags\execute(), SpecialUndelete\formatRevisionRow(), AllmessagesTablePager\formatRow(), SpecialStatistics\formatRowHeader(), ChangeTags\formatSummaryRow(), SpecialSearch\formHeader(), PreferencesForm\getButtons(), SpecialStatistics\getEditStats(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), SpecialStatistics\getMostViewedPages(), SpecialStatistics\getPageStats(), WebInstaller\getRadioSet(), CategoryPager\getStartForm(), SpecialProtectedpages\getTypeMenu(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), UserrightsPage\groupCheckboxes(), HistoryPager\historyLine(), WebInstaller\label(), languageSelector(), MediaTransformOutput\linkWrap(), SpecialWhatLinksHere\listItem(), ChangesListSpecialPage\makeLegend(), ImagePage\openShowImage(), SpecialSearch\powerSearchBox(), Linker\revDeleteLink(), Linker\revDeleteLinkDisabled(), UserrightsPage\showEditUserGroupsForm(), MovePageForm\showForm(), SpecialRevisionDelete\showForm(), LogEventsList\showOptions(), wrapClass(), PreferencesForm\wrapForm(), and TableDiffFormatter\wrapLine().
|
static |
Shortcut for creating textareas.
string | $name | The 'name' for the textarea |
string | $content | Content for the textarea |
int | $cols | The number of columns for the textarea |
int | $rows | The number of rows for the textarea |
array | $attribs | Any other attributes for the textarea |
Definition at line 589 of file Xml.php.
References $attribs, $name, array(), and element().
Referenced by WebInstaller\getTextArea(), SpecialExpandTemplates\makeForm(), SpecialExpandTemplates\makeOutput(), XmlTest\testTextareaAttribs(), and XmlTest\testTextareaNoContent().
Shortcut to make a specific element with a class attribute.
string | $text | content of the element, will be escaped |
string | $class | class name of the span element |
string | $tag | element name |
array | $attribs | other attributes |
Definition at line 282 of file Xml.php.
References $attribs, array(), and tags().
Referenced by SpecialWhatLinksHere\listItem().