MediaWiki REL1_28
|
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. | |
static | buildForm ( $fields, $submitLabel=null, $submitAttribs=[]) |
Generate a form (without the opening form element). | |
static | buildTable ( $rows, $attribs=[], $headers=null) |
Build a table of data. | |
static | buildTableRow ( $attribs, $cells) |
Build a row for a table. | |
static | check ( $name, $checked=false, $attribs=[]) |
Convenience function to build an HTML checkbox. | |
static | checkLabel ( $label, $name, $id, $checked=false, $attribs=[]) |
Convenience function to build an HTML checkbox with a label. | |
static | closeElement ( $element) |
Shortcut to close an XML element. | |
static | dateMenu ( $year, $month) |
static | element ( $element, $attribs=null, $contents='', $allowShortTag=true) |
Format an XML element with given attributes and, optionally, text content. | |
static | elementClean ( $element, $attribs=[], $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. | |
static | encodeJsCall ( $name, $args, $pretty=false) |
Create a call to a JavaScript function. | |
static | encodeJsVar ( $value, $pretty=false) |
Encode a variable of arbitrary type to JavaScript. | |
static | escapeJsString ( $string) |
Returns an escaped string suitable for inclusion in a string literal for JavaScript source code. | |
static | escapeTagsOnly ( $in) |
Replace " > and < with their respective HTML entities ( ", >, <) | |
static | expandAttributes ( $attribs) |
Given an array of ('attributename' => 'value'), it generates the code to set the XML attributes : attributename="value". | |
static | fieldset ( $legend=false, $content=false, $attribs=[]) |
Shortcut for creating fieldsets. | |
static | input ( $name, $size=false, $value=false, $attribs=[]) |
Convenience function to build an HTML text input field. | |
static | inputLabel ( $label, $name, $id, $size=false, $value=false, $attribs=[]) |
Convenience function to build an HTML text input field with a label. | |
static | inputLabelSep ( $label, $name, $id, $size=false, $value=false, $attribs=[]) |
Same as Xml::inputLabel() but return input and label in an array. | |
static | isWellFormedXmlFragment ( $text) |
Check if a string is a well-formed XML fragment. | |
static | label ( $label, $id, $attribs=[]) |
Convenience function to build an HTML form label. | |
static | languageSelector ( $selected, $customisedOnly=true, $inLanguage=null, $overrideAttrs=[], Message $msg=null) |
Construct a language selector appropriate for use in a form or preferences. | |
static | listDropDown ( $name='', $list='', $other='', $selected='', $class='', $tabindex=null) |
Build a drop-down box from a textual list. | |
static | monthSelector ( $selected='', $allmonths=null, $id='month') |
Create a date selector. | |
static | openElement ( $element, $attribs=null) |
This opens an XML element. | |
static | option ( $text, $value=null, $selected=false, $attribs=[]) |
Convenience function to build an HTML drop-down list item. | |
static | password ( $name, $size=false, $value=false, $attribs=[]) |
Convenience function to build an HTML password input field. | |
static | radio ( $name, $value, $checked=false, $attribs=[]) |
Convenience function to build an HTML radio button. | |
static | radioLabel ( $label, $name, $value, $id, $checked=false, $attribs=[]) |
Convenience function to build an HTML radio button with a label. | |
static | span ( $text, $class, $attribs=[]) |
Shortcut to make a span element. | |
static | submitButton ( $value, $attribs=[]) |
Convenience function to build an HTML submit button When $wgUseMediaWikiUIEverywhere is true it will default to a progressive button. | |
static | tags ( $element, $attribs=null, $contents) |
Same as Xml::element(), but does not escape contents. | |
static | textarea ( $name, $content, $cols=40, $rows=5, $attribs=[]) |
Shortcut for creating textareas. | |
static | wrapClass ( $text, $class, $tag='span', $attribs=[]) |
Shortcut to make a specific element with a class attribute. | |
Static Private Member Functions | |
static | isWellFormed ( $text) |
Check if a string is well-formed XML. | |
|
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 770 of file Xml.php.
References as, closeElement(), openElement(), submitButton(), tags(), text, and wfMessage().
|
static |
Build a table of data.
array | $rows | An array of arrays of strings, each to be a row in a table |
array | $attribs | An array of attributes to apply to the table tag [optional] |
array | $headers | An array of strings to use as table headers [optional] |
Definition at line 809 of file Xml.php.
References $attribs, $header, $s, as, buildTableRow(), closeElement(), element(), and openElement().
|
static |
Build a row for a table.
array | $attribs | An array of attributes to apply to the tr tag |
array | $cells | An array of strings to put in |
Definition at line 848 of file Xml.php.
References $attribs, $s, as, closeElement(), element(), and openElement().
Referenced by buildTable().
|
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 | Array other attributes |
Definition at line 324 of file Xml.php.
References $attribs, $name, and element().
Referenced by SpecialUndelete\formatFileRow(), SpecialUndelete\formatRevisionRow(), WebInstaller\getCheckBox(), EditPage\getCheckboxes(), SpecialRecentChangesLinked\getExtraOptions(), HTMLCheckField\getInputHTML(), HTMLCheckMatrix\getOneCheckbox(), HTMLMultiSelectField\getOneCheckbox(), LogEventsList\getShowHideLinks(), and HistoryPager\historyLine().
|
static |
Convenience function to build an HTML checkbox with a label.
string | $label | |
string | $name | |
string | $id | |
bool | $checked | |
array | $attribs |
Definition at line 420 of file Xml.php.
References $attribs, $name, $wgUseMediaWikiUIEverywhere, check, closeElement(), global, label(), and openElement().
Referenced by SpecialEditTags\buildCheckBoxes(), SpecialRevisionDelete\buildCheckBoxes(), ProtectionForm\buildForm(), SpecialRecentChanges\categoryFilterForm(), Article\confirmDelete(), SpecialWatchlist\doHeader(), SpecialProtectedpages\getCascadeCheck(), SpecialProtectedpages\getExpiryCheck(), UsersPager\getPageHeader(), SpecialProtectedpages\getRedirectCheck(), LogEventsList\getTitlePattern(), UserrightsPage\groupCheckboxes(), SpecialRecentChanges\namespaceFilterForm(), SpecialPrefixindex\namespacePrefixForm(), HistoryAction\onView(), SpecialSearch\powerSearchBox(), EditPage\showEditForm(), FileDeleteForm\showForm(), SpecialImport\showForm(), SpecialWatchlist\showHideCheck(), SpecialUndelete\showHistory(), and SpecialWhatLinksHere\whatlinkshereForm().
|
static |
Shortcut to close an XML element.
string | $element | Element name |
Definition at line 118 of file Xml.php.
Referenced by buildForm(), ProtectionForm\buildForm(), AllMessagesTablePager\buildForm(), buildTable(), buildTableRow(), checkLabel(), Article\confirmDelete(), SpecialRecentChanges\doHeader(), SpecialWatchlist\doHeader(), QueryPage\execute(), SpecialListGroupRights\execute(), SpecialStatistics\execute(), SiteExporter\exportSite(), SiteExporter\exportSites(), fieldset(), SpecialNewpages\form(), SpecialStatistics\formatRowHeader(), SpecialStatistics\getEditStats(), SpecialVersion\getExtensionCredits(), UsersPager\getPageHeader(), SpecialStatistics\getPageStats(), MysqlInstaller\getSettingsForm(), SpecialVersion\getSkinCredits(), SpecialStatistics\getUserStats(), UserrightsPage\groupCheckboxes(), listDropDown(), SpecialWhatLinksHere\listEnd(), SpecialPrefixindex\namespacePrefixForm(), ImagePage\openShowImage(), SpecialListGroupRights\outputNamespaceProtectionInfo(), SpecialSearch\powerSearchBox(), ApiFormatXml\recXmlPrint(), SpecialSearch\searchProfileTabs(), SpecialWatchlist\setTopText(), EditPage\showEditForm(), UserrightsPage\showEditUserGroupsForm(), FileDeleteForm\showForm(), SpecialEditTags\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), SpecialWhatLinksHere\showIndirectLinks(), SpecialMergeHistory\showMergeForm(), SpecialProtectedpages\showOptions(), SpecialSearch\showResults(), SpecialUndelete\showRevision(), SpecialUndelete\showSearchForm(), SpecialVersion\softwareInformation(), XmlTest\testCloseElement(), ImagePage\view(), and SpecialWhatLinksHere\whatlinkshereForm().
|
static |
int | $year | |
int | $month |
Definition at line 167 of file Xml.php.
References $timestamp, MWTimestamp\getInstance(), 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 ImageHistoryList\beginImageHistoryList(), SpecialEditTags\buildCheckBoxes(), ProtectionForm\buildForm(), buildTable(), buildTableRow(), XmlDumpWriter\caseSetting(), check(), TextPassDumper\clearOpenElement(), Article\confirmDelete(), Preferences\datetimePreferences(), XmlDumpWriter\dbname(), Article\delete(), HistoryPager\diffButtons(), Article\doDelete(), SpecialTags\doTagRow(), elementClean(), SpecialListGroupRights\execute(), SiteExporter\exportSite(), fieldset(), ImageListPager\formatValue(), XmlDumpWriter\generator(), SpecialVersion\getExtensionCredits(), SpecialVersion\getMediaWikiCredits(), Skin\getNewtalks(), SpecialVersion\getSkinCredits(), UserrightsPage\groupCheckboxes(), XmlDumpWriter\homelink(), ImageHistoryList\imageHistoryLine(), input(), ChangesList\insertDateHeader(), label(), SpecialSearch\makeSearchLink(), SpecialPrefixindex\namespacePrefixForm(), XmlDumpWriter\namespaces(), XmlDumpWriter\openPage(), XmlDumpWriter\openStream(), Licenses\outputOption(), DjVuImage\parseFormDjvu(), SpecialSearch\powerSearchBox(), radio(), EnhancedChangesList\recentChangesLine(), ApiFormatXml\recXmlPrint(), SpecialSearch\searchProfileTabs(), EditPage\showEditForm(), UserrightsPage\showEditUserGroupsForm(), FileDeleteForm\showForm(), SpecialUndelete\showHistory(), ProtectionForm\showLogExtract(), MovePageForm\showLogFragment(), SpecialPageLanguage\showLogFragment(), UserrightsPage\showLogFragment(), SpecialMergeHistory\showMergeForm(), SpecialProtectedtitles\showOptions(), SpecialProtectedpages\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.
string | $element | |
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 91 of file Xml.php.
References $attribs, $wgContLang, element(), and global.
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 682 of file Xml.php.
References $args, as, and encodeJsVar().
Referenced by ResourceLoaderClientHtml\getBodyHtml(), OutputPage\getBottomScripts(), ResourceLoaderModule\getDeprecationInformation(), EditPage\getEditToolbar(), ResourceLoaderClientHtml\getHeadHtml(), ResourceLoaderJqueryMsgModule\getScript(), ResourceLoaderLanguageDataModule\getScript(), ResourceLoaderLanguageNamesModule\getScript(), ResourceLoaderSpecialCharacterDataModule\getScript(), ResourceLoaderUserDefaultsModule\getScript(), ResourceLoaderUserOptionsModule\getScript(), ResourceLoaderUserTokensModule\getScript(), ResourceLoaderClientHtml\makeLoad(), JavaScriptContentHandler\makeRedirectContent(), and ResourceLoader\respond().
|
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 664 of file Xml.php.
References $value.
Referenced by encodeJsCall(), WebInstallerComplete\execute(), SpecialJavaScriptTest\exportQUnit(), 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 | String to escape |
Definition at line 626 of file Xml.php.
Referenced by XmlTest\testEscapeJsStringSpecialChars().
|
static |
Replace " > and < with their respective HTML entities ( ", >, <)
string | $in | Text that might contain HTML tags. |
Definition at line 752 of file Xml.php.
Referenced by 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 | Array of attributes for an XML element |
MWException |
Definition at line 67 of file Xml.php.
References $attribs, $name, $out, and as.
Referenced by element(), EditPage\getCheckboxes(), openElement(), XmlTest\testExpandAttributes(), XmlTest\testExpandAttributesException(), and Linker\tooltip().
|
static |
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 578 of file Xml.php.
References $attribs, $content, $s, closeElement(), element(), and openElement().
Referenced by AllMessagesTablePager\buildForm(), SpecialRecentChanges\doHeader(), SpecialNewpages\form(), SpecialWhatLinksHere\getFilterPanel(), HTMLFormFieldCloner\getInputHTMLForKey(), UsersPager\getPageHeader(), CategoryPager\getStartForm(), HistoryAction\onView(), SpecialWatchlist\setTopText(), SpecialEditTags\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialUndelete\showHistory(), LogEventsList\showOptions(), SpecialUndelete\showSearchForm(), UserrightsPage\switchForm(), SpecialWhatLinksHere\whatlinkshereForm(), HTMLForm\wrapFieldSetSection(), and HTMLForm\wrapForm().
|
static |
Convenience function to build an HTML text input field.
string | $name | Value of the name attribute |
int | $size | Value of the size attribute |
mixed | $value | Value of the value attribute |
array | $attribs | Other attributes |
Definition at line 275 of file Xml.php.
References $attribs, $name, $value, and element().
Referenced by ProtectionForm\buildForm(), AllMessagesTablePager\buildForm(), ChangeTags\buildTagFilterSelector(), SpecialRecentChangesLinked\getExtraOptions(), SpecialImport\getMappingFormPart(), SpecialProtectedpages\getSizeLimit(), WebInstaller\getTextBox(), inputLabelSep(), SpecialPrefixindex\namespacePrefixForm(), password(), UserrightsPage\showEditUserGroupsForm(), FileDeleteForm\showForm(), SpecialEditTags\showForm(), SpecialImport\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 381 of file Xml.php.
References $attribs, $name, $value, inputLabelSep(), and list.
Referenced by LogEventsList\getExtraInputs(), CategoryPager\getStartForm(), LogEventsList\getTitleInput(), LogEventsList\getUserInput(), UserrightsPage\switchForm(), and SpecialWhatLinksHere\whatlinkshereForm().
|
static |
Same as Xml::inputLabel() but return input and label in an array.
string | $label | |
string | $name | |
string | $id | |
int | bool | $size | |
string | bool | $value | |
array | $attribs |
Definition at line 400 of file Xml.php.
References $attribs, $name, $value, input(), and label().
Referenced by SpecialRecentChanges\categoryFilterForm(), and inputLabel().
|
staticprivate |
Check if a string is well-formed XML.
Must include the surrounding tag. This function is a DoS vector if an attacker can define entities in $text.
string | $text | String to test. |
Definition at line 707 of file Xml.php.
References $parser.
Referenced by isWellFormedXmlFragment().
|
static |
Check if a string is a well-formed XML fragment.
Wraps fragment in an \<html\> bit and doctype, so it can be a fragment and can use HTML named entities.
string | $text |
Definition at line 735 of file Xml.php.
References $html, and isWellFormed().
Referenced by Parser\validateSig().
|
static |
Convenience function to build an HTML form label.
string | $label | Text of the label |
string | $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 359 of file Xml.php.
References $attribs, as, and element().
Referenced by ProtectionForm\buildForm(), AllMessagesTablePager\buildForm(), checkLabel(), dateMenu(), LogEventsList\getActionSelector(), SpecialRecentChangesLinked\getExtraOptions(), SpecialProtectedpages\getLevelMenu(), SpecialProtectedtitles\getLevelMenu(), UsersPager\getPageHeader(), SpecialProtectedpages\getSizeLimit(), SpecialEditTags\getTagSelect(), SpecialProtectedpages\getTypeMenu(), inputLabelSep(), languageSelector(), SpecialRecentChanges\namespaceFilterForm(), SpecialPrefixindex\namespacePrefixForm(), radioLabel(), UserrightsPage\showEditUserGroupsForm(), FileDeleteForm\showForm(), SpecialEditTags\showForm(), SpecialImport\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 |
bool | $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 204 of file Xml.php.
References $code, $languages, $name, $options, $wgLanguageCode, as, global, label(), option(), tags(), and wfMessage().
Referenced by AllMessagesTablePager\buildForm(), and XmlTest\testLanguageSelector().
|
static |
Build a drop-down box from a textual list.
string | $name | Name and id for the drop-down |
string | $list | Correctly formatted text (newline delimited) to be used to generate the options. |
string | $other | Text for the "Other reasons" option |
string | $selected | Option which should be pre-selected |
string | $class | CSS classes for the drop-down |
int | $tabindex | Value of the tabindex attribute |
Definition at line 508 of file Xml.php.
References $attribs, $name, $options, $tabindex, $value, as, closeElement(), openElement(), and option().
Referenced by ProtectionForm\buildForm(), Article\confirmDelete(), FileDeleteForm\showForm(), and SpecialRevisionDelete\showForm().
|
static |
Create a date selector.
string | $selected | 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 144 of file Xml.php.
References $options, $wgLang, global, and wfMessage().
Referenced by dateMenu().
|
static |
This opens an XML element.
string | $element | Name of the element |
array | $attribs | Array of attributes, see Xml::expandAttributes() |
Definition at line 109 of file Xml.php.
References $attribs, and expandAttributes().
Referenced by ImageHistoryList\beginImageHistoryList(), buildForm(), ProtectionForm\buildForm(), AllMessagesTablePager\buildForm(), buildTable(), buildTableRow(), checkLabel(), EditPage\displayPreviewArea(), SpecialRecentChanges\doHeader(), QueryPage\execute(), SpecialListGroupRights\execute(), SpecialStatistics\execute(), SiteExporter\exportSite(), SiteExporter\exportSites(), fieldset(), AllMessagesTablePager\formatRow(), SpecialStatistics\formatRowHeader(), SpecialStatistics\getEditStats(), SpecialVersion\getExtensionCredits(), UsersPager\getPageHeader(), SpecialStatistics\getPageStats(), MysqlInstaller\getSettingsForm(), SpecialVersion\getSkinCredits(), AllMessagesTablePager\getStartBody(), SpecialStatistics\getUserStats(), UserrightsPage\groupCheckboxes(), listDropDown(), SpecialWhatLinksHere\listItem(), SpecialWhatLinksHere\listStart(), SpecialPrefixindex\namespacePrefixForm(), ImagePage\openShowImage(), SpecialListGroupRights\outputNamespaceProtectionInfo(), SpecialSearch\powerSearchBox(), SpecialSearch\searchProfileTabs(), SpecialWatchlist\setTopText(), EditPage\showEditForm(), UserrightsPage\showEditUserGroupsForm(), SpecialUndelete\showFileConfirmationForm(), FileDeleteForm\showForm(), SpecialEditTags\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), LogEventsList\showLogExtract(), SpecialMergeHistory\showMergeForm(), Article\showMissingArticle(), SpecialProtectedpages\showOptions(), SpecialSearch\showResults(), SpecialUndelete\showRevision(), SpecialUndelete\showSearchForm(), SpecialVersion\softwareInformation(), tags(), XmlTest\testOpenElement(), TraditionalImageGallery\toHTML(), SpecialRevisionDelete\tryShowFile(), ImagePage\view(), and SpecialWhatLinksHere\whatlinkshereForm().
|
static |
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 |
bool | $selected | If true, will be the default selected item |
array | $attribs | Optional additional HTML attributes |
Definition at line 485 of file Xml.php.
References $attribs, and $value.
Referenced by ImagePage\doRenderLangOpt(), XmlSelect\formatOptions(), SpecialProtectedpages\getLevelMenu(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getTypeMenu(), languageSelector(), listDropDown(), ImagePage\openShowImage(), and SpecialImport\showForm().
|
static |
|
static |
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 342 of file Xml.php.
References $attribs, $name, $value, and element().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), HTMLRadioField\formatOptions(), SpecialMergeHistory\formatRevisionRow(), WebInstaller\getRadioElements(), and radioLabel().
|
static |
Convenience function to build an HTML radio button with a label.
string | $label | |
string | $name | |
string | $value | |
string | $id | |
bool | $checked | |
array | $attribs |
Definition at line 445 of file Xml.php.
References $attribs, $name, $value, label(), and radio().
Referenced by AllMessagesTablePager\buildForm(), WebInstallerDBConnect\execute(), SpecialImport\getMappingFormPart(), and SpecialProtectedpages\getSizeLimit().
|
static |
|
static |
Convenience function to build an HTML submit button When $wgUseMediaWikiUIEverywhere is true it will default to a progressive button.
string | $value | Label text for the button |
array | $attribs | Optional custom attributes |
Definition at line 460 of file Xml.php.
References $attribs, $value, $wgUseMediaWikiUIEverywhere, and global.
Referenced by buildForm(), ProtectionForm\buildForm(), AllMessagesTablePager\buildForm(), Article\confirmDelete(), SpecialRecentChanges\doHeader(), SpecialWatchlist\doHeader(), ImagePage\doRenderLangOpt(), WebInstallerPage\endForm(), HTMLForm\getButtons(), VFormHTMLForm\getButtons(), UsersPager\getPageHeader(), SpecialPrefixindex\namespacePrefixForm(), ImagePage\openShowImage(), SpecialWatchlist\setTopText(), UserrightsPage\showEditUserGroupsForm(), SpecialUndelete\showFileConfirmationForm(), FileDeleteForm\showForm(), SpecialEditTags\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), SpecialMergeHistory\showMergeForm(), SpecialProtectedtitles\showOptions(), SpecialProtectedpages\showOptions(), LogEventsList\showOptions(), SpecialUndelete\showSearchForm(), UserrightsPage\switchForm(), SpecialRevisionDelete\tryShowFile(), 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 | Array of attributes |
string | $contents | Content of the element |
Definition at line 131 of file Xml.php.
References $attribs, and openElement().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), buildForm(), ImportReporter\close(), SpecialRecentChanges\doHeader(), SpecialTags\doTagRow(), SpecialUndelete\formatRevisionRow(), AllMessagesTablePager\formatRow(), SpecialStatistics\formatRowHeader(), ChangeTags\formatSummaryRow(), PreferencesForm\getButtons(), SpecialStatistics\getEditStats(), ChangeTagsLogItem\getHTML(), ChangeTagsRevisionItem\getHTML(), RevDelRevisionItem\getHTML(), SpecialProtectedpages\getLevelMenu(), SpecialProtectedtitles\getLevelMenu(), SpecialStatistics\getPageStats(), WebInstaller\getRadioElements(), HistoryPager\getStartBody(), CategoryPager\getStartForm(), EditPage\getSummaryInput(), EditPage\getSummaryPreview(), SpecialProtectedpages\getTypeMenu(), SpecialStatistics\getUserStats(), UserrightsPage\groupCheckboxes(), HistoryPager\historyLine(), WebInstaller\label(), languageSelector(), MediaTransformOutput\linkWrap(), SpecialWhatLinksHere\listItem(), ImagePage\openShowImage(), DjVuImage\parseFormDjvu(), SpecialSearch\powerSearchBox(), Linker\revDeleteLink(), Linker\revDeleteLinkDisabled(), SpecialSearch\searchProfileTabs(), SpecialSearch\shortDialog(), SpecialRevisionDelete\showForm(), LogEventsList\showOptions(), SpecialTags\showTagList(), 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 604 of file Xml.php.
References $attribs, $content, $name, and element().
Referenced by WebInstaller\getTextArea(), SpecialExpandTemplates\makeOutput(), XmlTest\testTextareaAttribs(), and XmlTest\testTextareaNoContent().
|
static |
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 263 of file Xml.php.
References $attribs, $tag, and tags().
Referenced by SpecialWhatLinksHere\listItem().